A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I'm using postman. This is my query
query getTranslatableResources { translatableResource(resourceId: "gid://shopify/Product/7276207800399") { resourceId translatableContent { key value translatableContentDigest: digest locale } } }
And this is the translatableContent object I get in the response:
"translatableContent": [ { "key": "title", "value": "Cartridge Medium Taper Gauge 10 Tight Liner 5 needles (More than 10 month validity)", "translatableContentDigest": "a73b0b1ad55fc98ab46fb1d41dcb10f7877747c4dc8ed5798129cce398cf0f30", "locale": "en" }, { "key": "body_html", "value": "test", "translatableContentDigest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "locale": "en" }, { "key": "handle", "value": "needle-3", "translatableContentDigest": "deff7e9e149736d4e3ab2e3a1e8268c2015a9a4f54f42b67224dbd0e0f73b91c", "locale": "en" }, { "key": "product_type", "value": "", "translatableContentDigest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "locale": "en" } ]
As you can see, I have added and published Portuguese as a language.
What am I missing?
Hi @SergioF_ ,
Thanks for your post. To see the translations for an added language 'translations' needs to be added to the query with the specification of 'locale' and the desired language. Here's an example from the bottom of the dev docs reference page for the translatableResource mutation adapted to use the info you provided:
{
translatableResource(resourceId: "gid://shopify/Product/7276207800399") {
resourceId
translations(locale: "pt") {
key
value
}
}
}
More info on working with translations with GraphQL can be found on this dev docs page:
https://shopify.dev/docs/apps/selling-strategies/markets/translate-content
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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