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 | |
4 | |
3 | |
3 | |
3 |
As a business owner, have you ever wondered when your customer's first impression of yo...
By Skye Jun 6, 2023We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023