I am trying to correctly localize numbers, dates, and currencies in an embedded Shopify app, but there seems to be a mismatch between the documented localization guidance and the locale information exposed to apps.
What Shopify documents
The App Bridge Config API describes shopify.config.locale as the current admin user’s locale and uses en-US as its example:
Shopify’s localization guide also explains that numbers and dates should be formatted according to the user’s region. For example, en-US, en-GB, and en-CA require different formatting:
What I observed
Shopify’s account settings provide a preferred-language selection followed, where applicable, by a contextual Regional format selection.
For example, after selecting French, Shopify offers regional formats including:
-
France:
fr-FR -
Canada:
fr-CA -
Switzerland:
fr-CH -
Belgium:
fr-BE
However, shopify.config.locale returned fr for both of these configurations:
| Preferred language | Regional format | shopify.config.locale |
|---|---|---|
| French | France | fr |
| French | Canada | fr |
For Portuguese, the preferred-language options are already regionalized. Selecting Portuguese (Portugal) returned pt-PT, as expected. Shopify does not provide a separate Regional format selector for that language choice.
This suggests that App Bridge returns the preferred-language value, but does not expose the separately selected Regional format for languages such as English or French.
Why this is a problem
Given only fr, an embedded app cannot determine whether it should format a number or date using fr-FR, fr-CA, or another French regional convention.
The same applies to English. Given only en, the app cannot distinguish formats such as:
new Intl.NumberFormat("en-US").format(1234567);
// 1,234,567
new Intl.NumberFormat("en-IN").format(1234567);
// 12,34,567
Using navigator.language is only an approximation. A merchant can select a Shopify Regional format that differs from their browser or device locale.
I also could not find a separate App Bridge or Admin API field that exposes the Regional format selected in the Shopify account settings.
Questions
-
Is there a supported API through which an embedded app can retrieve the current admin user’s selected Regional format?
-
Should
shopify.config.localereturn values such asfr-FR,fr-CA, anden-INbased on that setting? -
If returning only
frorenis intentional, what source should embedded apps use to follow Shopify’s regional number, currency, date, and time formatting? -
Could the Config API documentation clarify that the returned locale may contain only the preferred-language code and might not represent the Regional format setting?
Without access to this setting, an embedded app can translate its interface into the correct language, but it cannot reliably match the regional formatting used by the surrounding Shopify Admin.