Currency formatting on internationalization

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 locale request parameter in Shopify’s GET requests 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

I’m experiencing the same issue. It seems like the window.Shopify.currency should include a locale property as well to make it easy to achieve this, but sadly it doesn’t. I don’t think the shop resource will work in my case since the localization doesn’t have to match the shop’s.

Did you ever solve this?