Add a language
add_languageAdd a target language to a project with a BCP 47 tag, returning the canonical code for later calls; optionally start an AI translation run for existing strings.
Instructions
Add a target language to the project. Pass a BCP 47 tag ("de", "pt-BR", "zh-Hans"); the result carries the CANONICAL code (e.g. "pt_BR"), which is the one to use in every later call. Unless translate_now is false, it also starts an AI translation run of the existing strings into the new language, which SPENDS the organization AI word quota; the run happens only when the project translates on its own (auto_translate), whatever translate_now says, and otherwise batch_id and backfill_skipped_reason are both null. Poll get_batch_status with batch_id. A refused run does not refuse the add: the language is still added, batch_id is null and backfill_skipped_reason says why (quota_exceeded, translation_paused, nothing_to_translate). Fails with locale-rejected for an unknown code or a language the project already has, and plan-limit when the account plan has no room for another language. Each new language takes one of the language slots on the account plan (unless another project of the account already uses it), and it cannot be removed through the API, only in the transglot web UI, so do not add languages to experiment. Workspace admins are notified. Requires the "manage" ability.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"locale": "<locale>"
},
"name": "add_language"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| locale | Yes | A BCP 47 tag, e.g. "de", "pt-BR" or "zh-Hans". Case and "-" or "_" do not matter. | |
| translate_now | No | Start translating the existing strings into it now (default true). Spends AI word quota. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| batch_id | Yes | ||
| language | Yes | ||
| backfill_skipped_reason | Yes |