-
Notifications
You must be signed in to change notification settings - Fork 0
The docs strikes back
Part 2 of building the docs, this will be about .po files generation and the Transifex workflow.
- http://irclogs.geoapt.com/osgeolive/%23osgeolive.2017-09-19.log
- http://irclogs.geoapt.com/osgeolive/%23osgeolive.2017-09-26.log
- http://irclogs.geoapt.com/osgeolive/%23osgeolive.2017-09-27.log
Inspiration : https://github.com/cvvergara/OSGeoLive-doc/tree/aurebesh/locale
sudo pip install transifex-client
# check it is working
tx --version # 0.12.4 when writing this documentation
If you followed the previous part Building the docs, the pot files are already made.
# pot files of the source language (english)
ls -R locale/pot
# po file for the locales (e.g. Spanish)
ls -R locale/es
The pot files are pushes to the repository (see this file for change it).
When we build the locale
with CMakeLists.txt, the gettext command is called, so all the po files are updated at the same time.
see the locale command
sphinx-intl update-txconfig-resources --pot-dir locales/pot --transifex-project-name osgeolive
The configuration for Transifex (.tx/config
) should have been done automatically.
So we only need to push the updates to the Transifex platform
tx push -s
It can be interesting to assign a category to freshly pushed resources, so you can sort them easily.
Transifex can be configured to check files twice a day and update them.
You need to point for ressource to the corresponding .po file in locale/en/LC_MESSAGES
. When a a file is chnaged, please run sphinx-intl update -d {SOURCE_DIR}/locale -l en
before pushing to Github.
{SOURCE_DIR} stands for your OSGeoLive-docs folder into your computer.
Please see this link for more information about it:
https://docs.transifex.com/projects/updating-content/#automatically-updating-source-files
Make sure build directory is empty
rm -rf build/*
Build the pot/po files
cd build
cmake -DLOCALE=ON ..
make locale > locale_log.txt
cd ..
List .pot files
ls -R locale/pot
List a language's .po files for example spanish:
ls -R locale/es
Then to update Transifex:
tx push -s
Some files, like standards are kept but not upgraded. So there is no need to translate them. It is possible to lock them, in the Resource Settings and untick the option "Your translators can translate resource strings".
This cna be set with the up ">" at the right of the resource. There is 3 possilities
- Urgent : 2 red ">"
- High : 1 yellow ">"
- normal : 1 green "-"
Put retired or non translated docs to normal. Osgeo-live related docs are set to "Urgent".
If you get a Mismatch: both interpreted text role prefix and reference suffix.
error it might means that a string as prefix that is not recognized.
For example this english string:
Geospatial algorithms, including those from :doc:`JTS `, can be called through GeoServer's `WPS <http://www.opengeospatial.org/standards/wps>`__ interface. This includes the chaining of processes, and using rendering transformations to create powerful visualisations through the WMS interface.
is translated in French to:
Des algorithmes géospatiaux, incluant ceux venant de :doc:`JTS `, peuvent être appelés via l'interface :doc:`WPS <http://www.opengeospatial.org/standards/wps>`__ de GeoServer. Cela inclue le chaînage de traitements, et l'utilisation de transformations de rendu pour créer des visualisations puissantes via l'interface WMS.
Do you see the surplus :doc:
?
Yes right before WPS ! :doc:
are use to link to document in the documentation, but it is a link to the WPS webpage. So sphinx doesn't find the WPS <http://www.opengeospatial.org/standards/wps>
file and gives an error.