odoo-i18n
БесплатноЗапускает вложенные скриптыНе проверенComprehensive Odoo i18n toolkit for extracting translatable strings, validating .po files, generating translation reports, managing Arabic/RTL layouts, and…
от ahmed-lakosha★ 79 звёзд на GitHubОб этом скилле
Odoo i18n Skill
Provides deep expertise in Odoo internationalization (i18n) and localization (l10n) across Odoo 14-19.
Critical Translation Rules
- NEVER use f-strings inside
_()-- use%formatting:_('Record %s') % name - NEVER concatenate strings inside
_()-- give the translator the full sentence - Use
_lt()for class-level strings (selection values, class attributes) - NEVER wrap
string=field attributes in_()-- they are auto-translated by Odoo - Save
.pofiles as UTF-8 without BOM - Arabic
.pofiles must havenplurals=6in Plural-Forms header - Always update the module after editing
.pofiles:-u module --stop-after-init
Workflow 1: Extract Translatable Strings
Scans an Odoo module for all translatable strings and generates .pot (template) and .po (language) files.
Usage
python ${CLAUDE_PLUGIN_ROOT}/odoo-i18n/scripts/i18n_extractor.py --module <path> --lang <code> [--output <dir>] [--no-pot] [--verbose]
| Argument | Required | Description |
|---|---|---|
--module |
Yes | Path to the Odoo module directory |
--lang |
Yes | Target language code (e.g., ar, fr, tr) |
--output |
No | Custom output directory (default: module/i18n/) |
--no-pot |
No | Skip generating .pot template |
--verbose |
No | Show all extracted strings |
What Gets Extracted
Python (*.py) -- _('...') and _lt('...'):
# Extracted:
raise UserError(_('Record %s not found') % name)
state = fields.Selection([('draft', _lt('Draft'))])
# NOT extracted: _(variable), _(f'Hello {name}')
XML (*.xml) -- string=, help=, placeholder= attributes; name= on menus/actions; HTML text:
<field name="state" string="Status"/> <!-- extracted -->
<h1>Welcome to our website</h1> <!-- extracted -->
<record id="view_my_form" model="ir.ui.view"> <!-- NOT extracted -->
JavaScript (*.js) -- _t('...') and _lt('...'):
const msg = _t("Save Changes"); // extracted
const msg = _t(someVariable); // NOT extracted
Generated File Structure
# Translation template for my_module
msgid ""
msgstr ""
"Project-Id-Version: Odoo Module my_module\n"
"Content-Type: text/plain; charset=UTF-8\n"
#: models/my_model.py:45
#, python-format
msgid "Record %s not found"
msgstr ""
Alternative: Odoo's Built-in Extractor
python odoo-bin -c conf/myproject.conf -d mydb \
--i18n-export --modules=my_module --language=ar \
--output=my_module/i18n/ar.po --stop-after-init
The Odoo CLI extractor includes database strings (model names, action names) that the plugin extractor does not. For production, the built-in extractor is more complete.
After Extraction
- Open the
.pofile in a translation editor (Poedit, Virtaal, or text editor) - Fill in all
msgstrentries - Validate: run
i18n_validator.py --po-file path/to/ar.po - Check coverage: run
i18n_reporter.py --module path/ --lang ar - Load into Odoo: update module or use export/import workflow
Workflow 2: Validate .po Files
Validates a .po file for syntax errors, encoding issues, empty translations, fuzzy entries, format specifier mismatches, and Arabic/RTL-specific problems.
Usage
python ${CLAUDE_PLUGIN_ROOT}/odoo-i18n/scripts/i18n_validator.py --po-file <path> [--lang <code>] [--strict] [--output <file>]
| Argument | Required | Description |
|---|---|---|
--po-file |
Yes | Path to the .po file to validate |
--lang |
No | Language code for language-specific checks (auto-detected from filename) |
--strict |
No | Treat untranslated strings as errors instead of warnings |
--output |
No | Write report to a file instead of stdout |
What is Validated
Syntax: UTF-8 encoding (no BOM/Latin-1), header with Content-Type/charset/Language/MIME-Version, properly quoted strings, no parse errors.
Translations: Empty msgstr (untranslated), fuzzy flags needing review, duplicate msgid, obsolete (#~) entries.
Format Specifiers: %s/%d/%f count must match; %(name)s named specifiers must all appear:
# WRONG - missing second %s:
msgid "Invoice %s due on %s"
msgstr "fatura %s"
# CORRECT:
msgid "Invoice %s due on %s"
msgstr "fatura %s vadesi %s"
Arabic-Specific (--lang ar): Arabic characters present, encoding artifacts from Latin-1, direction control chars, nplurals=6 required, BIDI overrides flagged.
Common Errors and Fixes
"Charset must be UTF-8":
python ${CLAUDE_PLUGIN_ROOT}/odoo-i18n/scripts/i18n_converter.py --action convert --po ar.po --output ar_fixed.po
"Fuzzy translation (needs review)" -- remove the fuzzy flag after verifying:
# Before: # After:
#, fuzzy, python-format #, python-format
msgid "Record %s not found" msgid "Record %s not found"
msgstr "record
Установить odoo-i18n в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл odoo-i18n?
Comprehensive Odoo i18n toolkit for extracting translatable strings, validating .po files, generating translation reports, managing Arabic/RTL layouts, and handling multilingual deployments across Odoo 14-19. <example> Context: User wants to extract translatable strings user: "Extract all translatable strings from my Odoo 17 module to a .pot file" assistant: "I will use the odoo-i18n skill to scan Python _() calls, XML translate attributes, and field strings, then generate a properly structured .pot template file." <commentary>Core trigger - translation extraction workflow.</commentary> </example> <example> Context: User wants Arabic translation user: "Generate an Arabic .po file for my Odoo module" assistant: "I will use the odoo-i18n skill to create an ar.po file with RTL-aware formatting and placeholder translations for all extractable strings." <commentary>Language-specific trigger - Arabic/RTL translation generation.</commentary> </example> <example> Context: User wants to validate a translation file user: "Validate my Arabic .po file for errors" assistant: "I will use the odoo-i18n skill to check syntax, encoding, empty translations, fuzzy entries, and RTL-specific issues." <commentary>Validate trigger - .po file validation.</commentary> </example> <example> Context: User wants to find missing translations user: "Find all strings missing Arabic translation in my module" assistant: "I will compare the .pot template against ar.po and report all untranslated or fuzzy entries." <commentary>Missing trigger - translation gap analysis.</commentary> </example> <example> Context: User wants RTL/SCSS help user: "Fix the RTL layout issues in my Odoo theme for Arabic" assistant: "I will use the odoo-i18n skill to apply CSS logical properties, [dir='rtl'] overrides, and Font Awesome icon swaps for Arabic support." <commentary>RTL trigger - Arabic layout and styling guidance.</commentary> </example> <example> Context: User needs to export/import translations via Odoo CLI us
Как установить скилл odoo-i18n?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл odoo-i18n запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic