Why does my language selection revert to English on certain pages?

Why does my language selection revert to English on certain pages?

Shopify Partner
5 0 0

Hello guys, hope you doing good, i want to ask you something about the translation of my shopify website, i added a language selector using code but i choose for example the dutch language it appears to me the dutch version of the web site and i can keep seing the translation when i navigate between some pages like products, blog, contact and request page but i wanted to visit some other pages like wishlist, account and come back to home page, it bring me back to the initial and default language whiich is english ?

Replies 3 (3)

Shopify Staff
651 95 160

Hi @medKal , check with your theme developers - it's because the links for /account and /wishlist are hard coded and do not use the 'routes object'. For example in Dutch it should link to /nl/account.

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

Shopify Partner
5 0 0

Thank you dear for your answer, yes i agree with you, so i tried to fix that using condition in the hardcoded url but still can't work properlly, because it keeps duplicate the like evrytime i check into it and for the if condition it does work, for the links for example its "https://ronvandam.myshopify.com/nl/pages/wishlist" and when i clicked on it again it turns into "https://ronvandam.myshopify.com/nl/pages/wishlist/nl/pages/wishlist

here is the condition i used :

<div class="wishlist">

<a class="header-wishlist" {% if form.current_locale.iso_code == 'en' %} href="pages/wishlist" {% else %} href="nl/pages/wishlist" {% endif %}>

<span class="wishlist-icon"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg></span>
<span class="wishlist-title">{{ settings.wishlist_title }}</span>
<span class="wishlist-counter">{% if wishlist.count %}{{ wishlist.count }}{% else %}0{% endif %}</span>


what do you think dear ?

Shopify Partner
2 0 0



You can try this: 

{% if shop.locale =='en' %}
<a href="{{ shop.url }}/{{ shop.locale }}/pages/wishlist"