rust-lang / rust-lang/edition-guide
Localization of The Rust Edition Guide
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 324
- Forks
- 152
- PR merge metrics
- No merged PRs in 30d
Description
Announcement
Hello, Rust Community,
Iβm glad to announce that the π rust-edition-guide-l10n π project is published now:
- π Preview: rust-edition-guide-l10n
- π Crowdin: rust-edition-guide-l10n
- π GitHub: rust-edition-guide-l10n
The goal of this project is to translate The Rust Edition Guide 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, just follow the following steps:
- Create an account on Crowdin Enterprise if you don't have one.
- Log in and go the rust-edition-guide-l10n project.
- Choose the language you would like to contribute.
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.
How to Keep Translations Up-to-date
An FAQ that is sure to come up in the Rust community is: How to keep translations up-to-date?
First and foremost, in my opinion, the focus should be on how to keep the "Translatable Content (msgid)" up-to-date, rather than the "Translations (msgstr)". I will focus on the most critical part of the whole infrastructure here.
In short, the ci-mdbook-update-pot.yml workflow will be executed weekly to check the upstream project for any required updates to the document content, which in turn triggers the update of the .pot files. If an update is needed, a Pull Request (PR) is automatically created to merge into the l10n branch. For example:
- https://github.com/localizethedocs/rust-edition-guide-l10n/pull/2
- https://github.com/localizethedocs/rust-edition-guide-l10n/pull/5
- https://github.com/localizethedocs/rust-edition-guide-l10n/pull/7
Once those PRs are merged, the ci-gettext-update-po.yml workflow will be triggered to merge the updated content from the .pot files into the .po files for each language. This is essentially how @localizethedocs keeps the "Translatable Content" up-to-date.
Therefore, the core responsibility of the code maintainers, besides ensuring the stable operation of the scripts and workflows, is to regularly check whether there are any pending PRs that need to be merged.
How to Reuse Translations
If the upstream project or anyone wants to reuse the translated .po files prepared by the rust-edition-guide-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-edition-guide-l10n.git locale
Those po/${VERSION} branches are created to facilitate reusage by the upstream project. For instance, the zh_TW documentation for the nightly version can be generated using the commands below:
BRANCH=main
VERSION=nightly
LANGUAGE=zh_TW
RENDERER=html
# Prepare the repository and environment
git clone --branch=${BRANCH} --depth=1 --recurse-submodules --shallow-submodules https://github.com/rust-lang/rust.git rust-edition-guide
cd rust-edition-guide
conda create --prefix ./.conda --yes
conda activate ./.conda
conda install conda-forge::rust=1 conda-forge::dasel=2 conda-forge::jq --channel conda-forge --yes
export CARGO_INSTALL_ROOT=$(pwd)/.conda
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-edition-guide-l10n.git src/doc/edition-guide/locale
# Build and Preview the documentation
export MDBOOK_BOOK__LANGUAGE=${LANGUAGE}
export MDBOOK_OUTPUT="{\"$RENDERER\":$(dasel -f src/doc/edition-guide/book.toml "output.$RENDERER" -w json)}"
export MDBOOK_PREPROCESSOR__GETTEXT=$(jq -n -c '{"after":["links"],"po-dir":"locale"}')
mdbook build src/doc/edition-guide --dest-dir $(pwd)/output/${LANGUAGE}
firefox $(pwd)/output/${LANGUAGE}/index.html
Related Dicussions
There were issues proposing translations for The Rust Edition Guide:
- https://github.com/rust-lang/edition-guide/issues/87
- https://github.com/rust-lang/edition-guide/issues/356
And, I believe the rust-edition-guide-l10n project should be able to serve this purpose.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up β it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
This issue is an announcement rather than a concrete change request. Read .github/workflows/ci-mdbook-update-pot.yml and .github/workflows/ci-gettext-update-po.yml first, then review the linked rust-edition-guide-l10n project; no specific files to change or completion condition is defined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, rust
- Domain
- documentation, localization
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100