Manual
CLI
API
Log in Get started free

Translate the missing strings

Shows what machine translating the strings without a translation would do, and leaves them to be translated in the background.

Machine translates the strings of a branch that have no translation yet, in the languages of the project that are not inactive. It works whether or not automatic translation is switched on, because somebody asks for it.

HTTP
GET /projects/{projectId}/machine-translation/missing
POST /projects/{projectId}/machine-translation/missing

Access: Session token, or an API key with the translations:write scope. Other keys get 403 with insufficient_scope. The role below still applies to the person the key belongs to.

Role: Project manager (organisation owners and admins are managers of every project).

Path parameters and query #

ParameterDescription
projectIdThe id of the project.
branchThe name of the branch, main when left out. In the query of GET, in the query or the JSON body of POST.
languagesOnly these languages, as codes separated by commas or, in the body, as a list. All active languages of the project when left out. A language that is not an active, non-source language of the project, or a value that is not a list of codes, is refused with 422 and fields.languages.

See what is missing #

GET changes nothing and answers 200:

JSON
{ "keys": 12, "translations": 23, "characters": 1840, "provider": "deepl", "running": 0, "unsupported": ["xx"] }
FieldTypeDescription
keysintegerStrings that lack a translation in at least one language. Strings without a source text are left out.
translationsintegerTranslations that are missing and that the service can make, one for each string and language.
charactersintegerAbout how many characters would be sent: the source text once for each missing translation.
providerstring|nullThe service that would translate, the one chosen for the project or else the organisation’s default. null when none is connected.
runningintegerJobs of this project that have not finished. While there are any, a request to translate is refused.
unsupportedstring[]Languages the service cannot translate into. They are not in the counts above, and a request to translate leaves them alone. Empty when no service is connected, because nothing is known then. Use another service for these languages, or translate them by hand.

Translate them #

POST leaves the strings to be translated by the background workers, as drafts flagged as machine translated, and answers 200 at once:

JSON
{ "queued": 12, "translations": 23, "characters": 1840, "unsupported": ["xx"] }

unsupported is the same as in the answer of GET. The translations appear while the workers get to them, a few at a time and one organisation at a time. Existing translations are never replaced, also not one that somebody saves in the meantime. The characters count towards the monthly limit of the service. The request is recorded in the audit log as mt.autofill.

Errors #

StatuserrorWhen
401unauthenticatedThe token is missing or not valid.
403forbiddenYou are not a manager of the project.
404not_foundThe project or the branch does not exist, or you have no access to it.
422invalid_requestlanguages names a language that is not translated, or is not a list of codes.
409mt_not_configuredPOST only: no machine translation service is connected.
409mt_fill_runningPOST only: the strings of this project are already being translated.
409project_frozen, branch_frozenPOST only: the project or the branch is frozen.
429rate_limitedToo many requests, see Rate limiting.

See Errors for the error format.