~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to locale/README

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
HOWTO translate GRASS messages
2
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3
3
 
4
 
$Date: 2012-02-25 14:14:51 +0100 (Sat, 25 Feb 2012) $
 
4
This file contains following sections:
 
5
1. Instructions for programmers;
 
6
2. A translation workflow overview;
 
7
3. A detailed explanation of translation workflow, testing;
 
8
4. Some notes and links
5
9
 
6
10
[ Web page: http://grass.osgeo.org/devel/i18n.php ]
7
11
 
48
52
NOTE2: Also the parameters/flags of each module needs the
49
53
       macro _().
50
54
 
 
55
NOTE3: Notices to translators can be added by placing
 
56
       a comment line starting with GTC tag just above
 
57
       message to be translated:
 
58
        /* GTC A comma separated keyword list. 
 
59
           Should not contain spaces! */
 
60
        keywords = _("first,second,third");
 
61
 
 
62
NOTE4:  Any string containing a number that requires a correct plural form of
 
63
        a noun, has to pass trough ngettext function implemented in GRASS
 
64
        as a _n() macro.
 
65
        _n("Message in English for singular case", "Message in English for
 
66
        plural case", number) 
 
67
 
 
68
Examples of messages with plural forms.
 
69
Wrong:
 
70
    G_message( _("%d map(s) from mapset <%s> removed"), n, ms);
 
71
    G_message( n == 1 ? _("One file removed") : _("%d files removed"), n);
 
72
    G_warning( _("%d %s without geometry skipped"), n, 
 
73
        n == 1 ? "feature" : "features"); 
 
74
    G_message( _("%d maps selected"), n);
 
75
    G_message( n == 1 ? _("Remove map") : _("Remove maps"));
 
76
 
 
77
Correct:
 
78
    G_message( _n("%d map from mapset <%s> removed", 
 
79
        "%d maps from mapset <%s> removed", n), n, ms);
 
80
    /* Notice double use of number "n" - as an argument for 
 
81
    both functions - _n() and G_message() */
 
82
    G_message( _n("One file removed", "%d files removed", n) n);
 
83
    /* Both of forms of singular case "%d file" or "One file" are correct. 
 
84
    The choice between them is purely stylistic one. */
 
85
    G_warning( _n("One feature without geometry skipped", 
 
86
        "%d features without geometry skipped", n), n);
 
87
    G_message( _n("%d map selected", "%d maps selected", n), n);
 
88
    /* Altough in English it is not necessary to provide a separate
 
89
    text if "n" always is >1, in other languages is a difference if "n"
 
90
    is i.e. 2-4, or n==10 etc. */
 
91
    G_message( _n("Remove map", "Remove maps", n));
 
92
    /* Number it self doesn't have to be used in the output text */
 
93
        
 
94
        
51
95
All these messages strings will be then automatically 
52
96
extracted into the message files.
53
97
 
54
98
See for example ./vector/v.what.rast/main.c
55
99
 
56
 
NOTE3: Such lines
 
100
NOTE4: Such lines
57
101
        fprintf (stdout,"\n");
58
102
  do not need a change as no translation is needed.
59
103
 
 
104
A detailed example of adapting code for use in multiple languages
 
105
can be found in gettext manual.
 
106
How to prepare program source: 
 
107
http://www.gnu.org/software/gettext/manual/gettext.html#Sources
 
108
 
 
109
More advanced tricks like resolving ambiguties and handling of plural forms:
 
110
http://www.gnu.org/software/gettext/manual/gettext.html#Programmers
60
111
 
61
112
------------------------------------------------------
62
113
 
134
185
   This will create
135
186
    ./templates/grasslibs.pot
136
187
    ./templates/grassmods.pot
137
 
    ./templates/grasstcl.pot
138
188
    ./templates/grasswxpy.pot
139
189
 
140
190
 
156
206
       to the ./po/ directory (for example German language):
157
207
        mv ./template/grasslibs.pot ./po/grasslibs_de.po
158
208
        mv ./template/grassmods.pot ./po/grassmods_de.po
159
 
        mv ./template/grasstcl.pot ./po/grasstcl_de.po
160
209
        mv ./template/grasswxpy.pot ./po/grasswxpy_de.po
161
210
 
162
211
       Get the two characters indicating the language from this
191
240
   Run 'kbabel' or equivalent program
192
241
    kbabel ./po/grasslibs_<LANGUAGE>.po
193
242
    kbabel ./po/grassmods_<LANGUAGE>.po
194
 
    kbabel ./po/grasstcl_<LANGUAGE>.po
195
243
    kbabel ./po/grasswxpy_<LANGUAGE>.po
196
244
 
197
245
   For example (German):
198
246
    kbabel ./po/grasslibs_de.po
199
247
    kbabel ./po/grassmods_de.po
200
 
    kbabel ./po/grasstcl_de.po
201
248
    kbabel ./po/grasswxpy_de.po
202
249
 
203
250
   KBABEL: You may load .po files from other projects [see footnote 1].
231
278
   If possible, please send diffs against CVS:
232
279
   svn diff grasslibs_LANG.po > grasslibs_LANG_po.diff
233
280
   svn diff grassmods_LANG.po > grassmods_LANG_po.diff
234
 
   svn diff grasstcl_LANG.po > grasstcl_LANG_po.diff
235
281
   svn diff grasswxpy_LANG.po > grasswxpy_LANG_po.diff
236
282
 
237
283
   If you updated .c files with _() macros as explained