I’m having problems when trying to display the correct formatting of the currency for different clients. I’m using Intl.numberFormat, but I need to specify the locale string to display some currency symbols (e.g. ‘en-US’).
When looking into the internationalization docs, it says
For example, embedded apps receive the merchant’s chosen locale in the
localerequest parameter in Shopify’sGETrequests to the app
But when looking into the locale, it’s just the language designator part of the locale string (‘en’). Later on the same dos, it says
The format of prices varies by currency and region, not by language.
and shows some examples. So what I’m missing is the region part of the locale string (‘US’).
Looking into the shop resource in the REST api, I noticed that there’s a country_code that seems like I could use, but I didn’t find any information about this being a safe way to format the locale string.
Has anybody run into this issue? Is this the correct way to achieve internationalization?
Thanks