Using liquid to determine language url

Solved
Mehrwest
Tourist
17 0 2

Hey,

I am trying to use control flow liquid code to determine the language code part of the url (e.g. en) to modify the content of the page. I know I could use the language file to store my translations there but it would be much more convenient to change the content of the template itself.

I am using Langify to translate the store.

I would really appreciate your help!

Replies 13 (13)
Amal_djebali
Tourist
11 0 4

Thanks for your answer.

I managed to do what I wanted with a html[lang='en'] .hide-en:display:none CSS solution.

Do you recommend another translation app which is modern and cares about SEO ?

Or, is it better to translate the website using the native Shopify solution (using Settings/Language) ?

Thanks a lot,

andauser
Explorer
66 0 31

Hello,

 

I am actually having the exact same problem. I would like to show different content based on the language. However, I am facing the same issue when {shop.locale} is used.

 

How did you solve your problem?

 

Kind regards,

Ayse

Amal_djebali
Tourist
11 0 4

Hello,

As in my last comment, I just used a CSS class that show/hide components depending on the language.

andauser
Explorer
66 0 31

Hello,

 

Thank you for your answer. However, how did you determine the language of the website since {shop.locale} does not work?

Where did you write html[lang='en'] .hide-en:display:none ?