Localization of nix.dev Documentation

Hello, NixOS Community,

I’m glad to announce that the :tada: nix-dev-docs-l10n :tada: project is published now:

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

There were topics discussing about Documentation Translation for Nix in Discourse:

I believe this nix-dev-docs-l10n project can fulfill such needs.

10 Likes

FYI, if the upstream project or anyone wants to use the translated .po files prepared by the nix-dev-docs-l10n project, they can clone them from the po/${VERSION} branch with the following command:

git clone --branch=po/${VERSION} --depth=1 https://github.com/localizethedocs/nix-dev-docs-l10n.git locale

Those po/${VERSION} branches are created to facilitate usage by the upstream project. For instance, the zh_TW documentation for the master version can be generated using the commands below:

VERSION=master
LANGUAGE=zh_TW

# Prepare the repository and environment
git clone --branch=${VERSION} --depth=1 \
    https://github.com/nixos/nix.dev.git \
    nix.dev
cd nix.dev
conda create --prefix ./.conda --yes
conda activate ./.conda
conda install conda-forge::python=3.12 --channel conda-forge --yes
export PYTHONNOUSERSITE=1
pip install \
    sphinx \
    sphinx-book-theme \
    sphinx-copybutton \
    sphinx-design \
    sphinx-notfound-page \
    sphinx-sitemap \
    linkify-it-py \
    myst-parser

# Clone the .po files to the 'locale' directory
git clone --branch=po/${VERSION} --depth=1 \
    https://github.com/localizethedocs/nix-dev-docs-l10n.git \
    locale

# Build the documentation
sphinx-build -b html \
    -D language=${LANGUAGE} \
    -D locale_dirs=../locale \
    -D gettext_compact=0 \
    -D gettext_additional_targets=index,literal-block,raw \
    source \
    _build/${LANGUAGE}

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