When locale .json file is `available`?

Kszuper
New Member
2 0 1

Hi,

I am struggling with the localization topic. I created `de-AT.json` file but when I call `availableLocales` through GraphQL API, that locale is not found which is quite confusing. May I ask for explanation what it means that the locale is `available`?  I went through the documentation but I did not manage to find anything helpful. 

I will be grateful for any advice. 

Query I sent:

query {
    availableLocales {
        isoCode
        name
    }
}

Replies 3 (3)
GrahamS
Shopify Staff
Shopify Staff
193 35 48

Hey @Kszuper !

We have a tutorial regarding Locales, how to enable them, and how to publish them before calling them HERE

There may be a step in there that you're missing prior to using availableLocales, so I would recommend going through it if you have some time!

Graham S | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Kszuper
New Member
2 0 1

Hi @GrahamS 

Thank you for your reply. I've checked that documentation before. 😉 

Shall I describe step by step what I did and what behaviour I got:

1. I copied locale file `de.json` and named it `de-AT.json` so this file contained German translation.
2. I changed a theme language in a Theme language editor - I found Austrian German language on the drop down list and set it - which is good but there was a warning 'Austrian German translations are not available for the cart, checkout, search, gift card, password, 404, or customer account'
3. I went to Store languages - Austrian German was set as default language - that's ok.
4. I went to Domain settings - Austrian German was on the list (marked default) of languages which visitors can view - that's fine.
5. I sent GraphQl query to receive available locales - Austrian German was not in the response.
6. I changed theme language in the Theme language editor from Austrian German to English.
7. In Store languages English was set as Default language. Under Published languages there was no Austrian German so I tried to `Add language` but there was no Austrian German on the list which also meant that language was no available in Domain settings.
8. I tried to translate the dynamic content (products description) to Austrian German via Translation Lab application but Austrian German was not the list of available languages.

My question is why the locale 'de-AT' was not available in the response on GrapQl query, in Translation App and on the list of languages in Store languages  in case when theme language was different that Austrian German (step 7).

 

I hope the description above better explains my issue 😉

Thank you in advance for your support!

jonasgoddeeris
Tourist
7 0 3

Hi Graham, 

The issue is that we cannot updates the availableLocales object , and the queries to enable and publish new region specific locales ( which are not listed in the availableLocales data) are not possible ...

https://shopify.dev/api/admin-graphql/2021-10/mutations/shopLocaleEnable 
--> returns 'locale is invalid' for "nl-NL"