Search results not displaying in local language

Hi everyone,

My store is translated into 4 languages. When I enter a term using the “search” function in order to find a specific product in my store, the search results will always display in English (the default language), even though the search page is set in a local language i.e. in french.

How can I get the search results to display in the language they were searched?

Btw. I’m using the “Label” Theme.

I’d be immensely grateful for any help - thank you so much!

i was actually hoping for a different answer :grinning_face_with_smiling_eyes: but thank you so much for your quick reply!

1 Like

Hi @Dan_NY @BOOST-STAR , this is not the case. You do not need to modify your theme’s code to add language detection and translation abilities.

Hi @Dan_NY , this is because in your theme in in main-search.liquid on line 46 you have action=“/search” - and what that’s doing is hardcoding the search URL as yourstore.com/search - so it loses the locale when you search (e.g. you want it to stay yoursearch.com/fr/search). To solve this, mention it to your theme developers as it shouldn’t be this way, or you can replace it yourself with action=“{{ routes.search_url }}”.

Oh man !! @richbrown_staff you’re a genius !!! I am not familiar with liquid and/or programming at all, but I managed to find the code and changed the snippet and … Voila!! It works. :grinning_face_with_smiling_eyes: :tada: :+1:t3:

Thank you from the bottom of my heart! I deeply bow to you :folded_hands:t4: and just gotta say it again: you’re a genius !! :grinning_face_with_smiling_eyes: :raising_hands:t3:

Dan

Hi, I’m having the same problem. I’m using the ‘Dawn’ Theme.

How can I get search results to be displayed in a translated language?

@richbrown_staff