Solved

Performing search reverts localization back to English (primary language)

iolo72
Shopify Partner
23 1 3

Everytime I do a search on a French page (English is primary), the resulting page reverts to English and the results are in English as well. Any way to keep French throughout the whole search experience?

Thanks.

Accepted Solution (1)
richbrown_staff
Shopify Staff
638 91 155

This is an accepted solution.

Hiya, we've had a quick look. On line 3991 of your theme.js file we think you might be overriding the route with a hardcoded /search. It's a custom theme so we can't go much deeper, but this would be a place to investigate. The search works in French if you go to yourwebsite.com/fr/search 

 
 

08-27-0bns4-90exy.png

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 11 (11)

Guleria
Shopify Partner
3087 606 864

Hello @iolo72 ,

 

Check the action of the search form and replace it with this 
action="{{ routes.search_url }}"

Thanks

- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on store Hire me.
- Email: guleriathakur43@gmail.com - Skype: navrocks1 ,
- Try GEMPAGES a great page builder
-Advance Search Filter
iolo72
Shopify Partner
23 1 3

@Guleria Hello, thanks for the reply. Assuming that you're talking about search-bar.liquid, it already has that line in there.

iolo72
Shopify Partner
23 1 3

It looks like {{ routes.search_url }} correctly puts the localization info in the form when it's rendered on the page (action="/fr/search") but as soon as I hit enter (or click the magnifying glass) to search, the result page reverts back to English.

richbrown_staff
Shopify Staff
638 91 155

@iolo72 do you use any apps for search? And what theme are you using?

To learn more visit the Shopify Help Center or the Community Blog.

iolo72
Shopify Partner
23 1 3

@richbrown_staff Not sure which theme but it seems to be using Search & Discovery app.

richbrown_staff
Shopify Staff
638 91 155

Thanks. You'll need to share the store either here or by DM to me to help diagnose

To learn more visit the Shopify Help Center or the Community Blog.

richbrown_staff
Shopify Staff
638 91 155

This is an accepted solution.

Hiya, we've had a quick look. On line 3991 of your theme.js file we think you might be overriding the route with a hardcoded /search. It's a custom theme so we can't go much deeper, but this would be a place to investigate. The search works in French if you go to yourwebsite.com/fr/search 

 
 

08-27-0bns4-90exy.png

To learn more visit the Shopify Help Center or the Community Blog.

iolo72
Shopify Partner
23 1 3

@richbrown_staff Thanks for that info. I'm trying to look into that but it seems like the CDN cached .js file is not updating the changes I saved? Upon searching the community there seems to be an issue with that. Is there a way to circumvent this problem? It seems like it's been going on for a while.

iolo72
Shopify Partner
23 1 3

@richbrown_staff With that CDN cache issue aside (which I found a workaround and posted here) I managed to edit theme.min.js to make it work. Much appreciated for pointing me to the solution!

richbrown_staff
Shopify Staff
638 91 155

Great!

To learn more visit the Shopify Help Center or the Community Blog.

yexoso
Visitor
1 0 0

What apps are you using?