wiki:the_docs_strikes_back

Version 1 (modified by bakaniko, 6 years ago) ( diff )

--

TOC

Part 2 of building the docs, this will be about .po files generation and the Transifex workflow.

Logs

Inspiration : https://github.com/cvvergara/OSGeoLive-doc/tree/aurebesh/locale

Installing Transifex client

{{{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).

Updating the files

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 }}}

Pushing to Transifex

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.

Auto Update

Transifex can be configured to check files twice a day and update them. Please see this link for more information about it:

https://docs.transifex.com/projects/updating-content/#automatically-updating-source-files

Rebuild the .pot 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

Prioritizing the translations

locking older versions

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".

Translation priority

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".

Fixing errors

Mismatch error

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.

Note: See TracWiki for help on using the wiki.