edX i18n tools are set of commands useful for developers and translators to extract, compile and validate translations. edX i18n tools can be downloaded here and installed running following command inside the extracted directory
Code Block | ||||
---|---|---|---|---|
| ||||
python setup.py install |
OR if you have edX platform installed then i18n tools should be already installed in edxapp virtual environment.
Running commands from the edx-platform directory will default to loading the configuration at ./conf/locale/config.yaml. You can specify a different configuration file with the --config
argument.
General Commands
To extract source strings and populate .po translation files with them
Code Block language py theme Confluence i18n_tool extract
To generate test language(eo) translation files from source .po files
Code Block language py themeConfluence i18n_tool dummy
To compile .po translation files into .mo message files
Code Block theme Confluence i18n_tool generate
To find translation errors in .po files
Code Block theme Confluencei18n_tool validate
To determine if the source translation files(.po) are up-to-date
Code Block theme Confluence i18n_tool changed
Transifex Commands
Developers or Translators can use commands provided by edX i18n tools to upload translations to transifex or download them. Before using these commands one should have an account on transifex.com to create ~/.transifexrc file. Once transifex account has been setup create a ~/.transifexrc file having these contents.
Code Block | theme | Confluence
---|
[https://www.transifex.com] hostname = https://www.transifex.com password = YOURPASSWORD token = username = YOURUSERNAME(EMAIL) |
...
To upload translations to transifex
Code Block language py theme Confluence i18n_tool transifex push
To download translations from transifex
Code Block language py theme Confluence i18n_tool transifex pull
Coverage Testing
...