Translation

Start a translation run

Start a Glossa translation run over the project's pending strings.

POST
/v1/translate

Start a Glossa translation run over the project's pending strings. Answers 202 with the batch; poll GET /v1/batches/{batch} until its status is final. One batch per project runs at a time: while one is active this answers 409 active-batch with its id. When nothing is pending, the batch comes back already completed with total 0. A translation you have edited or reviewed is never overwritten by AI; such pairs are counted in skipped.

Authorization

deployToken
headerAuthorizationBearer <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.

Request Body

application/json
  1. body
scope*string

missing and all: every pair with no value, or whose value was written against an older source. stale: only pairs that have a value written against an older source. selected: like missing, limited to key_ids.

Value in"missing""selected""stale""all"
key_ids?array<integer>

Limit the run to these key ids. Honoured with any scope.

Itemsitems <= 2000
locales?array<>

Limit the run to these target locales. Omit for every target locale.

Itemsitems <= 200

Response Body

The run was accepted.

application/json
  1. response

A translation run.

id?integer
status?string

pending and processing are active; the other four are final. Only one batch per project is active at a time.

Value in"pending""processing""completed""completed_with_errors""failed""cancelled"
trigger?string

What started the run.

Value in"manual_missing""manual_selected""auto_edit""language_added""retry_failed""push"
total?integer

Key and locale pairs sent for translation.

completed?integer

Pairs the run finished processing.

failed?integer

Pairs that failed.

skipped?integer

Pairs the run covered and will not write. A translation you have edited or reviewed is never overwritten by AI; such pairs are counted here.

skipped_reasons?|

Skipped pairs by reason. human_value_stands: a person's translation is in place. human_value_stale: a person's translation is in place and the source has changed since, so only a person can update it. source_moved: the source changed while the run was in progress; running again fixes it.

tm_served?integer

Pairs answered from translation memory. They are not part of total.

language_breakdown?|

Pairs per target locale.

started_at?|
Formatdate-time
finished_at?|
Formatdate-time
curl -X POST 'https://api.transglot.ai/v1/translate' \  -H 'Content-Type: application/json' \  -d '{  "scope": "missing",  "locales": [    "fr",    "de"  ]}'
{  "id": 0,  "status": "pending",  "trigger": "manual_missing",  "total": 0,  "completed": 0,  "failed": 0,  "skipped": 0,  "skipped_reasons": {    "property1": 0,    "property2": 0  },  "tm_served": 0,  "language_breakdown": {    "property1": 0,    "property2": 0  },  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z"}