Determine the current locale from JavaScript (ScriptTag)

New Member
2 0 0

Hello,

 

We're trying to update our app (which is completely loaded via a ScriptTag, no liquid templating required) to support multiple locales on Shopify. The problem is, we can't seem to find any reference to the current locale on the site. I checked the Shopify window object, but it's seemingly absent.

 

How can we detect the current locale that Shopify is using? I suppose we could fall back to navigator.language, but I want to make sure we're using the same language that Shopify actively is.

 

Thanks!

0 Likes