Contribute to Internationalization of the Program¶
Note
For program internationalization, English (en) and Chinese (zh_CN) are well maintained. If you need to provide translations for the program in other languages, consider reading this section further.
Otherwise, you can skip this part on program internationalization.
Generating Translation Files¶
Please ensure you have GNU gettext installed.
Note
The translation process can be found at https://www.sphinx-doc.org/en/master/usage/advanced/intl.html
Extract Translatable Text
In the root directory of your project, execute:
python janim/locale/gettext.py
This command will run xgettext on all .py files in the project. If there are translatable texts, they will be extracted into the janim/locale/source folder, generating (or updating) .pot files.
Generate .po Files
POT files are the extracted source language texts available for translation. You need to use these files to generate corresponding language PO files.
For example:
python janim/locale/intl.py ja
After execution, the generated PO files will be output to the following folder:
janim/locale/ja/LC_MESSAGES/
Here, ja corresponds to the parameter provided in the above command, representing Japanese.
Translating the Program¶
Assume you want to translate to Japanese.
Now, the translation files (with the .po suffix) are already stored in janim/locale/ja/LC_MESSAGES/.
It is recommended to use Poedit software to open the PO files in the directory and proceed with the translation.
After translating, submit your changes and create a Pull Request to merge into the main branch.