Localization of The Pipx Documentation

Announcement

We’re glad to announce that the :tada: pipx-docs-l10n :tada: project is now published:

The goal of this project is to translate The Pipx Documentation into multiple languages. Translations are contributed via the Crowdin platform, automatically synchronized with the GitHub repository, and can be previewed on GitHub Pages.

How to Contribute Translations?

To contribute the translations, please follow the following steps:

  1. Create an account on Crowdin Enterprise if you don’t have one.
  2. Log in and go to the pipx-docs-l10n project.
  3. Choose the target language you would like to contribute.

If the target language is not yet supported, please open an issue to request the new language. Once the requested language is added, you can start translating.

How to Reuse Translations?

If the upstream project or anyone wants to reuse the .po files maintained by the this project, they can download the .po files from the po/<version> branch with the following command:

git clone --branch=po/<version> https://github.com/localizethedocs/pipx-docs-l10n.git <locale-dir>

Those po/<version> branches are created to facilitate reusage by the upstream project. For instance, the zh_TW documentation for the latest version can be generated using the demo commands below:

Click to expand the demo commands
BRANCH=main
VERSION=latest
LANGUAGE=zh_TW
BUILDER=html
REPODIR=$(pwd)/pipx-docs
VENVDIR=$REPODIR/.venv

# Prepare the repository and environment
git clone --branch=$BRANCH --recurse-submodules https://github.com/pypa/pipx.git $REPODIR
cd $REPODIR
conda create --prefix $VENVDIR --yes
conda activate $VENVDIR
export PYTHONNOUSERSITE=1
conda install python=3.14 -c conda-forge -c nodefaults --yes
python -m ensurepip
python -m pip install . --group docs

# Clone the .po files to the 'locale' directory
git clone --branch=po/$VERSION https://github.com/localizethedocs/pipx-docs-l10n.git docs/locale

# Build the documentation
pushd docs
sphinx-build \
    -b $BUILDER \
    -D language=$LANGUAGE \
    -D locale_dirs=locale \
    -D gettext_compact=0 \
    -D gettext_additional_targets=index,literal-block,raw \
    . \
    ./_build/$LANGUAGE
popd

# Preview the documentation
firefox docs/_build/$LANGUAGE/index.html