| 1 | __TOC__ |
| 2 | |
| 3 | Part 2 of building the docs, this will be about .po files generation and the Transifex workflow. |
| 4 | |
| 5 | = Logs = |
| 6 | |
| 7 | * http://irclogs.geoapt.com/osgeolive/%23osgeolive.2017-09-19.log |
| 8 | * http://irclogs.geoapt.com/osgeolive/%23osgeolive.2017-09-26.log |
| 9 | * http://irclogs.geoapt.com/osgeolive/%23osgeolive.2017-09-27.log |
| 10 | |
| 11 | Inspiration : https://github.com/cvvergara/OSGeoLive-doc/tree/aurebesh/locale |
| 12 | |
| 13 | = Installing Transifex client = |
| 14 | |
| 15 | {{{sudo pip install transifex-client |
| 16 | |
| 17 | # check it is working |
| 18 | tx --version # 0.12.4 when writing this documentation |
| 19 | }}} |
| 20 | If you followed the previous part [https://github.com/cvvergara/OSGeoLive-doc/wiki/Building-the-docs Building the docs], the pot files are already made. |
| 21 | |
| 22 | {{{# pot files of the source language (english) |
| 23 | ls -R locale/pot |
| 24 | |
| 25 | # po file for the locales (e.g. Spanish) |
| 26 | ls -R locale/es}}} |
| 27 | The pot files are pushes to the repository (see this file for change it). |
| 28 | |
| 29 | = Updating the files = |
| 30 | |
| 31 | When we build the {{{locale}}} with CMakeLists.txt, the gettext command is called, so all the po files are updated at the same time. |
| 32 | |
| 33 | see the [https://github.com/cvvergara/OSGeoLive-doc/blob/cm_fix_header/doc/CMakeLists.txt#L101 locale command] |
| 34 | |
| 35 | {{{sphinx-intl update-txconfig-resources --pot-dir locales/pot --transifex-project-name osgeolive |
| 36 | }}} |
| 37 | = Pushing to Transifex = |
| 38 | |
| 39 | The configuration for Transifex ({{{.tx/config}}}) should have been done automatically. So we only need to push the updates to the Transifex platform |
| 40 | |
| 41 | {{{ tx push -s}}} |
| 42 | It can be interesting to assign a category to freshly pushed resources, so you can sort them easily. |
| 43 | |
| 44 | == Auto Update == |
| 45 | |
| 46 | Transifex can be configured to check files twice a day and update them. Please see this link for more information about it: |
| 47 | |
| 48 | https://docs.transifex.com/projects/updating-content/#automatically-updating-source-files |
| 49 | |
| 50 | = Rebuild the .pot files = |
| 51 | |
| 52 | Make sure build directory is empty |
| 53 | |
| 54 | {{{rm -rf build/*}}} |
| 55 | Build the pot/po files |
| 56 | |
| 57 | {{{cd build |
| 58 | cmake -DLOCALE=ON .. |
| 59 | make locale > locale_log.txt |
| 60 | cd ..}}} |
| 61 | List .pot files |
| 62 | |
| 63 | {{{ls -R locale/pot}}} |
| 64 | List a language's .po files for example spanish: |
| 65 | |
| 66 | {{{ls -R locale/es}}} |
| 67 | Then to update Transifex: |
| 68 | |
| 69 | {{{ tx push -s}}} |
| 70 | = Prioritizing the translations = |
| 71 | |
| 72 | == locking older versions == |
| 73 | |
| 74 | 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". |
| 75 | |
| 76 | == Translation priority == |
| 77 | |
| 78 | This cna be set with the up ">" at the right of the resource. There is 3 possilities |
| 79 | |
| 80 | * Urgent : 2 red ">" |
| 81 | * High : 1 yellow ">" |
| 82 | * normal : 1 green "-" |
| 83 | |
| 84 | Put retired or non translated docs to normal. Osgeo-live related docs are set to "Urgent". |
| 85 | |
| 86 | = Fixing errors = |
| 87 | |
| 88 | == Mismatch error == |
| 89 | |
| 90 | 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. |
| 91 | |
| 92 | For example this english string: |
| 93 | |
| 94 | {{{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.}}} |
| 95 | is translated in French to: |
| 96 | |
| 97 | {{{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.}}} |
| 98 | Do you see the surplus {{{:doc:}}} ? |
| 99 | |
| 100 | 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. |