Community Forums › Forums › Internationalization and Translations › How to translate the Search Results Page
Tagged: string translation search box
- This topic has 17 replies, 7 voices, and was last updated 8 years, 5 months ago by
milada.
-
AuthorPosts
-
December 31, 2015 at 6:36 am #175269
tblogster
MemberHello and Shalom,
http://giyur.org.il/?s=any+search
The site I'm building is in Hebrew. When I set it to Hebrew in the Settings>General, most of the default text on the front end changes to Hebrew like it should. (e.g. comments, meta tags).
but the Title of the search results page stays in English "Search results for...:
see here:
http://giyur.org.il/?s=any+search
How can I change this to Hebrew without editing the core Genesis files?
I installed the Genesis translation plugin but it did nothing.
A step by step guide would be so helpful.
Thanks and Shalom
NaomiDecember 31, 2015 at 6:39 am #175271Susan
ModeratorUse one of these code snippets: https://my.studiopress.com/snippets/search-form/
December 31, 2015 at 6:43 am #175272tblogster
MemberThanks for that @Susan.
Those snippets work for the search form. I already did that translation.
Now I need to translate the search results page. Specifically - the title of that page where it says "Search Results for:"
AKA this
http://giyur.org.il/?s=any+searchThanks
NaomiDecember 31, 2015 at 11:02 am #175281baga
MemberI found this:
remove_filter( 'wp_title', 'genesis_default_title', 10, 3 ); add_filter( 'wp_title', 'genesis_default_title_new', 10, 3 ); function genesis_default_title_new( $title) { $title = 'New title'; return $title; }
and it works but I would like to show the search terms as well after the 'New title'.
How can we do?
ThanksJanuary 3, 2016 at 4:50 am #175437tblogster
Member@baga I tried that code and it didn't have any impact for me. probably because the search page does not include a filter called "wp_title". at least it doesn't on my theme (cafe pro).
So this question is still unanswered and I would really appreciate some help.
Thank
NaomiJanuary 3, 2016 at 6:14 am #175438baga
Member@naomi I solved the issue using the plugin Yoast SEO which allows to change the title for the search page as well as the 404 page (page not found title). Hope that helps.
January 3, 2016 at 6:35 am #175439tblogster
Memberwow @baga that worked!
i already had yoast installed so that was a super simple solution.
Thanks a mil
NaomiJanuary 3, 2016 at 7:50 am #175440baga
MemberI'm glad I was able to help!
January 4, 2016 at 4:20 am #175530Konceptuel
MemberHi Naomi,
when your site is in one language only, other than english, you can use a plugin like https://wordpress.org/plugins/loco-translate/ to translate text strings included in themes and plugins.September 18, 2016 at 8:55 am #193316HDDECOR
MemberOctober 18, 2016 at 9:37 am #194968primsrungsuda
MemberNovember 6, 2016 at 10:32 am #195789milada
Member@baga I have the same problem, I have a blog in other languages and the Search box appears in English. I have pasted this code:
//* Customize search form input box text
add_filter( 'genesis_search_text', 'sp_search_text' );
function sp_search_text( $text ) {
return esc_attr( 'Search my blog...' );
}
to the functions.php file
Can you please tell me in more detail how I should use Yoast seo to have it translated in other languages?Thank you very much in advance!
Milada
November 18, 2016 at 2:20 am #196310baga
Memberyou should go to Yoast Seo settings -> Titles and Metas -> Archives -> Special Pages -> Search Pages
and put something like this:[:en]Search results for %%searchphrase%% %%sep%% %%sitename%%[:it]Risultati della ricerca per %%searchphrase%% %%sep%% %%sitename%%
November 18, 2016 at 2:45 pm #196337milada
Member@baga
Hallo baga, thank you, I added this to the path Yoast Seo settings -> Titles and Metas -> Archives -> Special Pages -> Search Pages
This: [:cz]Výsledky pro vyhledávání %%searchphrase%% %%sep%% %%sitename%%[:en]Search results for %%searchphrase%% %%sep%% %%sitename%%[:fr]Résultats de recherche pour %%searchphrase%% %%sep%% %%sitename%%[:it]Risultati della ricerca per %%searchphrase%% %%sep%% %%sitename%%[:de]Suchergebnisse für %%searchphrase%% %%sep%% %%sitename%%in one line. I am afraid there are no separate fields for individual languages. What am I doing wrong?
Thank you in advance,
Milada
November 18, 2016 at 3:06 pm #196341baga
MemberWhat multilanguage plugin are you using?
My suggestion was based on qTranslateX.November 19, 2016 at 4:06 am #196347November 19, 2016 at 4:08 am #196348baga
MemberOk I do not know this plugin.
Maybe you should ask the plugin author then.November 19, 2016 at 4:10 am #196349milada
MemberNo problem. Thank you for your endeavour to help.
-
AuthorPosts
- You must be logged in to reply to this topic.