Metafield key is not a valid translatable field

Metafield key is not a valid translatable field

osmx
Shopify Partner
2 0 0

Hello, I have a lot of metafields that I want to translate into another language through the GraphQL API but tried with metafield key and namespace and all I get is that Key [key] is not a valid translatable field

 

this is the query

 

 

 

 

mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
  translationsRegister(resourceId: $resourceId, translations: $translations) {
    userErrors {
      message
      field
    }
    translations {
      key
      value
    }
  }
}
{
  "resourceId": "gid://shopify/Product/xxx",
  "translations": [
    {
      "locale": "ar",
      "key": "placeholder",
      "value": "placeholder",
      "translatableContentDigest": "placeholder"
    }
  ]
}

 

 

 

 

Reply 1 (1)

Waliday
Shopify Partner
3 0 1

You need to check on Shopify's "Translate & Adapt" app. If the field is visible and translatable from that app it means you can reproduce it from code. Now if you see your field you need to open your browser's developer console and go to the Network tab, then you do a first translation and analyze the requests sent as in the screenshot I shared.

 

Capture d'écran 2025-01-18 191559.png

 

Sometimes the documentation lacks explanation 😞