[679] | 1 | .. _contribute_trans: |
---|
| 2 | |
---|
| 3 | Contribute translation |
---|
| 4 | =============== |
---|
| 5 | |
---|
| 6 | Anybody can take part to the `ZOO-Project <http://zoo-project.org>`__ translation and is welcome to: |
---|
| 7 | |
---|
| 8 | * Translate ZOO-Services configuration files |
---|
| 9 | |
---|
| 10 | * Translate documentation |
---|
| 11 | |
---|
| 12 | |
---|
| 13 | ZCFG translation |
---|
| 14 | -------------------------- |
---|
| 15 | |
---|
| 16 | First of all, use the following commands from your Services Provider directory in order to extract all the messages to translate from the ZCFG files : |
---|
| 17 | |
---|
| 18 | :: |
---|
| 19 | |
---|
| 20 | #!/bin/bash |
---|
| 21 | for j in cgi-env/*zcfg ; |
---|
| 22 | do |
---|
| 23 | for i in Title Abstract; |
---|
| 24 | do |
---|
| 25 | grep $i $j | sed "s:$i = :_(\":g;s:$:\"):g" ; |
---|
| 26 | done; |
---|
| 27 | done > locale/.cache/my_service_string_to_translate.c |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | Then generate the 'messages.po' file based on the Services Provider source code using the following command : |
---|
| 31 | |
---|
| 32 | :: |
---|
| 33 | |
---|
| 34 | #!/bin/bash |
---|
| 35 | xgettext service.c locale/.cache/my_service_string_to_translate.c -o message.po -p locale/po/ -k_ |
---|
| 36 | |
---|
| 37 | Once 'messages.po' is created, use the following command to create the po file for the targeted language for translation. We will use the French language here as an example : |
---|
| 38 | |
---|
| 39 | :: |
---|
| 40 | |
---|
| 41 | #!/bin/bash |
---|
| 42 | cd locale/po/ |
---|
| 43 | msginit -i messages.po -o zoo_fr_FR.po -l fr |
---|
| 44 | |
---|
| 45 | Edit the zoo_fr_FR.po file with your favorite text editor or using one of the following tools : |
---|
| 46 | |
---|
| 47 | * [http://www.poedit.net/ poedit] |
---|
| 48 | * [http://translate.sourceforge.net/wiki/virtaal/index virtaal] |
---|
| 49 | * [https://www.transifex.net/projects/p/grass6/c/grass64/ transifex] |
---|
| 50 | |
---|
| 51 | Once the zoo_fr_FR.po file is completed, you can generate and install the corresponding *mo* file using the following command : |
---|
| 52 | |
---|
| 53 | :: |
---|
| 54 | |
---|
| 55 | #!/bin/bash |
---|
| 56 | msgfmt locale/po/zoo_fr_FR.po -o /usr/share/locale/fr/LC_MESSAGES/zoo-services.mo |
---|
| 57 | |
---|
| 58 | |
---|
| 59 | In order to test the Services Provider ZCFG and internal messages |
---|
| 60 | translation, please add the language argument to you request. As an |
---|
| 61 | example, such a request: |
---|
| 62 | |
---|
| 63 | [http://youserver/cgi-bin/zoo_loader.cgi?request=GetCapabilities&service=WPS] |
---|
| 64 | |
---|
| 65 | would become the following: |
---|
| 66 | |
---|
| 67 | [http://youserver/cgi-bin/zoo_loader.cgi?request=GetCapabilities&service=WPS&language=fr-FR] |
---|
| 68 | |
---|
| 69 | The following command may also be useful in order to pull all the translations already available for a specific language. |
---|
| 70 | |
---|
| 71 | :: |
---|
| 72 | |
---|
| 73 | #!sh |
---|
| 74 | msgcat -o compilation.po $(find ../../ -name fr_FR.utf8.po) |
---|
| 75 | msgfmt compilation.po -o /usr/share/locale/fr/LC_MESSAGES/zoo-services.mo |
---|
| 76 | |
---|
| 77 | |
---|
| 78 | Documentation translation |
---|
| 79 | -------------------------- |
---|
| 80 | |
---|
| 81 | Translate the `ZOO-Project <http://zoo-project.org>`__ documentation in your language ! |
---|
| 82 | |
---|
| 83 | Please refer to the :ref:`<contribute_doc>` section to learn more. |
---|