ilib-lint-python

raw JSON →
2.0.4 verified Fri May 01 auth: no javascript

An ilib-lint plugin for checking Python i18n resources. Latest version 2.0.4 (stable). This plugin parses PO files and provides rules to validate Python-style substitution parameters in translated strings. It supports f-strings (named and numbered), legacy %-formatting with named placeholders, and Template class substitution. Key differentiator: integrates with the ilib-lint ecosystem, enabling automated checks for common Python localization pitfalls. Releases are infrequent as part of the ilib-mono monorepo. Requires Node >=14 and ESM modules.

error Error [ERR_REQUIRE_ESM]: require() of ES Module
cause Using CommonJS require() to import ESM-only package.
fix
Switch to import syntax or set type: 'module' in package.json.
error Plugin not found: python
cause Plugin name in config does not match the package name.
fix
Use '"plugins": ["python"]' instead of '"plugins": ["ilib-lint-python"]'.
breaking ESM-only: Cannot use require() or CommonJS imports.
fix Use import syntax and ensure Node >=14.
gotcha Plugin name in config must be 'python' not 'ilib-lint-python'.
fix Set '"plugins": ["python"]' in ilib-lint-config.json.
deprecated Legacy %-formatting rules may be less used; f-string rules recommended.
fix Prefer resource-python-fstrings-match and resource-python-fstrings-numbered.
npm install ilib-lint-python
yarn add ilib-lint-python
pnpm add ilib-lint-python

Shows how to install and configure the python plugin for ilib-lint.

// Install: npm install --save-dev ilib-lint ilib-lint-python
// ilib-lint-config.json:
{
  "plugins": ["python"],
  "rulesets": {
    "python": true
  }
}
// Then run: npx ilib-lint