Manage shop locales with the GraphQL Admin API
The ShopLocale
type provides the list of primary and alternate locales on a shop. Each locale has two attributes: primary and published. Only one locale can be the primary locale at a time, but you can't change the primary locale using the API. A shop can have multiple locales in the published or unpublished states.
Shop locale access scopes
Anchor link to section titled "Shop locale access scopes"To use the shop locale GraphQL mutations, your app needs to request the write_locales
access scope for a Shopify store. For more information on requesting access scopes when your app is installed, see OAuth. You can also enable or publish a locale from the Shopify admin.
Locale formats
Anchor link to section titled "Locale formats"Shopify accepts locales in the following formats:
Tag format | Example tag | Description |
---|---|---|
Language subtag only | en | English |
Language subtag + region subtag | en-UK | English as spoken in the UK. |
Retrieve a list of available locales
Anchor link to section titled "Retrieve a list of available locales"The following query retrieves a list of locales that you can enable for a shop, including their ISO country code and name.
Retrieve a shop's locales
Anchor link to section titled "Retrieve a shop's locales"The following query retrieves a list of the shop's enabled locales, including the locale tag, the published state, and whether it is the primary tag.
Enable a locale
Anchor link to section titled "Enable a locale"A locale must be enabled before it can be published. The shopLocaleEnable
mutation takes a locale tag. You can request the shop locale in the response to verify that the locale was enabled correctly. Shops are limited to 5 enabled locales.
Publish a locale
Anchor link to section titled "Publish a locale"Publishing a locale makes it available for translation. Make sure that you enable the locale before publishing it. Shops are limited to 5 alternate published locales.
Shop locale webhooks
Anchor link to section titled "Shop locale webhooks"You can subscribe to the following Shop locale webhooks:
locale/update
fires when a locale is changed or published.locale/create
fires when a locale is enabled.