Translating the documentation

The NEM Developer Center uses Sphinx, a Python framework to write documentation. The extension sphinx-intl permits translating documentation into multiple languages without having to host different documentation sites.

Adding/updating translations

  1. Clone the repository, and make sure you have Python 2.7 or 3.4+ and pip installed.
$> git clone
  1. Install the project’s requirements.
$> pip install -r requirements.txt
  1. Extract the docs messages into .po files.
$>  make gettext

For each documentation file, a .po file will be generated under _build/gettext.

  1. Copy translation files into source/locale with the following command. It is also used to update .po files when the documentation in English have changed:
$>  sphinx-intl update -p _build/gettext -l <lang>

Replace <lang> for your language code.

  1. Translate your .po files under source/locale/<lang>/LC_MESSAGES/. For each msgid, provide the translated msgstr.
  2. Generate the translated document and review the changes.
$> make -e SPHINXOPTS="-D language='<lang>'" livehtml

Submit your changes into the nem2-docs repository.