Translate Search Results breadcrumb

    $('.search-results h1.h-landmark span, .search-results .x-breadcrumbs a.current').text('Your Text Here');

Hello @Mbzo,

Thanks for writing in!

If you had translated your site correctly, you will not need the JS code to translate “You Are Here” text in the search results. You will encounter other strings that needs translation. It is better that you do it correctly. For more details on how you can completely translate X theme or Pro theme, please check this out:

Or instead of having a JS code, you may add this php code in your child theme’s functions.php file:

// Translate a keyword
// =============================================================================
function change_text($translated) { 
  $your_text  = "insert your translation here";
  $translated = str_ireplace('You are here', $your_text, $translated);
  return $translated; 
add_filter('gettext', 'change_text' );
// =============================================================================

Hope this helps.

Thanks RueNel, appreciate your feedback. The php snippet is useful.

Just a question about the link you sent. That seems to be for installing the theme. IIs there something on that page about how to correctly translate the theme? At the moment I´m using a third-party plugin (LocoTranslate)

Hello @Mbzo,

Oh sorry for the link. I mean this one:

Since you are using LocoTranslate plugin, you should be able to translate all the keywords. Simply look for it in LocoTranslate translation settings and insert your translations.


Mil gracias!

No Problem.
If you need anything else we can help you with, don’t hesitate to open another thread.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.