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.
Interesting!
Can you share sample Url with me? So I can know where language code is appearing.
You can split your url, I need to see if you are following any particular pattern,
Weglot translates your content with javascript in the browser instead of being done server side - it’s old skool.
Basically it works as a translation app but is awful (as in really, really, really awful) for SEO. It stinks and you should avoid if you care about SEO.
What you are seeing here is the problem with weglot (and all the old apps).
If you use a more modern app then the shop.locale object will work. If you use Wegoglot then you’ll need to use javascript to detect language.
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.