Add a language
Add a target language to the project and, unless `translate_now` is false, start translating the existing strings into it.
Add a target language to the project and, unless translate_now is false, start translating the existing strings into it. Answers 201 with the canonical locale and the run's batch id. A refused run does not refuse the add: the language is added and backfill_skipped_reason says why nothing is translating. The account's plan caps how many distinct languages its projects use; a language another project of the account already uses does not count again. Workspace admins are notified, with the token's name. The person who created the token must still be allowed to add languages to the project.
deployTokenAuthorizationBearer <token>A project deploy token, minted in the console under Settings, Developer, API tokens. Send the whole value, including the numeric prefix before the |. A token carries a set of abilities (push, pull, manage, read, write) and each operation requires one of them. Tokens do not inherit from each other: a manage token cannot read the glossary unless it also has read.
application/json- body
locale*stringA BCP 47 tag such as de, pt-BR or zh-Hans, in any case and with - or _. The project stores and answers the canonical form.
length <= 35translate_now?booleanStart a translation run into the new language straight away. It runs only when the project translates on its own (auto_translate on GET /v1/project), whatever this says.
trueThe language was added.
application/json- response
language*batch_id*|The run translating the existing strings into the language. Poll GET /v1/batches/{batch}; the first read can already be final. null when nothing is translating.
backfill_skipped_reason*|Why a run that was asked for did not start. quota_exceeded: the account's AI words are used. translation_paused: another stop on AI spend, such as AI translation paused for the workspace, an account owner's email address not confirmed yet, or a held account. nothing_to_translate: the project has no source strings yet. null when a run started, when none was asked for, or when the project does not translate on its own (auto_translate off), in which case batch_id is null too. The language is added in every case.
"quota_exceeded""translation_paused""nothing_to_translate"nullcurl -X POST 'https://api.transglot.ai/v1/locales' \ -H 'Content-Type: application/json' \ -d '{ "locale": "de"}'{ "language": { "locale": "pt_BR", "name": "Portuguese (Brazil)", "native_name": "Português (Brasil)", "rtl": false }, "batch_id": 4821, "backfill_skipped_reason": null}