source: trunk/docs/services/translation.rst @ 981

Last change on this file since 981 was 725, checked in by djay, 9 years ago

Fix issue with rst files displayed from Trac. Fix strings to be translated. Always use the same string in all messages.

  • Property svn:keywords set to Date Author
  • Property svn:mime-type set to text/plain
File size: 2.5 KB
Line 
1.. _service_translation:
2
3Translation Support
4===================
5
6ZOO-Kernel support translating internal messages it emits but it can
7also translate both the metadata informations stored in the ZCFG file
8and the messages emitted by the ZOO-Service itself. This document show
9how to create the files required to handle such a translation process
10for the ZOO-Services.
11
12
13ZCFG translation
14--------------------------
15
16First of all, use the following commands from your Services Provider
17directory in order to extract all the messages to translate from the
18ZCFG files :
19
20  ::
21 
22      #!/bin/bash
23      mkdir -p locale/{po,.cache}
24      for j in cgi-env/*zcfg ;
25        do
26          for i in Title Abstract;
27           do
28            grep $i $j | sed "s:$i = :_ss(\":g;s:$:\"):g" ;
29           done;
30       done > locale/.cache/my_service_string_to_translate.c
31   
32
33Then generate the ``messages.po`` file based on the Services Provider
34source code (located in ``service.c`` in this example) using the
35following command:
36
37  ::
38 
39      #!/bin/bash
40      xgettext service.c locale/.cache/my_service_string_to_translate.c -o message.po -p locale/po/ -k_ss
41
42Once ``messages.po`` is created, use the following command to create
43the ``.po`` file for the targeted language to translate into. We will
44use the French language here as an example:
45
46  ::
47 
48      #!/bin/bash
49      cd locale/po/
50      msginit -i messages.po -o zoo_fr_FR.po -l fr
51
52Edit the ``zoo_fr_FR.po`` file with your favorite text editor or using
53one of the following tools:
54
55 * `poedit <http://www.poedit.net/>`__
56 * `virtaal <http://translate.sourceforge.net/wiki/virtaal/index>`__
57 * `transifex <https://www.transifex.net/>`__
58 
59Once the ``zoo_fr_FR.po`` file is completed, you can generate and
60install the corresponding ``.mo`` file using the following command:
61
62  ::
63 
64      #!/bin/bash
65      msgfmt locale/po/zoo_fr_FR.po -o /usr/share/locale/fr/LC_MESSAGES/zoo-services.mo
66
67
68In order to test the Services Provider ZCFG and internal messages
69translation, please add the language argument to you request. As an
70example, such a request:
71
72http://youserver/cgi-bin/zoo_loader.cgi?request=GetCapabilities&service=WPS
73
74would become the following:
75
76http://youserver/cgi-bin/zoo_loader.cgi?request=GetCapabilities&service=WPS&language=fr-FR
77
78The following command may also be useful in order to pull all the translations already available for a specific language.
79
80  ::
81 
82      #!sh
83      msgcat -o compilation.po $(find ../../ -name fr_FR.utf8.po)
84      msgfmt compilation.po -o /usr/share/locale/fr/LC_MESSAGES/zoo-services.mo
Note: See TracBrowser for help on using the repository browser.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png