Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
I added a new snippet to my theme. I know have the problem, that the new content of the new snippet only appears in English or German (depening on what language I used in the title within the snippet).
How can I set up the snippet that it automatically chooses the language the user chose? Thus if the user browsers the site in Italian want it to be in Italian, in German I want it to be in German.
Alternatively I would be happy to know where in translations I can translate the new part. I have difficulties finding it (using Tlab and Translate & Adapt).
Thankful for every help.
Hi @nastic,
You can use 'request.locale.iso_code' object to check it, refer: https://shopify.dev/api/liquid/objects/shop-locale
For example code:
{% if request.locale.iso_code == 'it' %}
<!-- show content for Italian -->
{% elsif request.locale.iso_code == 'de' %}
<!-- show content for German -->
{% elsif request.locale.iso_code == 'en' %}
<!-- show content for English -->
{% endif %}
Hope it helps!
Hey Litos,
thanks for the reply. Where exactly do I place the code you mentioned?
Thank you so much for your help.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025