Is there any way to get the {{ request.locale.iso_code }} tag (or any other tag) to show the full language code instead of just the first part (“en_GB” vs only “en”)?
As an example. In our US site i would like the head html to show the lang as “en_US” instead of just “en”. But for the life of it I can’t figure out why I can’t get this info when it’s used in the URL and everywhere else.
We’re using Markets and everything works otherwise as it should.
the value of {{request.locale.iso_code }}may be determined by the theme’s code and can be different from one theme to another. To show the full language code, you’ll need to modify the code in the theme.
You can do this by creating a new Liquid variable that stores the full language code and then using that variable in the HTML. Here’s an example:
Thank you for the help! I did not get this to work exactly the way intended, so I had to finally invent a workaround instead. I just find it curious why the {{request.locale.iso_code }} only retrieves the first part and not the full code. I assume there is a reason for this though, like always.
The problem is mostly with apps, which often target languages and countries differently from the Shopify markets. It’s a bit of a mess at the moment as it’s a mix of different techniques.