Translations (single values)

Read many translations

Read up to 1,000 keys in one locale in one request.

POST
/v1/translations/batch

Read up to 1,000 keys in one locale in one request. It is a POST only so the key names fit in a body; it changes nothing. Names that do not exist in the project are left out of rows, and a locale the project does not have returns no rows rather than an error.

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
locale*string
Lengthlength <= 35
keys*array<>
Items1 <= items <= 1000

Response Body

The rows found.

application/json
  1. response
rows?array<>
curl -X POST 'https://api.transglot.ai/v1/translations/batch' \  -H 'Content-Type: application/json' \  -d '{  "locale": "fr",  "keys": [    "checkout.submit",    "checkout.error.declined"  ]}'
{  "rows": [    {      "id": 0,      "name": "string",      "description": "string",      "is_plural": true,      "max_length": 0,      "tags": [        {          "id": 0,          "name": "string"        }      ],      "source_tokens": {        "kind": "simple",        "spans": [          {            "start": 0,            "end": 0,            "kind": "text"          }        ],        "forms": {          "property1": [            {              "start": 0,              "end": 0,              "kind": "text"            }          ],          "property2": [            {              "start": 0,              "end": 0,              "kind": "text"            }          ]        }      },      "source": {        "id": 0,        "content": "string",        "plural_forms": {          "property1": "string",          "property2": "string"        },        "state": "ai_translated",        "stale": true      },      "target": {        "id": 0,        "content": "string",        "plural_forms": {          "property1": "string",          "property2": "string"        },        "state": "ai_translated",        "stale": true,        "content_hash": "string",        "needs_review": true,        "qa_score": 0,        "mqm_score": 0,        "qa_findings": [          {            "category": "string",            "severity": "string",            "message": "string",            "suggestion": "string"          }        ],        "ai_confidence": 0,        "authored_by_you": true      }    }  ]}