Translate Key
translate_keyAdd or update a single translation key and translate it into target locales. Supports overwriting stale translations and provides direct or agent-assisted translation modes.
Instructions
Add/update one source translation key and translate it into target locales. Unlike translate_missing, this can overwrite existing stale target translations. Same two modes as translate_missing: provider mode (server env-configured) translates directly; agent mode returns a fallbackContext — translate it inline and persist via write_translations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Dot-separated key path to translate. Example: "bookingCreator.options.removeSubResource". | |
| layer | Yes | Layer name from discover to update (e.g., "root", "app-admin"). | |
| dryRun | No | When true, previews source/target locales without writing files or calling the translation backend. | |
| overwrite | No | When true, overwrite existing target translations. When false, only fill missing targets. Default: true. | |
| projectDir | No | Absolute path to the Nuxt project root. Defaults to I18N_PROJECT_DIR, then server cwd. | |
| sourceValue | No | Optional source value. If provided, source locale is added/updated before translating. If omitted, existing source value is read. | |
| sourceLocale | Yes | Source locale ref. May be code ("en-us"), language ("en-US"), or file ("en-US.json"). | |
| targetLocales | No | Target locales to translate into. Use "all" or omit for all locales except source. | |
| includePreview | No | When true, include translated values in output. Default false to keep responses compact. |