|
|
преди 1 месец | |
|---|---|---|
| .. | ||
| bin | преди 1 година | |
| locales | преди 10 месеца | |
| translation-templates | преди 3 месеца | |
| .gitignore | преди 1 година | |
| PUBLISHED_LANGUAGES | преди 1 година | |
| README.md | преди 9 месеца | |
| justfile | преди 1 година | |
| requirements.txt | преди 1 месец | |
Translated documentation files are published and maintained in translations/ directory.
Currently, we support translation of:
docs directory (this is where the bulk of the documentation is)i18n directory💡 For readers’ sake, we only publish translations in a new language when the translation progresses beyond a certain threshold (requiring that at least the project README and core installation guides are translated).
Organization of this i18n directory is as follows:
i18n directory. We intentionally ignore translated results (translations/<language> directories) for languages that are still in progress. We only publish translations in a new language when the translation progresses beyond a certain threshold.This project uses Sphinx to generate translated documents.
For details about using Sphinx for translation, refer this official document as well.
For now, translations are handled manually by editing .po files in the locales/<language> directory. In the future, we plan on integrating with Weblate to allow for translating from a web interface.
If you have the uv package manager and just command runner installed, you can use our justfile recipes to easily manage translation files and build translated documents.
The recipes will use uv to auto-create a Python virtual environment in the .venv directory and install the required Python packages (as per requirements.txt) to it.
Make sure you have the uv package manager and just command runner installed.
Recommended flow when working on a new language (replace <language> with the language code, e.g. bg):
Update the locale files for your language: just sync-for-language <language> (internally, this automatically runs just extract-translation-templates to make sure the translation templates are up-to-date)
Use an editor to translate the files in the locales/<language> directory
Build translated documents: just build-for-language <language>
Preview the result in the translations/<language> directory
Commit your changes done to the locales/<language> directory
If you have progressed with the translation beyond a certain threshold, consider Publishing translations in a new language
If you cannot use uv and/or just, you can:
.venv directory: virtualenv .venvsource .venv/bin/activatepip install -r requirements.txtRecommended flow when working on a new language (replace <language> with the language code, e.g. bg):
Ensure the English translation templates (translation-templates/) are extracted: ./bin/extract-translation-templates.sh
Update the locale files for your language: ./bin/sync-translation-templates-to-locales.sh <language>
Use an editor to translate the files in the locales/<language> directory
Build translated documents: ./bin/build-translated-result.sh <language>
Preview the result in the translations/<language> directory
Commit your changes done to the locales/<language> directory
If you have progressed with the translation beyond a certain threshold, consider Publishing translations in a new language
To publish prebuilt documents translated in a new language to the translations/<language> directory:
translations/<language> directory by adding a !translations/<language> rule to the .gitignore file💡 Leave a trailing new line at the end of the PUBLISHED_LANGUAGES file.