Development discussions around Shopify APIs
{ availableLocales{ isoCode name } }
I check the list of availableLocales there is Akan (ak),
but when I use translationsRegister with ak language, it gets an error
mutation CreateTranslation($id: ID!, $translations: [TranslationInput!]!) { translationsRegister(resourceId: $id, translations: $translations) { userErrors { message field } translations { locale key value } } }
{ "id": "gid://shopify/Product/xxxx", "translations": { "locale": "ak", "key": "title", "value": "test tran ak", "translatableContentDigest": "xxxxx2" } }
{ "data": { "translationsRegister": { "userErrors": [ { "message": "Locale has an invalid language code", "field": [ "translations", "0", "locale" ] } ], "translations": [] } }, "extensions": { "cost": { "requestedQueryCost": 10, "actualQueryCost": 10, "throttleStatus": { "maximumAvailable": 1000, "currentlyAvailable": 990, "restoreRate": 50 } } } }
Hey @hoitho
Based on the error you are seeing the most likely cause is that you haven't enabled the Locale on your shop. Check out this tutorial for details:
https://shopify.dev/tutorials/translating-content-for-online-store
If that still doesn't work for you kindly reply with the x-request-id from the response headers so we can look into it further.
Kevin_A | Solutions Engineer @ 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
Hi @Kevin_A
I have enabled the Locale on shop
If I have not enabled it will display an error
{ "data": { "translationsRegister": { "userErrors": [ { "message": "Locale is not a valid locale for the shop", "field": [ "translations", "0", "locale" ] } ], } } }
The error I am experiencing is that ak is not available
I think shopify has a problem translating with ak?
{ "id": "gid://shopify/Product/4431163293769", "translations": { "key": "title", "value": "translate title with language ak", "translatableContentDigest": "abd24b9f5a5fdcbaf3610f6db3781b2dd3b394a5c09983cb4cb883e6e3d2e5e6", "locale": "ak" } }
err
{ "data": { "translationsRegister": { "userErrors": [ { "message": "Locale has an invalid language code", "field": [ "translations", "0", "locale" ] } ], } } }
Hey @hoitho
Took another look at this and you are correct, it does appear to be an issue where we haven't properly registered "ak" as a valid locale. I have an open issue with our International dev team on this now. Thanks for reporting this!
Kevin_A | Solutions Engineer @ 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
Hey @hoitho
This should be fixed now. Thanks again for reporting this issue to us!
Kevin_A | Solutions Engineer @ 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
User | RANK |
---|---|
10 | |
5 | |
3 | |
3 | |
3 |
Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023Summary of EventsBeginning in January of 2023, some merchants reported seeing a large amo...
By Trevor May 15, 2023With 2-Factor Authentication being required to use Shopify Payments, we’re here to help yo...
By Imogen Apr 26, 2023