I18n/Tools
I18N uses many different tools, across several OpenStack Projects to meet its goals.
Contents
OpenStack documents are in DocBook format. In order to make the document translation management consistent with message translation, we need to convert DocBook into PO format.
The document translation management include following steps:
- Slicing: slice DocBook into string segment with a Python script, and generate a PO template
- Uploading: Upload the translation resources to Transifex by automation scripts
- Translating: manage the translation in Transifex, including the translation memory and glossary management
- Merging: merge the translated string into Docbook with a python script
- Uploading: Download the translated results by automation scripts.
Slicing script
The [slicing script] has dependency to package "xml2po". So you have to install gnome-doc-utils before running it.
sudo apt-get install gnome-doc-utils
The script can scan a specific folder under openstack-manuals/doc/src/docbkx, collect all the text segment in *.xml and combine them into a PO template, with command:
./tools/generatepot [foldername]
The PO template will be put in a "locale" folder under the specific docbook folder, i.e. openstack-manuals/doc/src/docbkx/[bookname]/locale.
Merging script
The [merging script] has dependency to package "xml2po". So you have to install gnome-doc-utils before running it.
sudo apt-get install gnome-doc-utils
The script can merge the translation strings into DocBook and generate a DocBook in the specific language.
./tools/generatedocbook -l [language] -b [book_name]
Uploading script
The uploading script is an automation job running in Jenkins, which will be triggered by "commit" event of openstack-manuals repository. See [here].
Downloading script
The downloading script is an automation job running daily in Jenkins. See [here].