.. _title_Translation_Process:
.. image:: https://github.com/AguaClara/aide_design_specs/workflows/Build%20Master/badge.svg :height: 30 :target: https://github.com/AguaClara/aide_design_specs/actions :alt: Build Status
The Translation Process
.. _heading_Sphinx_Internationlization:
To translate the AIDE Design Specifications Sphinx project, the Sphinx Internationalization Feature known as Internationalization can be used.
See https://aguaclara.github.io/Textbook/Textbook_Creation_Help/rst_intro.html for an introduction to RST and Sphinx
sphinx-intl is a useful tool that allows the translation process to run smoothly.
After installing sphinx-intl, configurations must be set up in conf.py such as specifications for the path and a language parameter. Once the configurations are set up, translatable messages are extracted in pot files by using the command "make gettext". The pot files will then be found in the "_build/gettext" directory. Next, po files will be generated from the pot files using "sphinx-intl update -p _build/gettext -l
./locale/
./locale/
The .po files in ./locale/
For detailed instructions on how to get set up and use sphinx-intl, see https://www.sphinx-doc.org/en/master/usage/advanced/intl.html#id7
.. _heading_what_are_pot_and_po_files:
POT files contain text extracted from the RST files and serve as a template for translations. The "msgid" messages are automatically filled in, but the "msgstr" messages contain empty strings.
PO files are copies of their corresponding POT files except that they contain the translations in the "msgstr" messages. Each language has its own PO files, so if another language is to be added, a new copy of POT files are made as PO files in which its "msgstr" messages can be filled in with a translator.
.. _heading_Poedit:
Poedit is an efficient tool to help automate the translation of po files. Once Poedit is opened, the user can follow these instructions:
.. figure:: _images/choose_file.png
:width: 400px
:align: center
.. figure:: _images/poedit_lang_warning.JPG
:width: 550px
:align: center
select "Set language". A new window will open:
.. figure:: _images/catalog_properties.JPG
:width: 300px
:align: center
In the Language field, select the desired target language and click "OK".
.. figure:: _images/change_source_lang_ex.JPG
:width: 500px
:align: center