translate_i18n
Translates missing i18n keys into target locale files using dictionaries, cloud providers, or agent-provided translations while preserving existing translations.
Instructions
Translate missing keys across target locale files using built-in dictionaries, optional cloud providers (DeepL, OpenAI, Gemini), or agent translations without overwriting existing translations.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "translate_i18n"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiKey | No | Optional API key for the chosen cloud translation provider. If omitted, checks environment variables. | |
| dryRun | No | If true, calculates translations and reports results without writing files to disk. | |
| context | No | Contextual clues to guide LLM translation (role, component, element tag, character limits, notes). | |
| glossary | No | Optional brand glossary configuration with 'neverTranslate' brand names list and 'terms' dictionary (e.g. { neverTranslate: ['Antigravity'], terms: { Cart: 'Panier' } }). | |
| provider | No | Optional translation provider ('auto', 'deepl', 'openai', 'gemini', or 'dictionary'). Defaults to 'auto' (checks environment keys with non-blocking fallback to dictionary). | |
| formality | No | Grammatical formality for AI/DeepL translations ('formal', 'informal', or 'neutral'). | |
| namespaces | No | Optional list of namespaces to translate. If omitted, translates all namespaces. | |
| projectPath | No | Optional project root directory. Defaults to current working directory. | |
| sourceLocale | No | Source locale to translate from (e.g. 'en'). Defaults to detected source locale. | |
| targetLocales | No | Target locales to translate to (e.g. ['fr', 'es']). Defaults to detected target locales. | |
| providedTranslations | No | Map of target locale to translations provided by the agent (e.g. { fr: { common: { save: 'Enregistrer' } } } or { fr: { 'common:save': 'Enregistrer' } } or { fr: { save: 'Enregistrer' } }). |