Rev 229 Rev 234
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3   3  
4 <html xmlns="http://www.w3.org/1999/xhtml"> 4 <html xmlns="http://www.w3.org/1999/xhtml">
5 <head> 5 <head>
6 <title>singapore - Translation</title> 6 <title>singapore - Translation</title>
7 <link rel="stylesheet" type="text/css" href="docstyle.css" /> 7 <link rel="stylesheet" type="text/css" href="docstyle.css" />
8 </head> 8 </head>
9   9  
10 <body> 10 <body>
11   11  
12 <h1>singapore - Translation</h1> 12 <h1>singapore - Translation</h1>
13   13  
14 <ul> 14 <ul>
15 <li><a href="#intro">Introduction</a></li> 15 <li><a href="#intro">Introduction</a></li>
16 <li><a href="#requirements">Requirements</a></li> 16 <li><a href="#requirements">Requirements</a></li>
17 <li><a href="#update">Updating a translation</a></li> 17 <li><a href="#update">Updating a translation</a></li>
18 <li><a href="#new">Starting a new translation</a></li> 18 <li><a href="#new">Starting a new translation</a></li>
19 <li><a href="#header">Filling in the header section</a></li> 19 <li><a href="#header">Filling in the header section</a></li>
20 <li><a href="#plurals">Plural forms</a></li> 20 <li><a href="#plurals">Plural forms</a></li>
21 <li><a href="#links">Useful links</a></li> 21 <li><a href="#links">Useful links</a></li>
22 <li><a href="Readme.html">General readme</a></li> 22 <li><a href="Readme.html">General readme</a></li>
23 <li><a href="Advanced.html">Advanced features</a></li> 23 <li><a href="Advanced.html">Advanced features</a></li>
24 <li><a href="Development.html">Developer documentation</a></li> 24 <li><a href="Development.html">Developer documentation</a></li>
25 </ul> 25 </ul>
26   26  
27   27  
28 <h2><a name="intro">Introduction</a></h2> 28 <h2><a name="intro">Introduction</a></h2>
29   29  
30 <p>Thank you for taking an interest in open source development! 30 <p>Thank you for taking an interest in open source development!
31 Translating singapore is a matter of editing a single file and 31 Translating singapore is a matter of editing a single file and
32 then running a script on it. What could be simpler?</p> 32 then running a script on it. What could be simpler?</p>
33   33  
34 <p>Language strings are stored in standard GNU Gettext PO (portable object) 34 <p>Language strings are stored in standard GNU Gettext PO (portable object)
35 files which means you can (at least in theory <a href="#foot1" name="note1"><sup>1</sup></a>) 35 files which means you can (at least in theory <a href="#foot1" name="note1"><sup>1</sup></a>)
36 use all currently available PO editors such as 36 use all currently available PO editors such as
37 <a href="http://poedit.sourceforge.net/">poEdit</a> to make your 37 <a href="http://poedit.sourceforge.net/">poEdit</a> to make your
38 translations.</p> 38 translations.</p>
39   39  
40 <p>For added convenience strings for each language are split into two sections: 40 <p>For added convenience strings for each language are split into two sections:
41 one for normal gallery operation and another for strings that are only used in 41 one for normal gallery operation and another for strings that are only used in
42 admin mode. This means that admin strings are not needlessly loaded for every 42 admin mode. This means that admin strings are not needlessly loaded for every
43 page and also that translators have the choice of only translating the standard 43 page and also that translators have the choice of only translating the standard
44 strings or going the whole way and translating the admin strings too.</p> 44 strings or going the whole way and translating the admin strings too.</p>
45   45  
46 <p>It is a good idea for all translators and potential translators to join the 46 <p>It is a good idea for all translators and potential translators to join the
47 <a href="http://lists.sourceforge.net/lists/listinfo/singapore-devel">development 47 <a href="http://lists.sourceforge.net/lists/listinfo/singapore-devel">development
48 mailing list</a>. Use this, the 48 mailing list</a>. Use this, the
49 <a href="http://singapore.sourceforge.net/forum/viewforum.php?f=6">internationalisation forum</a> 49 <a href="http://singapore.sourceforge.net/forum/viewforum.php?f=6">internationalisation forum</a>
50 and the 50 and the
51 <a href="http://sourceforge.net/tracker/?atid=611769&group_id=77687">translations tracker</a> 51 <a href="http://sourceforge.net/tracker/?atid=611769&group_id=77687">translations tracker</a>
52 to interact with other translators and developers.</p> 52 to interact with other translators and developers.</p>
53   53  
54 <p class="boxed"><a href="#note1" name="foot1">1</a>The reason for the "in theory" 54 <p class="boxed"><a href="#note1" name="foot1">1</a>The reason for the "in theory"
55 is that many PO editors do not support the plural forms that singapore makes use 55 is that many PO editors do not support the plural forms that singapore makes use
56 of - even though they are defined and supported by GNU Gettext. poEdit does 56 of - even though they are defined and supported by GNU Gettext. poEdit does
57 support plural forms since v1.3 and is highly recommended. Alternatively it is 57 support plural forms since v1.3 and is highly recommended. Alternatively it is
58 just as easy to use a standard text editor to make your translations.</p> 58 just as easy to use a standard text editor to make your translations.</p>
59   59  
60 <h2><a name="requirements">Requirements</a></h2> 60 <h2><a name="requirements">Requirements</a></h2>
61   61  
62 <p>No further software is required for using the multilanguage capabilities of 62 <p>No further software is required for using the multilanguage capabilities of
63 singapore. However the extract and merge tools use xgettext and msgmerge 63 singapore. However the extract and merge tools use xgettext and msgmerge
64 respectively. Both these programs are part of GNU Gettext which is already 64 respectively. Both these programs are part of GNU Gettext which is already
65 installed on most Linux distributions. A package of the relevant gettext 65 installed on most Linux distributions. A package of the relevant gettext
66 binaries for Windows is available here: 66 binaries for Windows is available here:
67 <a href="http://singapore.sourceforge.net/binaries/singapore-gettext-Win32.zip">http://singapore.sourceforge.net/binaries/singapore-gettext-Win32.zip</a>. 67 <a href="http://singapore.sourceforge.net/binaries/singapore-gettext-Win32.zip">http://singapore.sourceforge.net/binaries/singapore-gettext-Win32.zip</a>.
68 The path to xgettext is stored in <code>tools/extract.php</code> and the path to 68 The path to xgettext is stored in <code>tools/extract.php</code> and the path to
69 msgmerge is stored in <code>tools/merge.php</code>. However if the gettext programs 69 msgmerge is stored in <code>tools/merge.php</code>. However if the gettext programs
70 are in your PATH or in the <code>tools/</code> directory itself then you do not 70 are in your PATH or in the <code>tools/</code> directory itself then you do not
71 need to edit anything.</p> 71 need to edit anything.</p>
72   72  
73   73  
74 <h2><a name="update">Updating a translation</a></h2> 74 <h2><a name="update">Updating a translation</a></h2>
75   75  
76 <p>Each singapore release requires the language files to be updated slightly. 76 <p>Each singapore release requires the language files to be updated slightly.
77 First make sure you have the latest available translation (the 77 First make sure you have the latest available translation (the
78 <a href="http://sourceforge.net/tracker/?atid=611769&group_id=77687">translations tracker</a> 78 <a href="http://sourceforge.net/tracker/?atid=611769&group_id=77687">translations tracker</a>
79 is a good place to check for this). Now you need to merge in the new untranslated 79 is a good place to check for this). Now you need to merge in the new untranslated
80 strings and remove the obsolete ones (this may have already been done 80 strings and remove the obsolete ones (this may have already been done
81 but there's no harm in doing it again). Place the old PO file in the locale 81 but there's no harm in doing it again). Place the old PO file in the locale
82 directory of an installation of the latest version of singapore and use the 82 directory of an installation of the latest version of singapore and use the
83 <a href="../tools/merge.php">merge</a> script provided.</p> 83 <a href="../tools/merge.php">merge</a> script provided.</p>
84   84  
85 <p>Now proceed translating the strings as described below. Finally, attach the 85 <p>Now proceed translating the strings as described below. Finally, attach the
86 updated PO file to the appropriate tracker item making sure to state which 86 updated PO file to the appropriate tracker item making sure to state which
87 version of singapore it is for.</p> 87 version of singapore it is for.</p>
88   88  
89   89  
90 <h2><a name="new">Starting a new translation</a></h2> 90 <h2><a name="new">Starting a new translation</a></h2>
91   91  
92 <p>The very first thing to do is submit a tracker item on the 92 <p>The very first thing to do is submit a tracker item on the
93 <a href="http://sourceforge.net/tracker/?atid=611769&group_id=77687">translations tracker</a> 93 <a href="http://sourceforge.net/tracker/?atid=611769&group_id=77687">translations tracker</a>
94 to inform people of your intentions so that two or more people do not needlessly 94 to inform people of your intentions so that two or more people do not needlessly
95 spend time translating the same files for the same language. Once you have 95 spend time translating the same files for the same language. Once you have
96 completed your translations you can attach the files to the tracker item.</p> 96 completed your translations you can attach the files to the tracker item.</p>
97   97  
98 <p>All language files are kept in a single directory (<code>locale/</code> by 98 <p>All language files are kept in a single directory (<code>locale/</code> by
99 default). They are named as follows:</p> 99 default). They are named as follows:</p>
100   100  
101 <ul> 101 <ul>
102 <li><code>singapore.pot</code> - 102 <li><code>singapore.pot</code> -
103 untranslated standard language strings template in PO format</li> 103 untranslated standard language strings template in PO format</li>
104 <li><code>singapore.admin.pot</code> - 104 <li><code>singapore.admin.pot</code> -
105 untranslated admin language strings template in PO format</li> 105 untranslated admin language strings template in PO format</li>
106 <li><code>singapore.<em>LANG</em>.po</code> - 106 <li><code>singapore.<em>LANG</em>.po</code> -
107 translated standard language strings in PO format</li> 107 translated standard language strings in PO format</li>
108 <li><code>singapore.admin.<em>LANG</em>.po</code> - 108 <li><code>singapore.admin.<em>LANG</em>.po</code> -
109 translated admin language strings in PO format</li> 109 translated admin language strings in PO format</li>
110 <li><code>singapore.<em>LANG</em>.pmo</code> - 110 <li><code>singapore.<em>LANG</em>.pmo</code> -
111 translated standard strings as compiled PHP serialized object</li> 111 translated standard strings as compiled PHP serialized object</li>
112 <li><code>singapore.admin.<em>LANG</em>.pmo</code> - 112 <li><code>singapore.admin.<em>LANG</em>.pmo</code> -
113 translated admin strings as compiled PHP serialized object</li> 113 translated admin strings as compiled PHP serialized object</li>
114 </ul> 114 </ul>
115   115  
116 <p>where <code><em>LANG</em></code> represents the ISO639 language code of the chosen 116 <p>where <code><em>LANG</em></code> represents the ISO639 language code of the chosen
117 language (e.g. <code>de</code> for German, <code>en</code> for English, 117 language (e.g. <code>de</code> for German, <code>en</code> for English,
118 <code>en-gb</code> for English (United Kingdom)). A more comprehensive list of 118 <code>en-gb</code> for English (United Kingdom)). A more comprehensive list of
119 language codes may be found here: 119 language codes may be found here:
120 <a href="http://www.rickbull.co.uk/tutorials/HTML/Useful%20Information/language_codes.php">http://www.rickbull.co.uk/tutorials/HTML/Useful%20Information/language_codes.php</a></p> 120 <a href="http://www.rickbull.co.uk/tutorials/HTML/Useful%20Information/language_codes.php">http://www.rickbull.co.uk/tutorials/HTML/Useful%20Information/language_codes.php</a></p>
121   121  
122 <p>Start by copying a PO template file (<code>singapore.pot</code> if you 122 <p>Start by copying a PO template file (<code>singapore.pot</code> if you
123 are translating the standard strings or <code>singapore.admin.pot</code> if you 123 are translating the standard strings or <code>singapore.admin.pot</code> if you
124 are translating the admin strings) and naming it appropriately for your language 124 are translating the admin strings) and naming it appropriately for your language
125 as described above. Now open the file in your chosen PO editor or a plain text 125 as described above. Now open the file in your chosen PO editor or a plain text
126 editor and set about translating the strings.</p> 126 editor and set about translating the strings.</p>
127   127  
128 <p>You also need to fill in certain parts of the <a href="#header">PO file 128 <p>You also need to fill in certain parts of the <a href="#header">PO file
129 header</a>. You may do this at any stage of the translation.</p> 129 header</a>. You may do this at any stage of the translation.</p>
130   130  
131 <p>NOTES:</p> 131 <p>NOTES:</p>
132   132  
133 <ol> 133 <ol>
134 <li>Strings in the form "crumb line|You are here:"<br /> 134 <li>Strings in the form "crumb line|You are here:"<br />
135 In these cases the text up to and including the vertical bar, |, should NOT 135 In these cases the text up to and including the vertical bar, |, should NOT
136 be included in the translation. They are simply hints for the translator.</li> 136 be included in the translation. They are simply hints for the translator.</li>
137 137
138 <li>Strings in the form "Showing %s-%s of %s"<br /> 138 <li>Strings in the form "Showing %s-%s of %s"<br />
139 In these cases each %s will be replaced at runtime by a number or string in 139 In these cases each %s will be replaced at runtime by a number or string in
140 order from left to right according to the rules of <code>printf()</code>. 140 order from left to right according to the rules of <code>printf()</code>.
141 Essentially each %s is a placeholder and so needs to be present at the 141 Essentially each %s is a placeholder and so needs to be present at the
142 appropriate place in the translated string.<br /> 142 appropriate place in the translated string.<br />
143 However some languages may require the order of the arguments to be changed. 143 However some languages may require the order of the arguments to be changed.
144 For example if instead of "Showing 1-10 of 15" you want to say 144 For example if instead of "Showing 1-10 of 15" you want to say
145 "Out of 15 objects 1-10 are shown" then you must use the argument swapping 145 "Out of 15 objects 1-10 are shown" then you must use the argument swapping
146 syntax of <code>printf()</code>. More details on this may be found here: 146 syntax of <code>printf()</code>. More details on this may be found here:
147 <a href="http://www.php.net/sprintf">http://www.php.net/sprintf</a></li> 147 <a href="http://www.php.net/sprintf">http://www.php.net/sprintf</a></li>
148 148
149 <li>Strings with plurals<br /> 149 <li>Strings with plurals<br />
150 You must correctly specify the <a href="#plurals">Plural-forms</a> header field 150 You must correctly specify the <a href="#plurals">Plural-forms</a> header field
151 in order to make use of plural forms. Put each plural in its own 151 in order to make use of plural forms. Put each plural in its own
152 <code>msgstr[<em>x</em>]</code> where x is a number between 0 (inclusive) and 152 <code>msgstr[<em>x</em>]</code> where x is a number between 0 (inclusive) and
153 the nplurals number you specified in the header (see examples below).</li> 153 the nplurals number you specified in the header (see examples below).</li>
154   154  
155 <li>Using a text-editor<br /> 155 <li>Using a text-editor<br />
156 When translating an entry you must leave the English language strings 156 When translating an entry you must leave the English language strings
157 (those on lines starting <code>msgid</code>) untouched and insert the 157 (those on lines starting <code>msgid</code>) untouched and insert the
158 translated strings between the double-quotes on the following lines (those 158 translated strings between the double-quotes on the following lines (those
159 starting <code>msgstr</code> or <code>msgstr[<em>x</em>]</code> in the case of 159 starting <code>msgstr</code> or <code>msgstr[<em>x</em>]</code> in the case of
160 plurals).</li> 160 plurals).</li>
161 161
162 <li>Obsolete entries<br /> 162 <li>Obsolete entries<br />
163 When updating a PO file, obsolete entries (i.e. those strings which appeared 163 When updating a PO file, obsolete entries (i.e. those strings which appeared
164 in the previous version but do not in the current version) are placed at the 164 in the previous version but do not in the current version) are placed at the
165 end of the PO file and prepended by <code>#~</code>. There is no need to 165 end of the PO file and prepended by <code>#~</code>. There is no need to
166 translate these entries as they are ignored by the compiler.</li> 166 translate these entries as they are ignored by the compiler.</li>
167 </ol> 167 </ol>
168   168  
169 <p>Once you have translated all the strings and filled in the header, you need 169 <p>Once you have translated all the strings and filled in the header, you need
170 to compile the PO file into a PHP serialized object file for use with 170 to compile the PO file into a PHP serialized object file for use with
171 singapore. Do this using the <a href="../tools/compile.php">compile</a> script 171 singapore. Do this using the <a href="../tools/compile.php">compile</a> script
172 provided in the <code>tools/</code> directory of the singapore distribution.</p> 172 provided in the <code>tools/</code> directory of the singapore distribution.</p>
173   173  
174 <p>And that's it!</p> 174 <p>And that's it!</p>
175   175  
176 <p>Now go and attach your translated PO file(s) to the tracker item you created 176 <p>Now go and attach your translated PO file(s) to the tracker item you created
177 before starting the translation so that everyone else can make use of it.</p> 177 before starting the translation so that everyone else can make use of it.</p>
178   178  
179 <h2>Examples</h2> 179 <h2>Examples</h2>
180   180  
181 <p>The following string 181 <p>The following string
182 <pre class="boxed"> 182 <pre class="boxed">
183 # File: ../includes/singapore.class.php, line: 247 183 # File: ../includes/singapore.class.php, line: 247
184 #, c-format 184 #, c-format
185 msgid "Page created in %s seconds" 185 msgid "Page created in %s seconds"
186 msgstr "" 186 msgstr ""
187 </pre> 187 </pre>
188 when translated into French becomes 188 when translated into French becomes
189 <pre class="boxed"> 189 <pre class="boxed">
190 # File: ../includes/singapore.class.php, line: 247 190 # File: ../includes/singapore.class.php, line: 247
191 #, c-format 191 #, c-format
192 msgid "Page created in %s seconds" 192 msgid "Page created in %s seconds"
193 msgstr "Page créée en %s secondes" 193 msgstr "Page créée en %s secondes"
194 </pre> 194 </pre>
195   195  
196 and the following string 196 and the following string
197 <pre class="boxed"> 197 <pre class="boxed">
198 # File: ../includes/admin.class.php, line: 173 198 # File: ../includes/admin.class.php, line: 173
199 msgid "admin bar|Edit image" 199 msgid "admin bar|Edit image"
200 msgstr "" 200 msgstr ""
201 </pre> 201 </pre>
202 when translated into Italian becomes 202 when translated into Italian becomes
203 <pre class="boxed"> 203 <pre class="boxed">
204 # File: ../includes/admin.class.php, line: 173 204 # File: ../includes/admin.class.php, line: 173
205 msgid "admin bar|Edit image" 205 msgid "admin bar|Edit image"
206 msgstr "Modifica l'immagine" 206 msgstr "Modifica l'immagine"
207 </pre> 207 </pre>
208   208  
209 and the following string 209 and the following string
210 <pre class="boxed"> 210 <pre class="boxed">
211 # File: ../includes/singapore.class.php, line: 530 211 # File: ../includes/singapore.class.php, line: 530
212 #, c-format 212 #, c-format
213 msgid "%s gallery" 213 msgid "%s gallery"
214 msgid_plural "%s galleries" 214 msgid_plural "%s galleries"
215 msgstr[0] "" 215 msgstr[0] ""
216 </pre> 216 </pre>
217 when translated into Spanish becomes 217 when translated into Spanish becomes
218 <pre class="boxed"> 218 <pre class="boxed">
219 # File: ../includes/singapore.class.php, line: 530 219 # File: ../includes/singapore.class.php, line: 530
220 #, c-format 220 #, c-format
221 msgid "%s gallery" 221 msgid "%s gallery"
222 msgid_plural "%s galleries" 222 msgid_plural "%s galleries"
223 msgstr[0] "%s galería" 223 msgstr[0] "%s galería"
224 msgstr[1] "%s galerías" 224 msgstr[1] "%s galerías"
225 </pre> 225 </pre>
226   226  
227 </p> 227 </p>
228   228  
229 <h2><a name="header">Filling in the header section</a></h2> 229 <h2><a name="header">Filling in the header section</a></h2>
230   230  
231 <p class="note">NOTE: This section is mainly copied from the 231 <p class="note">NOTE: This section is mainly copied from the
232 <a href="http://www.gnu.org/manual/gettext/html_chapter/gettext_5.html#SEC35">section 5.2</a> 232 <a href="http://www.gnu.org/manual/gettext/html_chapter/gettext_5.html#SEC35">section 5.2</a>
233 of the GNU Gettext manual.</p> 233 of the GNU Gettext manual.</p>
234   234  
235 <p>The initial comments "SOME DESCRIPTIVE TITLE", "YEAR" and 235 <p>The initial comments "SOME DESCRIPTIVE TITLE", "YEAR" and
236 "FIRST AUTHOR &lt;EMAIL@ADDRESS&gt;, YEAR" ought to be replaced by 236 "FIRST AUTHOR &lt;EMAIL@ADDRESS&gt;, YEAR" ought to be replaced by
237 sensible information.</p> 237 sensible information.</p>
238   238  
239 <h3>The following fields must be filled in correctly:</h3> 239 <h3>The following fields must be filled in correctly:</h3>
240   240  
241 <dl> 241 <dl>
242 <dt>Content-Type</dt> 242 <dt>Content-Type</dt>
243 <dd>Replace <samp>ISO-8859-1</samp> with the 243 <dd>Replace <samp>ISO-8859-1</samp> with the
244 character encoding used for your language, in your locale, or 244 character encoding used for your language, in your locale, or
245 UTF-8. This field is needed for correct operation of the 245 UTF-8. This field is needed for correct operation of the
246 <code>msgmerge</code> program, as well 246 <code>msgmerge</code> program, as well
247 as for users whose locale's character encoding differs from yours. 247 as for users whose locale's character encoding differs from yours.
248 248
249 249
250 <p>The following encodings are frequently used for the corresponding 250 <p>The following encodings are frequently used for the corresponding
251 languages.</p> 251 languages.</p>
252 252
253 <ul> 253 <ul>
254 <li><code>ISO-8859-1</code> for Afrikaans, Albanian, Basque, 254 <li><code>ISO-8859-1</code> for Afrikaans, Albanian, Basque,
255 Catalan, Dutch, English, Estonian, Faroese, Finnish, French, 255 Catalan, Dutch, English, Estonian, Faroese, Finnish, French,
256 Galician, German, Greenlandic, Icelandic, Indonesian, Irish, 256 Galician, German, Greenlandic, Icelandic, Indonesian, Irish,
257 Italian, Malay, Norwegian, Portuguese, Spanish, Swedish,</li> 257 Italian, Malay, Norwegian, Portuguese, Spanish, Swedish,</li>
258 258
259 <li><code>ISO-8859-2</code> for Croatian, Czech, Hungarian, 259 <li><code>ISO-8859-2</code> for Croatian, Czech, Hungarian,
260 Polish, Romanian, Serbian, Slovak, Slovenian,</li> 260 Polish, Romanian, Serbian, Slovak, Slovenian,</li>
261 261
262 <li><code>ISO-8859-3</code> for Maltese,</li> 262 <li><code>ISO-8859-3</code> for Maltese,</li>
263 263
264 <li><code>ISO-8859-5</code> for Macedonian, Serbian,</li> 264 <li><code>ISO-8859-5</code> for Macedonian, Serbian,</li>
265 265
266 <li><code>ISO-8859-6</code> for Arabic,</li> 266 <li><code>ISO-8859-6</code> for Arabic,</li>
267 267
268 <li><code>ISO-8859-7</code> for Greek,</li> 268 <li><code>ISO-8859-7</code> for Greek,</li>
269 269
270 <li><code>ISO-8859-8</code> for Hebrew,</li> 270 <li><code>ISO-8859-8</code> for Hebrew,</li>
271 271
272 <li><code>ISO-8859-9</code> for Turkish,</li> 272 <li><code>ISO-8859-9</code> for Turkish,</li>
273 273
274 <li><code>ISO-8859-13</code> for Latvian, Lithuanian,</li> 274 <li><code>ISO-8859-13</code> for Latvian, Lithuanian,</li>
275 275
276 <li><code>ISO-8859-15</code> for Basque, Catalan, Dutch, English, 276 <li><code>ISO-8859-15</code> for Basque, Catalan, Dutch, English,
277 Finnish, French, Galician, German, Irish, Italian, Portuguese, 277 Finnish, French, Galician, German, Irish, Italian, Portuguese,
278 Spanish, Swedish,</li> 278 Spanish, Swedish,</li>
279 279
280 <li><code>KOI8-R</code> for Russian,</li> 280 <li><code>KOI8-R</code> for Russian,</li>
281 281
282 <li><code>KOI8-U</code> for Ukrainian,</li> 282 <li><code>KOI8-U</code> for Ukrainian,</li>
283 283
284 <li><code>CP1251</code> for Bulgarian, Byelorussian,</li> 284 <li><code>CP1251</code> for Bulgarian, Byelorussian,</li>
285 285
286 <li><code>GB2312</code>, <code>GBK</code>, <code>GB18030</code> 286 <li><code>GB2312</code>, <code>GBK</code>, <code>GB18030</code>
287 for simplified writing of Chinese,</li> 287 for simplified writing of Chinese,</li>
288 288
289 <li><code>BIG5</code>, <code>BIG5-HKSCS</code> for traditional 289 <li><code>BIG5</code>, <code>BIG5-HKSCS</code> for traditional
290 writing of Chinese,</li> 290 writing of Chinese,</li>
291 291
292 <li><code>EUC-JP</code> for Japanese,</li> 292 <li><code>EUC-JP</code> for Japanese,</li>
293 293
294 <li><code>EUC-KR</code> for Korean,</li> 294 <li><code>EUC-KR</code> for Korean,</li>
295 295
296 <li><code>TIS-620</code> for Thai,</li> 296 <li><code>TIS-620</code> for Thai,</li>
297 297
298 <li><code>UTF-8</code> for any language, including those listed 298 <li><code>UTF-8</code> for any language, including those listed
299 above.</li> 299 above.</li>
300 </ul> 300 </ul>
301 301
302 <p>The character encoding name can be written in either upper or 302 <p>The character encoding name can be written in either upper or
303 lower case. Usually upper case is preferred.</p> 303 lower case. Usually upper case is preferred.</p>
304 </dd> 304 </dd>
305 305
306 <dt>Plural-Forms</dt> 306 <dt>Plural-Forms</dt>
307 <dd>See the <a href="#plurals">plural forms</a> section.</dd> 307 <dd>See the <a href="#plurals">plural forms</a> section.</dd>
308   308  
309 </dl> 309 </dl>
310   310  
311 <h3>The following fields should be filled in:</h3> 311 <h3>The following fields should be filled in:</h3>
312   312  
313 <dl> 313 <dl>
314 <dt>Project-Id-Version</dt> 314 <dt>Project-Id-Version</dt>
315 <dd>This is the name and version of the package.</dd> 315 <dd>This is the name and version of the package.</dd>
316 316
317 <dt>Last-Translator</dt> 317 <dt>Last-Translator</dt>
318 <dd>Fill in your name and email address (without double 318 <dd>Fill in your name and email address (without double
319 quotes).</dd> 319 quotes).</dd>
320 320
321 <dt>Language-Team</dt> 321 <dt>Language-Team</dt>
322 <dd>Fill in the English name of the language followed by the native name 322 <dd>Fill in the English name of the language followed by the native name
323 of the language in brackets. E.g. <i>"Language-Team: German (Deutsch)\n"</i><br /> 323 of the language in brackets. E.g. <i>"Language-Team: German (Deutsch)\n"</i><br />
324 Note this is different from the GNU specification but is required in order 324 Note this is different from the GNU specification but is required in order
325 for the language flipper function to work. 325 for the language flipper function to work.
326 </dd> 326 </dd>
327 </dl> 327 </dl>
328   328  
329 <h3>The following fields may be left alone:</h3> 329 <h3>The following fields may be left alone:</h3>
330   330  
331 <dl> 331 <dl>
332 <dt>POT-Creation-Date</dt> 332 <dt>POT-Creation-Date</dt>
333 <dd>This has already been filled in by <code>xgettext</code>.</dd> 333 <dd>This has already been filled in by <code>xgettext</code>.</dd>
334 334
335 <dt>PO-Revision-Date</dt> 335 <dt>PO-Revision-Date</dt>
336 <dd>You don't need to fill this in. It should be filled by the editor when 336 <dd>You don't need to fill this in. It should be filled by the editor when
337 you save the file.</dd> 337 you save the file.</dd>
338 338
339 <dt>Content-Transfer-Encoding</dt> 339 <dt>Content-Transfer-Encoding</dt>
340 <dd>Set this to <code>8bit</code>.</dd> 340 <dd>Set this to <code>8bit</code>.</dd>
341 </dl> 341 </dl>
342   342  
343 <h2><a name="plurals">Plural forms</a></h2> 343 <h2><a name="plurals">Plural forms</a></h2>
344   344  
345 <p class="note">NOTE: This section is mainly copied from the 345 <p class="note">NOTE: This section is mainly copied from the
346 <a href="http://www.gnu.org/manual/gettext/html_chapter/gettext_10.html#SEC150">section 10.2.5</a> 346 <a href="http://www.gnu.org/manual/gettext/html_chapter/gettext_10.html#SEC150">section 10.2.5</a>
347 of the GNU Gettext manual.</p> 347 of the GNU Gettext manual.</p>
348   348  
349   349  
350 <p>The Plural-forms field in the PO header is used to calculate which plural 350 <p>The Plural-forms field in the PO header is used to calculate which plural
351 form of a word to use. In English there are only two plural forms but other 351 form of a word to use. In English there are only two plural forms but other
352 languages have only one or as many as four.</p> 352 languages have only one or as many as four.</p>
353   353  
354 <p>Please check the list below to see if your language is listed. If it is 354 <p>Please check the list below to see if your language is listed. If it is
355 then use the corresponding string. If not then you can either write it yourself 355 then use the corresponding string. If not then you can either write it yourself
356 (details below and in the gettext manual) or email a member of the team 356 (details below and in the gettext manual) or email a member of the team
357 describing how your langauge works (e.g. (not real) 0 car, 1-2 cars, 3 caren, 5+ carii) 357 describing how your langauge works (e.g. (not real) 0 car, 1-2 cars, 3 caren, 5+ carii)
358 and we will write one for you. 358 and we will write one for you.
359   359  
360 <dl> 360 <dl>
361 <dt>Only one form:</dt> 361 <dt>Only one form:</dt>
362 <dd>Some languages only require one single form. There is no 362 <dd>Some languages only require one single form. There is no
363 distinction between the singular and plural form. An appropriate 363 distinction between the singular and plural form. An appropriate
364 header entry would look like this: 364 header entry would look like this:
365 <pre>Plural-Forms: nplurals=1; plural=0;</pre> 365 <pre>Plural-Forms: nplurals=1; plural=0;</pre>
366 <p>Languages with this property include:</p> 366 <p>Languages with this property include:</p>
367 367
368 <dl> 368 <dl>
369 <dt>Finno-Ugric family</dt> 369 <dt>Finno-Ugric family</dt>
370 <dd>Hungarian</dd> 370 <dd>Hungarian</dd>
371 371
372 <dt>Asian family</dt> 372 <dt>Asian family</dt>
373 <dd>Japanese, Korean</dd> 373 <dd>Japanese, Korean</dd>
374 374
375 <dt>Turkic/Altaic family</dt> 375 <dt>Turkic/Altaic family</dt>
376 <dd>Turkish</dd> 376 <dd>Turkish</dd>
377 </dl> 377 </dl>
378 </dd> 378 </dd>
379 379
380 <dt>Two forms, singular used for one only</dt> 380 <dt>Two forms, singular used for one only</dt>
381 <dd>This is the form used in most existing programs since it is 381 <dd>This is the form used in most existing programs since it is
382 what English is using. A header entry would look like this: 382 what English is using. A header entry would look like this:
383 <pre>Plural-Forms: nplurals=2; plural=n==1 ? 0 : 1;</pre> 383 <pre>Plural-Forms: nplurals=2; plural=n==1 ? 0 : 1;</pre>
384 384
385 <p>Languages with this property include:</p> 385 <p>Languages with this property include:</p>
386 <dl> 386 <dl>
387 <dt>Germanic family</dt> 387 <dt>Germanic family</dt>
388 <dd>Danish, Dutch, English, German, Norwegian, Swedish</dd> 388 <dd>Danish, Dutch, English, German, Norwegian, Swedish</dd>
389 389
390 <dt>Finno-Ugric family</dt> 390 <dt>Finno-Ugric family</dt>
391 <dd>Estonian, Finnish</dd> 391 <dd>Estonian, Finnish</dd>
392 392
393 <dt>Latin/Greek family</dt> 393 <dt>Latin/Greek family</dt>
394 <dd>Greek</dd> 394 <dd>Greek</dd>
395 395
396 <dt>Semitic family</dt> 396 <dt>Semitic family</dt>
397 <dd>Hebrew</dd> 397 <dd>Hebrew</dd>
398 398
399 <dt>Romanic family</dt> 399 <dt>Romanic family</dt>
400 <dd>Italian, Portuguese, Spanish</dd> 400 <dd>Italian, Portuguese, Spanish</dd>
401 401
402 <dt>Artificial</dt> 402 <dt>Artificial</dt>
403 <dd>Esperanto</dd> 403 <dd>Esperanto</dd>
404 </dl> 404 </dl>
405 </dd> 405 </dd>
406 406
407 <dt>Two forms, singular used for zero and one</dt> 407 <dt>Two forms, singular used for zero and one</dt>
408 <dd>Exceptional case in the language family. The header entry would be: 408 <dd>Exceptional case in the language family. The header entry would be:
409 <pre>Plural-Forms: nplurals=2; plural=n&gt;1;</pre> 409 <pre>Plural-Forms: nplurals=2; plural=n&gt;1;</pre>
410 410
411 <p>Languages with this property include:</p> 411 <p>Languages with this property include:</p>
412 412
413 <dl> 413 <dl>
414 <dt>Romanic family</dt> 414 <dt>Romanic family</dt>
415 <dd>French, Brazilian Portuguese</dd> 415 <dd>French, Brazilian Portuguese</dd>
416 </dl> 416 </dl>
417 </dd> 417 </dd>
418 418
419 <dt>Three forms, special case for zero</dt> 419 <dt>Three forms, special case for zero</dt>
420 <dd>The header entry would be: 420 <dd>The header entry would be:
421 <pre>Plural-Forms: nplurals=3; plural=n%10==1 &amp;&amp; n%100!=11 ? 0 : n != 0 ? 1 : 2;</pre> 421 <pre>Plural-Forms: nplurals=3; plural=n%10==1 &amp;&amp; n%100!=11 ? 0 : n != 0 ? 1 : 2;</pre>
422 422
423 <p>Languages with this property include:</p> 423 <p>Languages with this property include:</p>
424 424
425 <dl> 425 <dl>
426 <dt>Baltic family</dt> 426 <dt>Baltic family</dt>
427 <dd>Latvian</dd> 427 <dd>Latvian</dd>
428 </dl> 428 </dl>
429 </dd> 429 </dd>
430 430
431 <dt>Three forms, special cases for one and two</dt> 431 <dt>Three forms, special cases for one and two</dt>
432 <dd>The header entry would be: 432 <dd>The header entry would be:
433 <pre>Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;</pre> 433 <pre>Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;</pre>
434 434
435 <p>Languages with this property include:</p> 435 <p>Languages with this property include:</p>
436 436
437 <dl> 437 <dl>
438 <dt>Celtic</dt> 438 <dt>Celtic</dt>
439 <dd>Gaeilge (Irish)</dd> 439 <dd>Gaeilge (Irish)</dd>
440 </dl> 440 </dl>
441 </dd> 441 </dd>
442 442
443 <dt>Three forms, special case for numbers ending in 1[2-9]</dt> 443 <dt>Three forms, special case for numbers ending in 1[2-9]</dt>
444 <dd>The header entry would look like this: 444 <dd>The header entry would look like this:
445 <pre>Plural-Forms: nplurals=3; plural=n%10==1 &amp;&amp; n%100!=11 ? 0 : n%10&gt;=2 &amp;&amp; (n%100&lt;10 || n%100&gt;=20) ? 1 : 2;</pre> 445 <pre>Plural-Forms: nplurals=3; plural=n%10==1 &amp;&amp; n%100!=11 ? 0 : n%10&gt;=2 &amp;&amp; (n%100&lt;10 || n%100&gt;=20) ? 1 : 2;</pre>
446 446
447 <p>Languages with this property include:</p> 447 <p>Languages with this property include:</p>
448 448
449 <dl> 449 <dl>
450 <dt>Baltic family</dt> 450 <dt>Baltic family</dt>
451 <dd>Lithuanian</dd> 451 <dd>Lithuanian</dd>
452 </dl> 452 </dl>
453 </dd> 453 </dd>
454 454
455 <dt>Three forms, special cases for numbers ending in 1 and 2, 3, 455 <dt>Three forms, special cases for numbers ending in 1 and 2, 3,
456 4, except those ending in 1[1-4]</dt> 456 4, except those ending in 1[1-4]</dt>
457 457
458 <dd>The header entry would look like this: 458 <dd>The header entry would look like this:
459 <pre>Plural-Forms: nplurals=3; plural=n%10==1 &amp;&amp; n%100!=11 ? 0 : n%10&gt;=2 &amp;&amp; n%10&lt;=4 &amp;&amp; (n%100&lt;10 || n%100&gt;=20) ? 1 : 2;</pre> 459 <pre>Plural-Forms: nplurals=3; plural=n%10==1 &amp;&amp; n%100!=11 ? 0 : n%10&gt;=2 &amp;&amp; n%10&lt;=4 &amp;&amp; (n%100&lt;10 || n%100&gt;=20) ? 1 : 2;</pre>
460 <p>Languages with this property include:</p> 460 <p>Languages with this property include:</p>
461 461
462 <dl> 462 <dl>
463 <dt>Slavic family</dt> 463 <dt>Slavic family</dt>
464 <dd>Croatian, Czech, Russian, Slovak, Ukrainian</dd> 464 <dd>Croatian, Czech, Russian, Slovak, Ukrainian</dd>
465 </dl> 465 </dl>
466 </dd> 466 </dd>
467 467
468 <dt>Three forms, special case for one and some numbers ending in 468 <dt>Three forms, special case for one and some numbers ending in
469 2, 3, or 4</dt> 469 2, 3, or 4</dt>
470 470
471 <dd>The header entry would look like this: 471 <dd>The header entry would look like this:
472 <pre>Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10&gt;=2 &amp;&amp; n%10&lt;=4 &amp;&amp; (n%100&lt;10 || n%100&gt;=20) ? 1 : 2;</pre> 472 <pre>Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10&gt;=2 &amp;&amp; n%10&lt;=4 &amp;&amp; (n%100&lt;10 || n%100&gt;=20) ? 1 : 2;</pre>
473 <p>Languages with this property include:</p> 473 <p>Languages with this property include:</p>
474 474
475 <dl> 475 <dl>
476 <dt>Slavic family</dt> 476 <dt>Slavic family</dt>
477 <dd>Polish</dd> 477 <dd>Polish</dd>
478 </dl> 478 </dl>
479 </dd> 479 </dd>
480 480
481 <dt>Four forms, special case for one and all numbers ending in 481 <dt>Four forms, special case for one and all numbers ending in
482 02, 03, or 04</dt> 482 02, 03, or 04</dt>
483 483
484 <dd>The header entry would look like this: 484 <dd>The header entry would look like this:
485 <pre>Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;</pre> 485 <pre>Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;</pre>
486 <p>Languages with this property include:</p> 486 <p>Languages with this property include:</p>
487 487
488 <dl> 488 <dl>
489 <dt>Slavic family</dt> 489 <dt>Slavic family</dt>
490 <dd>Slovenian</dd> 490 <dd>Slovenian</dd>
491 </dl> 491 </dl>
492 </dd> 492 </dd>
493 </dl> 493 </dl>
494   494  
495 <h3>How the Plural-forms header works:</h3> 495 <h3>How the Plural-forms header works:</h3>
496   496  
497 <p>The <code>nplurals</code> value must be a decimal number which 497 <p>The <code>nplurals</code> value must be a decimal number which
498 specifies how many different plural forms exist for this 498 specifies how many different plural forms exist for this
499 language. The string following <code>plural</code> is an 499 language. The string following <code>plural</code> is an
500 expression which is using the C language syntax. Exceptions are 500 expression which is using the C language syntax. Exceptions are
501 that no negative numbers are allowed, numbers must be decimal, 501 that no negative numbers are allowed, numbers must be decimal,
502 and the only variable allowed is <code>n</code>. This expression 502 and the only variable allowed is <code>n</code>. This expression
503 will be evaluated whenever one of the plural functions is called. 503 will be evaluated whenever one of the plural functions is called.
504 The numeric value passed to 504 The numeric value passed to
505 these functions is then substituted for all uses of the variable 505 these functions is then substituted for all uses of the variable
506 <code>n</code> in the expression. The resulting value then must 506 <code>n</code> in the expression. The resulting value then must
507 be greater or equal to zero and smaller than the value given as 507 be greater or equal to zero and smaller than the value given as
508 the value of <code>nplurals</code>.</p> 508 the value of <code>nplurals</code>.</p>
509   509  
510 <h2><a name="links">Useful links</a></h2> 510 <h2><a name="links">Useful links</a></h2>
511   511  
512 <ul> 512 <ul>
513 <li><a href="http://singapore.sourceforge.net/forum/viewforum.php?f=6">singapore i18n forum</a></li> 513 <li><a href="http://singapore.sourceforge.net/forum/viewforum.php?f=6">singapore i18n forum</a></li>
514 <li><a href="http://www.gnu.org/software/gettext/">GNU Gettext homepage</a></li> 514 <li><a href="http://www.gnu.org/software/gettext/">GNU Gettext homepage</a></li>
515 <li><a href="http://www.gnu.org/manual/gettext/">GNU Gettext manual</a> - lots 515 <li><a href="http://www.gnu.org/manual/gettext/">GNU Gettext manual</a> - lots
516 of technical information about the PO format</li> 516 of technical information about the PO format</li>
517 <li><a href="http://poedit.sourceforge.net/">poEdit</a> - an open source cross-platform PO editor</li> 517 <li><a href="http://poedit.sourceforge.net/">poEdit</a> - an open source cross-platform PO editor</li>
518 <li><a href="http://www.gtranslator.org/">gTranslator</a> - a PO editor for GNOME</li> 518 <li><a href="http://www.gtranslator.org/">gTranslator</a> - a PO editor for GNOME</li>
519 <li><a href="http://i18n.kde.org/tools/kbabel/">KBabel</a> - a PO editor for KDE</li> 519 <li><a href="http://i18n.kde.org/tools/kbabel/">KBabel</a> - a PO editor for KDE</li>
520 </ul> 520 </ul>
521   521  
522   522  
523 <p><em>$Date: 2004/11/01 08:17:33 $</em></p> 523 <p><em>$Date: 2004/11/01 08:17:33 $</em></p>
524   524  
525 </body> 525 </body>
526 </html> 526 </html>