Writes the translation of a key in one language, as a draft or submitted for review.
HTTP
PUT /keys/{keyId}/translations/{language}Access: Session token, or an API key with the translations:write scope.
Role: Any role in the project.
Path parameters #
| Parameter | Description |
|---|---|
keyId | The id of the key. |
language | The language code, such as de-de. |
Request body #
JSON.
| Field | Type | Required | Description |
|---|---|---|---|
value | string | yes | The translation. Trimmed. May be empty for a draft. |
submit | boolean | no | false (default) saves a draft. true submits it: it goes to review, or is approved straight away when the project does not require review. |
machineTranslated | boolean | no | true when the value is an unchanged suggestion. The translation is then flagged as machine translated, unless the project switched the flag off. Any save without it removes the flag. |
JSON
{ "value": "Kasse", "submit": true }Response 200 #
The translation as saved.
JSON
{ "value": "Kasse", "status": "review", "machineTranslated": false }Response fields #
| Field | Type | Description |
|---|---|---|
value | string | The translation. |
status | string | draft, review or approved after saving, changes after requesting changes. |
machineTranslated | boolean | Whether the translation is flagged as machine translated. |
Errors #
| Status | error | When |
|---|---|---|
| 401 | unauthenticated | The token is missing or not valid. |
| 404 | not_found | The key does not exist, you have no access to its project, or keyId is not a UUID. |
| 409 | branch_frozen | The branch is frozen. The same call also fails with project_frozen when the project is frozen. |
| 404 | not_found | The language is not a language of the project, or it is inactive. |
| 422 | invalid_request | value is not a string, submit is not a boolean, submit is true with an empty value (value: empty), the key has no source text (source: missing), or the value is longer than the key’s maxLength (value: too_long). |
| 429 | rate_limited | Too many requests, see Rate limiting. |
See Errors for the error format.
Notes #
Triggers the translation.created webhook when the key had no translation in the language, and translation.approved when the result is approved. Submitting notifies reviewers when the project asks for it.