Search results not displaying in local language

Topic summary

Search results showing in English on a multilingual store despite browsing a local language page.

  • Cause: In the Label theme, the search form is hardcoded with action=“/search” in main-search.liquid (line 46), which strips the locale (e.g., /fr) and routes to the default English URL.

  • Fix: Replace the hardcoded action with action=“{{ routes.search_url }}” to preserve the current locale in the search URL. No additional language detection or translation code is needed.

  • Outcome: The change was implemented by the original poster and confirmed to solve the issue. It’s recommended to inform the theme developers, as this shouldn’t be hardcoded.

  • Ongoing: Another user on the Dawn theme reported the same problem; no specific resolution for Dawn was provided in the thread yet.

  • Key terms: “Liquid” is Shopify’s templating language. “Locale” refers to the language-specific URL segment (e.g., /fr).

  • Central detail: The template file and code snippet are essential to understanding the fix.

Summarized with AI on December 20. AI used: gpt-5.

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