{"id":21200,"library":"edx-i18n-tools","title":"edX Internationalization Tools","description":"edX Internationalization Tools is a Python library providing utilities for extracting, generating, and managing translation files (PO, MO, XLIFF) in edX projects. It wraps Babel, polib, and lxml. Current version 2.0.0 drops Python 3.11 support. Release cadence is irregular, with major versions driven by Python version drops.","status":"active","version":"2.0.0","language":"python","source_language":"en","source_url":"https://github.com/openedx/i18n-tools","tags":["i18n","localization","translation","edx","openedx"],"install":[{"cmd":"pip install edx-i18n-tools","lang":"bash","label":"default"}],"dependencies":[],"imports":[{"not":"from edx_i18n_tools import extract_i18n","note":"Common mistake: using underscores instead of hyphens in package name, or using 'edx_i18n_tools' as the module.","symbol":"extract_i18n","correct":"from i18n_tools import extract_i18n"},{"not":"from i18n_tools.generate import generate_po","note":"generate_po is exposed directly at package level, not from a submodule.","symbol":"generate_po","correct":"from i18n_tools import generate_po"},{"not":"from i18n_tools import I18nToolConfig","note":"I18nToolConfig is in the config submodule, not directly in i18n_tools.","symbol":"I18nToolConfig","correct":"from i18n_tools.config import I18nToolConfig"}],"quickstart":{"code":"from i18n_tools import extract_i18n\n\n# Extract translatable strings from source files\nextract_i18n(\n    source_paths=['./my_project'],\n    output_file='./locale/messages.po',\n    keywords=['_', 'gettext', 'ngettext:1,2']\n)\nprint('Translation extraction complete.')","lang":"python","description":"Extract translatable strings from Python source files into a PO file."},"warnings":[{"fix":"Upgrade Python environment to 3.12 or later.","message":"Version 2.0.0 drops support for Python 3.11. Only Python 3.12+ is supported.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Replace shell script calls to 'extract' with Python code using i18n_tools.extract_i18n().","message":"The 'extract' command-line entry point has been removed in v2.0.0. Use the Python API instead.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Install system dependencies: apt-get install libxml2-dev libxslt1-dev (Debian/Ubuntu) or brew install libxml2 libxslt (macOS).","message":"The library depends on lxml which may require system libraries (libxml2, libxslt). Pip install may fail on minimal systems.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'import i18n_tools' (or 'from i18n_tools import ...').","cause":"The package is installed as 'edx-i18n-tools' but imported as 'i18n_tools'. Users mistakenly try to import 'edx_i18n_tools'.","error":"ModuleNotFoundError: No module named 'i18n_tools'"},{"fix":"Replace 'i18n_tools.extract(...)' with 'i18n_tools.extract_i18n(...)'.","cause":"In v2.0.0, the 'extract' function was removed. The correct API is 'extract_i18n'.","error":"AttributeError: module 'i18n_tools' has no attribute 'extract'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}