Translate tool
The Translate tool translates untranslated block content. A single
--provider selects the backend: a large-language-model provider (Anthropic,
OpenAI, Gemini, Azure OpenAI, Ollama) or the keyless offline demo provider.
Classic machine-translation engines are not built in; a plugin can register
one, and it is then selected the same way. The result is written as the target
text, with an alternate-translation annotation recording the originating
provider. A target language is required, and credentials are required for
hosted providers (local Ollama and the offline demo need none).
Blocks that contain inline codes are sent through a placeholder-preserving prompt so tags survive translation, then reconstructed from the response. Blocks can be translated one at a time or grouped into batches sent in a single structured call; batches can run concurrently. When run with a session cache, already-translated targets are reused and fresh translations are written back, so repeat runs skip work already done.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
engine | string | llm | Oversettelsesmotor: en KI-modell eller en maskinoversettelseleverandør |
apiKey | string | API-nøkkel for KI-leverandøren | |
batchConcurrency | integer | 1 | Antall samtidige batchkall (0 eller 1 = sekvensielt) |
batching | string | auto | Hvor mange blokker som deler ett LLM-kall |
context | string | key | Hva modellen får vite om en blokk utover blokken selv |
contextWindow | integer | 2 | Blokker på hver side som sendes som referanse (med kontekst: naboer) |
instruction | string | Ekstra veiledning for modellen under oversettelse (f.eks. «uformelt register; behold produktnavn på engelsk») | |
model | string | AI-modellnavn | |
provider | string | anthropic | AI-leverandør |
reuse | string | prior | Offer a block's previously approved translation to the model as reference |
skipMatched | boolean | false | Hopp over blokker som allerede har en måloversettelse |
Configure it live
Examples
Translate with Anthropic
Translate untranslated blocks using an Anthropic model.
provider: anthropic
model: claude-sonnet-4-5
Translate offline with the demo provider
Produce keyless, clearly-marked illustrative output for smoke tests.
provider: demo
Translate only new content
Skip blocks that already have a translation.
provider: openai
skipMatched: true
Processing notes
Operates on translatable blocks with non-empty source; other parts pass through unchanged.
Blocks with inline codes are translated through a placeholder-preserving prompt and reconstructed from the response.
Each translation is recorded as an alternate-translation annotation tagged with the provider.
Limitations
Requires a target language and, for hosted providers, valid credentials.
Hosted providers make network API calls; cost and latency scale with content volume.
Session-cache reuse applies on the block-by-block path; the batched path writes overlays on output but does not pre-skip via the per-block cache.
← Back to the Tool Reference