rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

Localization of Rust Request For Comments

Open hwhsu1231 opened this issue 4 weeks ago • 4 comments

Hello, Rust Community,

I’m glad to announce that the šŸŽ‰ rust-rfcs-l10n šŸŽ‰ project is published now:

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

If translators want to translate a language that is not yet supported, they just need to open a new issue to request the new language. Once the requested language is added, they can begin translating.

hwhsu1231 avatar Dec 01 '25 18:12 hwhsu1231

Besides, if the upstream project or anyone wants to use the translated .po files prepared by the rust-rfcs-l10n project, they can clone the .po files from the po/${VERSION} branch by using the following command:

git clone --depth=1 --branch=po/${VERSION} https://github.com/localizethedocs/rust-rfcs-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/rust-lang/rfcs.git \
    rust-rfcs
cd rust-rfcs
conda create --prefix ./.conda --yes
conda activate ./.conda
conda install \
    conda-forge::rust=1.90 \
    conda-forge::dasel=2 \
    conda-forge::python=3.12 \
    --channel conda-forge --yes
export CARGO_INSTALL_ROOT=$(pwd)/.conda
export PYTHONNOUSERSITE=1
cargo install mdbook@^0.5 mdbook-i18n-helpers@^0.4

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

# Build the documentation
export MDBOOK_BOOK__LANGUAGE=${LANGUAGE}
export MDBOOK_PREPROCESSOR='{
  "gettext":{
    "after":["links"],
    "po-dir":"locale"
  }
}'
python generate-book.py
rm -rf book
mdbook build . --dest-dir book/${LANGUAGE}

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

hwhsu1231 avatar Dec 01 '25 18:12 hwhsu1231

I don't think we currently have the capacity or interest to use this upstream here, but it does look like a cool project to make Rust documentation more accessible downstream :).

Noratrieb avatar Dec 11 '25 23:12 Noratrieb

Hello, @Noratrieb

Thanks for your replies.

It is fine that the upstream (rfcs) currently doesn't have the capacity or interest to use the .po files prepared by the downstream (rust-rfcs-l10n). The "how to use the translations" demonstration I provided above was not a request for rfcs to immediately start using the .po files prepared in rust-rfcs-l10n. Rather, it was to show that if the rfcs or Rust team, after a period of evaluation, deems the rust-rfcs-l10n project stable enough and the translation quality of certain languages maintained within it to be good enough, they can directly integrate and use them via the method I introduced.

hwhsu1231 avatar Dec 12 '25 03:12 hwhsu1231

I'm unclear of the value of translating all the old RFCs is, because in Rust the RFC is not a definitive authority on anything. It's a snapshot of an idea, historical. Sometimes the RFC doesn't reflect the stabilized feature, and RFCs are deliberately not updated when this happens.

Lokathor avatar Dec 12 '25 03:12 Lokathor