translationsRegister mutation
Creates or updates translations.
Required access
write_translations access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) { translationsRegister(resourceId: $resourceId, translations: $translations) {} } { “resourceId”: “Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=”, “translations”: [
<font style="color:#1F61A0;">translations</font> <font style="color:#555555;">{</font><font style="color:#1F61A0;">key</font><font style="color:#1F61A0;">locale</font><font style="color:#1F61A0;">outdated</font><font style="color:#1F61A0;">value</font><font style="color:#555555;">}</font><font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font><font style="color:#1F61A0;">code</font><font style="color:#1F61A0;">field</font><font style="color:#1F61A0;">message</font><font style="color:#555555;">}</font>
] }
<font style="color:#555555;">{</font><font style="color:#8B2BB9;">"locale"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font><font style="color:#555555;">,</font><font style="color:#8B2BB9;">"key"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font><font style="color:#555555;">,</font><font style="color:#8B2BB9;">"value"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font><font style="color:#555555;">,</font><font style="color:#8B2BB9;">"translatableContentDigest"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font><font style="color:#555555;">}</font>
Arguments
TranslationInput fields
- key (
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)) REQUIRED
The key of the translation. - locale (
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)) REQUIRED
The locale of the translation. - translatableContentDigest (
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)) REQUIRED
The digest (hash) of the content being translated. - value (
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)) REQUIRED
The value of the translation.
Return fields
- translations (
[[Translation!]](https://shopify.dev/docs/admin-api/graphql/reference/translations/translation))
The translations that were created or updated. - userErrors (
[[TranslationUserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/translations/translationusererror))
List of errors that occurred executing the mutation.
