--- url: https://docs.youcan.shop/store-admin/translations/register.md --- # Register translations Endpoint: `https://api.youcan.shop/translations/{type}/{id}` Method: `PUT` ## Required Scopes * `edit-languages` ## Notes * Send the `key` and `digest` of each translation from the `content` of [Get translations](/store-admin/translations/get). * When a `digest` does not match the current text in the default language, nothing is saved and you get a 422. Read the item again and translate the new text. * Keys that you leave out keep their translation. * Texts of the `theme_` types are validated like in the theme editor. * You get the item as in [Get translations](/store-admin/translations/get). ## Parameters | Param Name | Param Type | Description | Required | | --- | --- | --- | --- | | type | string | A [translatable type](/store-admin/translations/types) | Yes | | id | string | The `id` of an item from the [listing](/store-admin/translations/listing) | Yes | | locale | string | The `locale` of a language from the [listing](/store-admin/languages/listing) | Yes | | translations | array | The translations to save | Yes | | translations.*.key | string | A `key` from `content` | Yes | | translations.*.value | string | The translated text | Yes | | translations.\*.digest | string | The `digest` of the key from `content` | Yes | ## Request ```json { "locale": "fr", "translations": [ { "key": "product:0b6f1e1e-2f8e-4d7f-9a7d-3f8d3c2a1b00:description", "value": "

ChĂȘne massif.

", "digest": "9d86477bf6bf82bb584f0b869ce2da86a7473ff2896a6b0a13c65ea69888cd12" } ] } ``` ## Response \[422] Unprocessable entity, for a stale `digest` ```json { "status": 0, "detail": "The key is unknown or its source text changed. Read the resource again.", "meta": { "fields": { "translations.0.digest": ["The key is unknown or its source text changed. Read the resource again."] } } } ```