AI pre-translation

How AI pre-translation works

The «AI pre-translate» button draft-translates all untranslated strings. The pipeline:

  1. Translation memory (TM) — exact matches are applied free.
  2. Cache — strings translated before (even in other files) are free.
  3. Deduplication — identical strings are merged: one copy goes to the AI, the result is distributed to all duplicates. The log shows «♻ Duplicates merged: N».
  4. AI — the remaining strings go to the model in batches (batch size is configurable, default 8).

Words are charged only for strings that received a translation — TM/cache matches and duplicates cost nothing.

Tone

Selected in the toolbar and passed to the model: Neutral / Formal / Friendly / Gaming slang. For conversational games «gaming slang» produces livelier text; for business software prefer «Formal».

AI context

Two context modes are available in settings:

  • Neighboring lines — two already-translated lines above in the file (the model sees the style and terminology of the surroundings).
  • Code snippet — if the string refs point to a source file that exists on disk, a snippet around the line is added to the request (the model understands what is being translated: a button, a title, a line of dialogue).

Model confidence

The model rates its own confidence (0..1). Threshold options: Off / Normal (0.7) / Strict (0.85). Strings below the threshold get a log warning and stay fuzzy — review them first.

AI variants

The «AI variants per string» setting: 1 = draft only; 2–3 = the model additionally proposes alternatives, shown in the suggestions panel.

QA self-fix

If the model reply loses a placeholder or a newline, the app automatically re-asks the model pointing at the error. Strings that could not be fixed are marked ✕ and are not charged.

Stop

The ⏹ Stop button (replacing the AI button while running) aborts the in-flight request and the batch loop. Received translations are kept; unreceived ones are not charged.

Retries on failures

Network failures (HTTP 0/timeout, 429, 5xx) are retried automatically up to 2 times with a pause (3 s → 6 s), visible in the log («⚠ Network failure (HTTP 0), retry 1/2…»). A batch that cannot be parsed as JSON (truncated reply) is split into halves and retried in parts — no wasteful full retries.