-
-
Notifications
You must be signed in to change notification settings - Fork 10
Translation
This page is to explain how to handle SysD Manager translations.
SysD Manager uses gettext for its i18n and l10n. It has a the message-as-key approach which has its pros and cons.
A tool have been created to help with translation. The following shows the most important ones to help translators
All options are explained in the helpj
cargo run -p transtools -- -h
To extract translation keys form source code and generate a Portable Object Template (POT) file. This command can be executed after any code changes. The command also generates the POTFILES file that contains the list of input files to look for to extract translatable strings.
cargo run -p transtools -- extract
The POT file serves as templates for creating new PO files.
After changes in the source code it's needed to update a po languages file. The following command helps you to perform that.
To update all language keys, context and comments, use this command:
cargo run -p transtools -- po --lang all
Same as above, but for on language only. Also useful for adding a new translated language.
cargo run -p transtools -- po --lang <LANG>
- To add a new translated language, first add the new language code, respecting
llorll_LLformat, in the./po/LINGUASfiles. - To test any translated languages, just set the environment variable like this:
export LANGUAGE=<language code>