odoo_translate_context_aware
Translate Odoo records with domain-specific context, auto-detecting field types (plain text or HTML/XML) and preserving inline tags for natural, fluent outputs. Uses Claude AI to avoid literal translations.
Instructions
Translate Odoo records using Claude with rich domain context for natural, fluent results (not literal). AUTO-DETECTS field kind and handles both: (1) simple char/text fields (e.g. ir.ui.menu.name, account.account.name) → batch translate via update_field_translations; (2) HTML/XML fields (e.g. ir.ui.view.arch_db, website.page, product.template.website_description) → extracts canonical terms via get_field_translations, translates each term preserving inline HTML tags (, , ...), writes back in terms mode. Context to LLM: Odoo model, parent chain for menus, existing translations, user-supplied domain hint, field kind (simple/html/xml). Requires Odoo 16+. Requires ANTHROPIC_API_KEY env var (per-tenant override: ANTHROPIC_API_KEY_). Recommended models: 'claude-haiku-4-5' (menu labels, fast), 'claude-sonnet-4-6' (balanced, website pages), 'claude-opus-4-7' (complex legal/accounting terminology). ALWAYS use dry_run=true first to review proposals.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | No | default | |
| model | Yes | Odoo model (e.g. 'ir.ui.menu', 'account.account', 'product.template') | |
| ids | Yes | Record IDs to translate | |
| field_names | No | Translatable fields (default: ['name']) | |
| target_lang | Yes | Target language code (e.g. 'bg_BG', 'de_DE') | |
| source_lang | No | Source language (usually 'en_US') | en_US |
| context_hint | No | Free-form domain hint ('accounting terms', 'manufacturing', 'Bulgarian NRA terminology', etc.) | |
| claude_model | No | Claude model ID | claude-haiku-4-5 |
| max_tokens | No | ||
| dry_run | No | If true, only preview (no writes). |