Auto-translate
How LangSync's AI translation works — the batch job, the single-cell suggestion, what the AI sees, and what it costs.
LangSync's AI translation appears in three places:
| Flavour | Where | Stored? |
|---|---|---|
| Batch auto-translate | Translate missing dialog, term creation, bulk import, sync jobs | Yes — fills empty translations |
| Single-cell suggestion | Sparkle button in the side-by-side editor | Only when you save |
| Manual translation | The Manual translation page | Never |
What the AI actually sees
Understanding the inputs tells you how to get better output. Batch auto-translate (the Translate missing dialog, new terms, bulk imports and sync jobs) reads the missing terms of each language 100 at a time and sends them to the model together, each with:
- The source text — the term's value in the source language. For a namespace this is the default language, unless a sync job overrides the source language.
- The term's key (its mark) and its context, the description of where the text is used. Both tell the model what the text is and are never translated. A sync can fill the context from your repository.
- A kind guessed from the key's last segment:
titleorheadingis a heading,buttona button,labelorplaceholdera label,descriptionorhinta description; any other key is running text.settings.dialog.save_buttonis sent as a button.
And for the whole call:
- The language pair — source and target language, by name and code.
- The namespace's description as the context of the work.
- The namespace's default custom prompt, if it has one, or a prompt named in the request. It shapes tone and style.
- Your glossary, automatically. Items are pre-filtered to the source → target pair, so a glossary entry only influences translations it has values for (non-translatable entries apply everywhere).
- A fixed instruction set. Every text is passed to the model as data, never as instructions, and the model runs deterministically (temperature 0) and must answer in a strict JSON schema, one translation per text, never commentary.
What a text's variables are depends on the namespace's
message syntax. In a plain
namespace, variables ({name}, {{name}}, %s), tags and entities
are replaced by tokens the answer must keep. In an icu namespace,
each plural is expanded to the target language's forms and translated
as whole sentences; see ICU messages.
The single-cell suggestion is simpler: it sends the source text, the
language pair, the prompt and the glossary, but not the key, the
context or the namespace's description, and nothing checks its
variables. Review it before you save; in an icu namespace the text is
checked when you save it.
Checked before it is stored
A batch translation is checked before anything is stored: the answer
must keep the source's variables and tags, keep every non-translatable
glossary term that occurs in the source, actually be a translation, and
in an icu namespace be a valid message with the target language's
plural forms. The model is asked again when an answer fails. A term
whose answer still fails is not stored: its translation stays
empty, the other terms are stored, and the next run tries it again.
The email of a Translate missing run counts it as failed, and a
sync job lists it with the key,
the language and a code such as placeholders_changed or
plural_forms (every code).
A term needs a source value before the AI can translate it. A term
whose source-language value is empty is skipped by batch runs, and the
single-cell button is disabled for it (the API returns a
NO_TRANSLATION_SOURCE error).
Batch auto-translate
- Open the namespace (either view) and click Translate missing.
- In the dialog, choose:
- Translate all missing translations (default) — every empty term × language cell in the namespace, or
- Select specific languages to translate — check just the languages you want filled.
- Confirm. The dialog notes it may take a while for large namespaces.
The job runs in the background: "Translation started! You will receive an email when it completes." The email ("Batch translation is complete") reports how many terms were processed and how many failed. Refresh the terms list to watch progress in the meantime.
Batch runs only ever fill empty cells — existing translations, human or AI, are never overwritten. That makes it safe to re-run any time; a batch after a no-op is itself a no-op.
The same batch engine runs automatically when:
- you create a term with Translate automatically enabled,
- a bulk import finishes with Translate automatically checked,
- a sync job's autotranslate phase runs.
Single-cell suggestion
In the side-by-side editor, every target field has a sparkle button ("Generate AI translation"). Click it and the AI's suggestion is placed into the textarea — review it, edit it if needed, and it's only persisted when you hit Save Changes. The button is disabled while the term has no source value.
This is the right tool when you want AI speed with human sign-off on every string, rather than trusting a batch.
The AI label
A translation written by AI shows a small AI badge in the editor (the term dialog, the side-by-side view, and the term list when you review a language), with the hint "Translated by AI and not changed since. Editing the text removes this mark." It marks text nobody has changed since the AI wrote it, so reviewers can see what still needs a human look.
- Batch runs, new terms with Translate automatically, bulk imports and CLI sync mark the translations the AI fills in. Values that come from your import file or your local files are yours and aren't marked.
- A suggestion you save without changing it keeps the label. Change the text and save, and the label goes away.
- Saving the same text again doesn't remove the label; only a change does.
- The Public API returns the flag as
ai_generatedon each item ofGET /api/v1/namespaces/{namespaceName}/terms/translations.
Translations saved before the label existed show no badge: LangSync doesn't know who wrote them.
The label says whose text it is. Whether a person has approved it is a separate review state, which a person sets and any change of the text clears.
Rate limits
Requests that start AI translation share one budget:
- 200 requests per hour per organization, and
- 50 requests per hour per user.
Both limits must pass; exceeding either returns
429 TOO_MANY_REQUESTS. A batch counts as one request however many
cells it fills, so many small batches use the budget faster than one
large one. See Limits and errors
for which requests count.
What gets billed
- A term × language pair is billed once it stores a non-empty translation — regardless of whether a human or the AI wrote it.
- AI calls themselves have no separate per-call charge; the rate limits above are the throttle.
- Single-cell suggestions and manual translations don't store anything by themselves, so they add nothing to storage billing — but they do count against the rate limit.
Before you run a big batch
- Set up the glossary first. Fixing brand names after translating 5,000 strings into eight languages means re-reviewing everything.
- Spot-check with single-cell suggestions in a couple of languages you can read, to sanity-check tone.
- Remember: re-running is safe, but a batch never replaces wrong translations — fix those by hand or clear them first.
Related
- Manual translation — free-form AI translation with glossary and custom-prompt control.
- Custom prompts — reusable style instructions.
- Sync jobs — auto-translate as part of a CI-driven push.