DocsPlatform
Context and glossary
Give the translator style instructions, per-string context, and a glossary of fixed or protected terms.
On this page
Machine translation is only as good as what it is told. Generic Translation gives the model three kinds of guidance, from broadest to most specific.
Style instructions
A free-text note, up to 8,000 characters, passed to the model with every translation in the project. Use it for the audience, tone, formality, and anything to avoid:
A budgeting app for freelancers. Friendly, concise, informal second person.
Use "you" in the informal form (tu, du). Never translate the product name Ledgerly.
Prices and dates are formatted by the app, so do not add them to messages.
The note is added to the prompt as the project’s style guide. The model is told to follow it unless it conflicts with the rules that keep variables and tags intact, so instructions cannot break message structure.
Edit it on the dashboard’s Context page, or with PUT /context. Changes apply to new translations; to see them on existing ones, retranslate those strings in the editor.
Per-string context
The context of a message disambiguates short or ambiguous text. “Close” can be a verb on a button or an adjective for distance:
<T context="button that dismisses a dialog">Close</T>
Context is sent to the model alongside the string and is part of the content hash, so the same text with different contexts is two strings with separate translations. See hashing. For files, context is filled in automatically from the position of the text: the key path in JSON and YAML, the msgctxt and comments in PO, the name in Android and RESX, and so on.
Glossary
A glossary pins terminology. Each term has:
| Field | Meaning |
|---|---|
| Term | The word or phrase as written in the source language. |
| Definition | Optional meaning in your product, to help the model choose a sense. |
| Translations | Optional fixed translation per locale. |
| Do not translate | Keep the term exactly as written in every language, for brand and product names. |
| Case sensitive | Match the exact capitalization only. Off by default. |
How terms are used:
- Before each model call, Generic Translation checks which glossary terms appear in the strings being translated. Only those terms go into the prompt, so a large glossary does not slow every request.
- Matching is on whole words and also works for non-Latin scripts: “work” does not match “workspace”.
- A term with a translation for the target locale is marked mandatory (“always translate as …”, inflected only if grammar requires). The lookup tries the exact locale, then a case-insensitive match, then any locale of the same language, so a
ptentry servespt-BR. - A term without a translation for the locale is translated consistently, guided by the definition.
- The model is instructed to follow the glossary; Generic Translation does not post-process the output to enforce it, so spot-check important terms.
Applying changes to existing translations
Glossary edits affect only future translations. Apply glossary (POST /glossary/apply) finds every string whose source contains a term and re-translates it in every target language as a background job. Translations a person edited or approved are left alone, so your reviewed work is never overwritten; retranslate those individually if you want them to follow the new term.
Who can change what
Reading needs context:read, writing needs context:write (or the member role in the dashboard). See API keys and the API reference.
Something wrong or unclear on this page? Open an issue.