Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

odoo-i18n

БесплатноЗапускает вложенные скриптыНе проверен

Comprehensive Odoo i18n toolkit for extracting translatable strings, validating .po files, generating translation reports, managing Arabic/RTL layouts, and…

ahmed-lakoshaот ahmed-lakosha★ 79 звёзд на GitHub

Об этом скилле

Odoo i18n Skill

Provides deep expertise in Odoo internationalization (i18n) and localization (l10n) across Odoo 14-19.

Critical Translation Rules

  1. NEVER use f-strings inside _() -- use % formatting: _('Record %s') % name
  2. NEVER concatenate strings inside _() -- give the translator the full sentence
  3. Use _lt() for class-level strings (selection values, class attributes)
  4. NEVER wrap string= field attributes in _() -- they are auto-translated by Odoo
  5. Save .po files as UTF-8 without BOM
  6. Arabic .po files must have nplurals=6 in Plural-Forms header
  7. Always update the module after editing .po files: -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

  1. Open the .po file in a translation editor (Poedit, Virtaal, or text editor)
  2. Fill in all msgstr entries
  3. Validate: run i18n_validator.py --po-file path/to/ar.po
  4. Check coverage: run i18n_reporter.py --module path/ --lang ar
  5. 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
Полный SKILL.md на GitHub

Установить odoo-i18n в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

scripts/__init__.pyscripts/_common.pyscripts/i18n_converter.pyscripts/i18n_extractor.pyscripts/i18n_reporter.pyscripts/i18n_validator.py

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 запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить odoo-i18n с