Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
languagepy
themeConfluence
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

  1. To extract source strings and populate .po translation files with them

    Code Block
    languagepy
    themeConfluence
    i18n_tool extract
  2. To generate test language(eo) translation files from source .po files

    Code Block
    theme
    languagepyConfluence
    i18n_tool dummy
  3. To compile .po translation files into .mo message files

    Code Block
    themeConfluence
    i18n_tool generate
  4. To find translation errors in .po files

    Confluence
    Code Block
    theme
    i18n_tool validate
  5. To determine if the source translation files(.po) are up-to-date

    Code Block
    themeConfluence
    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.

Confluence
Code Block
theme
[https://www.transifex.com]
hostname = https://www.transifex.com
password = YOURPASSWORD
token = 
username = YOURUSERNAME(EMAIL)

...

  1. To upload translations to transifex

    Code Block
    languagepy
    themeConfluence
    i18n_tool transifex push
  2. To download translations from transifex

    Code Block
    languagepythemeConfluence
    i18n_tool transifex pull

Coverage Testing

...