Skip to content

Localization of The Lemmy Documentation #423

@hwhsu1231

Description

@hwhsu1231

Announcement

Hello, Lemmy Community,

I am the author of the @localizethedocs organization. And I’m glad to announce that the 🎉 lemmy-docs-l10n 🎉 project is published now:

The goal of this project is to translate The Lemmy 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, just follow the following steps:

  1. Create an account on Crowdin Enterprise if you don't have one.
  2. Log in and go the lemmy-docs-l10n project.
  3. 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 Reuse Translations?

If the upstream project or anyone wants to reuse the translated .po files prepared by the lemmy-docs-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/lemmy-docs-l10n.git locale

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

BRANCH=main
VERSION=main
LANGUAGE=zh_TW
RENDERER=html

# Prepare the repository and environment
git clone --branch=${BRANCH} --depth=1  --recurse-submodules --shallow-submodules https://github.com/LemmyNet/lemmy-docs.git lemmy-docs
cd lemmy-docs
conda create --prefix ./.conda --yes
conda activate ./.conda
conda install rust=1 dasel=2 jq -c conda-forge -c nodefaults --yes
export CARGO_INSTALL_ROOT=$(pwd)/.conda
cargo install mdbook@^0.4 mdbook-i18n-helpers@^0.3

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

# Build and Preview the documentation
export MDBOOK_BOOK__LANGUAGE=${LANGUAGE}
export MDBOOK_OUTPUT="{\"$RENDERER\":$(dasel -f book.toml "output.$RENDERER" -w json)}"
export MDBOOK_PREPROCESSOR__GETTEXT=$(jq -n -c '{"after":["links"],"po-dir":"locale"}')
mdbook build . --dest-dir $(pwd)/output/${LANGUAGE}
firefox $(pwd)/output/${LANGUAGE}/index.html

Related Dicussions

There is an issue discussing about translating the Lemmy documentation:

And I believe the lemmy-docs-l10n project should be able to surve this purpose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions