Translation providers
A provider translates; the translator decides what to ask and checks the answers. Providers are tried in order: what one cannot translate, or translates wrong, goes to the next.
| Provider | Package | Translates | Notes |
|---|---|---|---|
| Any language model | llm | whole messages and texts | OpenAI-compatible servers (OpenAI, OpenRouter, DeepSeek, Mistral, Ollama, LM Studio, vLLM), command-line tools |
| Claude | claude | whole messages and texts | the Anthropic API, or the claude command-line tool with its own sign-in |
| DeepL | deepl | texts | the context of a message steers the translation; formality |
| Google Cloud Translation | google-cloud | texts | Basic with an API key; Advanced with a service account: glossaries, Google's language model |
| Azure AI Translator | azure | texts | regional resources, custom domains, containers, Custom Translator models |
| Amazon Translate | amazon | texts | formality, custom terminologies; signed without the AWS SDK |
| LibreTranslate | libretranslate | texts | open source, on your own server: texts never leave it |
| Google Translate | google-informal | texts | free, no key; no SLA — for development and drafts |
| Your own | TranslatorInterface (core) | texts | a few methods: translate, detect, say which languages it can; over HTTP, http-provider gives what the providers above share — retries, errors, markup placeholders, batches, a cached language list |
Texts and whole messages
A text provider (TranslatorInterface) gets one sentence at a time, with arguments as numbered placeholders: Hello, {0}!. It never sees ICU, so it cannot break it; it may translate each form of a plural separately, without the others.
A message provider (MessageTranslatorInterface, language models) gets the whole ICU message with its context and note, and answers with ICU in the forms of the target language. It sees the sentence as a whole — better grammar, consistent forms — and the translator checks the answer the way it checks an import: the same arguments and selectors, the plural forms of the language, the same markup. A message no provider of messages translated goes to the text providers, variant by variant.
Order
Put the provider you trust first. A typical setup: a language model for whole messages, DeepL (or another machine translation service) behind it for what the model could not do. Only DeepL takes the context of a message; the others translate the text alone. Every translation a provider made is stored as a machine one: see Machine translations and review.