Change custom liquid depending the user language

Solved

Change custom liquid depending the user language

12alberto34
Tourist
4 0 1

Hello, 

I have a widget that I added in a Custom Liquid on a page, and I want to be able to change change if depending the language of the user, is there like a class for eng, etc that I can use to show and hide content?

 

I want to be able to hide the spanish widget when the user is on english. 

 

Thank you.

Accepted Solution (1)

Vinsinfo
Shopify Partner
396 138 133

This is an accepted solution.

@12alberto34 Try adding below condition in your Custom Liquid and let me know whether it is helpful for you.

{% if shop.locale == "es" %}
<Paste spanish user widget code here>
{% elsif shop.locale == "en" %}
<Paste english user widget code here>
{% endif %}

 

Please provide your support by click "Like" and "Accepted" if our solution works for you. Thanks for your support.

Please reach out to bizdev@vinsinfo.com for any enquires related to Shopify.
Our Services: Custom Theme Development, Theme Customization, Custom Feature Implementation, Data Migration, Custom APP Development, Website Optimization and Google Merchant Center Support

View solution in original post

Replies 2 (2)

Vinsinfo
Shopify Partner
396 138 133

This is an accepted solution.

@12alberto34 Try adding below condition in your Custom Liquid and let me know whether it is helpful for you.

{% if shop.locale == "es" %}
<Paste spanish user widget code here>
{% elsif shop.locale == "en" %}
<Paste english user widget code here>
{% endif %}

 

Please provide your support by click "Like" and "Accepted" if our solution works for you. Thanks for your support.

Please reach out to bizdev@vinsinfo.com for any enquires related to Shopify.
Our Services: Custom Theme Development, Theme Customization, Custom Feature Implementation, Data Migration, Custom APP Development, Website Optimization and Google Merchant Center Support
12alberto34
Tourist
4 0 1

Thank you very much, I was searching for this! it worked