sphinx-intl is a utility for Sphinx that simplifies the process of translating documentation. It helps manage `.pot` (Portable Object Template) and `.po` (Portable Object) files, making it easier to extract translatable messages, update translations, and build translated versions of Sphinx projects. The current version is 2.3.2, and it typically sees a few releases per year, keeping pace with Python and Sphinx updates.
pip install sphinx-intlNo compatibility data collected yet for this library.
This quickstart demonstrates the core workflow of sphinx-intl using a temporary Sphinx project. It covers generating `.pot` files, initializing a locale, updating `.po` files, simulating translation, building `.mo` files, and finally building the translated HTML output.
Upgrade your Python environment to 3.9 or newer. If this is not possible, pin `sphinx-intl<2.3.0` in your project's dependencies.
Upgrade to sphinx-intl 2.3.2 or newer to ensure `locale_dirs` is correctly honored when provided via `conf.py` with the `-c` option. Verify `locale_dirs` in your `conf.py` and potentially use the `-d` option explicitly with `sphinx-intl` commands.
If using Transifex and upgrading from versions significantly older than 2.2.0, review your `.tx/config` and test translation workflows carefully. For new projects or upgrades, 2.2.0 and newer should provide consistent `resource_name` behavior.
Upgrade your Python environment to version 3.9 or newer, or install an older compatible version of sphinx-intl (e.g., `pip install 'sphinx-intl<2.3.0'`).
Ensure sphinx-intl is installed in your active Python environment (`pip install sphinx-intl`) and that your environment's `Scripts` or `bin` directory is correctly included in your system's PATH.
Ensure the target locale directory exists before running `sphinx-intl` commands, or create it manually (e.g., `mkdir -p _build/locale`). The `init` command usually creates the initial structure, but `update` or `build` expect it to be present.
First, ensure `sphinx-build -b gettext ...` has been run successfully to generate `.pot` files in the specified directory. Then, verify that the `--pot-dir` argument points to the correct location.