{"id":25748,"library":"ilib-lint-python-gnu","title":"ilib-lint-python-gnu","description":"A plugin for ilib-lint that checks Python resources using the GNU gettext library. It parses PO files and validates printf-style substitution parameters (like %s, %d) in source and target strings, ensuring parameters match and are properly numbered for translation. Current stable version is 2.0.4, with patch releases under the ilib-mono monorepo. Integrates with ilib-loctool-po for heavy lifting. Designed for ESM environments with Node.js >=12.","status":"active","version":"2.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/iLib-js/ilib-mono","tags":["javascript"],"install":[{"cmd":"npm install ilib-lint-python-gnu","lang":"bash","label":"npm"},{"cmd":"yarn add ilib-lint-python-gnu","lang":"bash","label":"yarn"},{"cmd":"pnpm add ilib-lint-python-gnu","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides the underlying PO file parser","package":"ilib-loctool-po","optional":false},{"reason":"Runtime dependency for plugin integration","package":"ilib-lint","optional":false}],"imports":[{"note":"ESM-only package since v2.0.0; CommonJS require is not supported.","wrong":"const plugin = require('ilib-lint-python-gnu')","symbol":"default","correct":"import plugin from 'ilib-lint-python-gnu'"},{"note":"Named export for explicit plugin class usage.","wrong":null,"symbol":"PythonGnuPlugin","correct":"import { PythonGnuPlugin } from 'ilib-lint-python-gnu'"},{"note":"Access individual rule definitions if needed.","wrong":null,"symbol":"pythonGnuRules","correct":"import { pythonGnuRules } from 'ilib-lint-python-gnu'"}],"quickstart":{"code":"// Install: npm install --save-dev ilib-lint-python-gnu\n// ilib-lint-config.json\n{\n  \"plugins\": [\"python-gnu\"],\n  \"rulesets\": {\n    \"python-gnu\": true\n  }\n}\n\n// Programmatic usage\nimport plugin from 'ilib-lint-python-gnu';\nconsole.log('Plugin loaded:', plugin.name);\n// Expected: Plugin loaded: python-gnu","lang":"typescript","description":"Installs the plugin, adds it to ilib-lint config, and verifies it loads correctly."},"warnings":[{"fix":"Upgrade Node.js to version 12 or later.","message":"Node.js >=12 required; ESM modules not supported in older Node versions.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use ilib-lint version 2.x or higher.","message":"The plugin expects ilib-lint >=2.0.0; older ilib-lint versions may not be compatible.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Run 'npm install --save-dev ilib-loctool-po' alongside this package.","message":"The dependency 'ilib-loctool-po' must be installed separately; it is not automatically included.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Switch to ESM: use import statements or set 'type': 'module' in package.json.","cause":"Using CommonJS require() on an ESM-only package.","error":"ERR_REQUIRE_ESM: require() of ES Module .../node_modules/ilib-lint-python-gnu/index.js from ... not supported"},{"fix":"Install the missing peer: npm install --save-dev ilib-loctool-po.","cause":"Missing peer dependency 'ilib-loctool-po'.","error":"Error: Cannot find module 'ilib-loctool-po'"},{"fix":"Ensure the plugin key in config is 'python-gnu' (not 'ilib-lint-python-gnu').","cause":"Plugin name mismatch in ilib-lint-config.json.","error":"Plugin 'python-gnu' not found in configuration"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}