Why isn't my localization form changing the language on my site?

Hi,

I’ve been trying to implemented exactly what is been recommended in this url: Multiple Currency and Language Selector , however, the provided script doesn’t work and always throw an error of undefined variable.

So, I tried to make some tweaks utilizing the localization form with Radio Inputs and styling them as a button, however, it doesn’t work.

The below code is inserted in the header.liquid file:


  
{% form 'localization' %}

  {% for language in localization.available_languages %}

{% endfor %}

{% endform %}
  
    
    

Do you have any idea why the above doesn’t work as intended? The form got submitted but the language never changed.

Moreover, why the above link to shopify Dev doesn’t work with their provided script.

Thanks,

Hi,

It will be great if someone gave me at least some hint, I can work that out.

Thanks,

Store url: https://www.mryelh.com

Looking forward to some solutions for the above issue.

Thanks.

1 Like

I have the same problem. I test with currency form https://shopify.dev/api/liquid/tags/deprecated-tags#the-currency-form that is deprecate but it works.

/localization doesn’t accept a parameter of “selector”. You’d need to use country_code or language_code