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 | Translation engine: an AI model or a machine-translation provider |
apiKey | string | API key for the AI provider | |
batchConcurrency | integer | 1 | Number of concurrent batch calls (0 or 1 = sequential) |
batching | string | auto | How many blocks share one LLM call |
context | string | key | What the model is told about a block besides the block itself |
contextWindow | integer | 2 | Blocks either side to send as reference (with context: neighbours) |
instruction | string | Extra guidance for the model while translating (e.g. 'informal register; keep product names in English') | |
model | string | AI model name | |
provider | string | anthropic | AI provider |
skipMatched | boolean | false | Skip blocks that already have a target translation |
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