A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi,
I need to update a metafield value for a product in a specific language, such as English, using the API.
For example: I have a product and a metafield. I need to change the value of this product meta field for English or German using GraphQL. Could you guide me on how to do this?
product id is 8561755881811, metafield: bottom_description. i need to change German(de) value for this as "Veränderung testen". meta field type is
Hi ,there
you could refer to this manual Manage translations of merchant-provided content
You should use the mutation translationsRegister:
https://shopify.dev/docs/api/admin-graphql/unstable/mutations/translationsregister
If you want to translate a metafield, the input variables looks like:
resourceId -> id of the metafield
translations -> [
locale -> the language ("it", "en" etc.)
key -> "value" (put this if you want to translate a metafield)
value -> your translation
translatableContentDigest -> hash of the original value (not translated value) of the metafield, calculated with sha-256 algorithm / you can retrieve this value with another API call i don't remember at the moment
]
Hope it can help!