Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/share/doc/gettext/gettext_16.html @ 68:5028fdace37b
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 16:23:26 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
67:0e9998148a16 | 68:5028fdace37b |
---|---|
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd"> | |
2 <html> | |
3 <!-- Created on February, 21 2024 by texi2html 1.78a --> | |
4 <!-- | |
5 Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author) | |
6 Karl Berry <karl@freefriends.org> | |
7 Olaf Bachmann <obachman@mathematik.uni-kl.de> | |
8 and many others. | |
9 Maintained by: Many creative people. | |
10 Send bugs and suggestions to <texi2html-bug@nongnu.org> | |
11 | |
12 --> | |
13 <head> | |
14 <title>GNU gettext utilities: 16. Other Data Formats</title> | |
15 | |
16 <meta name="description" content="GNU gettext utilities: 16. Other Data Formats"> | |
17 <meta name="keywords" content="GNU gettext utilities: 16. Other Data Formats"> | |
18 <meta name="resource-type" content="document"> | |
19 <meta name="distribution" content="global"> | |
20 <meta name="Generator" content="texi2html 1.78a"> | |
21 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
22 <style type="text/css"> | |
23 <!-- | |
24 a.summary-letter {text-decoration: none} | |
25 pre.display {font-family: serif} | |
26 pre.format {font-family: serif} | |
27 pre.menu-comment {font-family: serif} | |
28 pre.menu-preformatted {font-family: serif} | |
29 pre.smalldisplay {font-family: serif; font-size: smaller} | |
30 pre.smallexample {font-size: smaller} | |
31 pre.smallformat {font-family: serif; font-size: smaller} | |
32 pre.smalllisp {font-size: smaller} | |
33 span.roman {font-family:serif; font-weight:normal;} | |
34 span.sansserif {font-family:sans-serif; font-weight:normal;} | |
35 ul.toc {list-style: none} | |
36 --> | |
37 </style> | |
38 | |
39 | |
40 </head> | |
41 | |
42 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> | |
43 | |
44 <table cellpadding="1" cellspacing="1" border="0"> | |
45 <tr><td valign="middle" align="left">[<a href="gettext_15.html#SEC263" title="Beginning of this chapter or previous chapter"> << </a>]</td> | |
46 <td valign="middle" align="left">[<a href="gettext_17.html#SEC364" title="Next chapter"> >> </a>]</td> | |
47 <td valign="middle" align="left"> </td> | |
48 <td valign="middle" align="left"> </td> | |
49 <td valign="middle" align="left"> </td> | |
50 <td valign="middle" align="left"> </td> | |
51 <td valign="middle" align="left"> </td> | |
52 <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> | |
53 <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td> | |
54 <td valign="middle" align="left">[<a href="gettext_21.html#SEC389" title="Index">Index</a>]</td> | |
55 <td valign="middle" align="left">[<a href="gettext_abt.html#SEC_About" title="About (help)"> ? </a>]</td> | |
56 </tr></table> | |
57 | |
58 <hr size="2"> | |
59 <a name="Data-Formats"></a> | |
60 <a name="SEC340"></a> | |
61 <h1 class="chapter"> <a href="gettext_toc.html#TOC333">16. Other Data Formats</a> </h1> | |
62 | |
63 <p>While the GNU gettext tools deal mainly with POT and PO files, they can | |
64 also manipulate a couple of other data formats. | |
65 </p> | |
66 | |
67 | |
68 <a name="Internationalizable-Data"></a> | |
69 <a name="SEC341"></a> | |
70 <h2 class="section"> <a href="gettext_toc.html#TOC334">16.1 Internationalizable Data Formats</a> </h2> | |
71 | |
72 <p>Here is a list of other data formats which can be internationalized | |
73 using GNU gettext. | |
74 </p> | |
75 | |
76 | |
77 <a name="POT"></a> | |
78 <a name="SEC342"></a> | |
79 <h3 class="subsection"> <a href="gettext_toc.html#TOC335">16.1.1 POT - Portable Object Template</a> </h3> | |
80 | |
81 <dl compact="compact"> | |
82 <dt> RPMs</dt> | |
83 <dd><p>gettext | |
84 </p> | |
85 </dd> | |
86 <dt> Ubuntu packages</dt> | |
87 <dd><p>gettext | |
88 </p> | |
89 </dd> | |
90 <dt> File extension</dt> | |
91 <dd><p><code>pot</code>, <code>po</code> | |
92 </p> | |
93 </dd> | |
94 <dt> Extractor</dt> | |
95 <dd><p><code>xgettext</code> | |
96 </p></dd> | |
97 </dl> | |
98 | |
99 | |
100 <a name="RST"></a> | |
101 <a name="SEC343"></a> | |
102 <h3 class="subsection"> <a href="gettext_toc.html#TOC336">16.1.2 Resource String Table</a> </h3> | |
103 | |
104 <p>RST is the format of resource string table files of the Free Pascal compiler | |
105 versions older than 3.0.0. RSJ is the new format of resource string table | |
106 files, created by the Free Pascal compiler version 3.0.0 or newer. | |
107 </p> | |
108 <dl compact="compact"> | |
109 <dt> RPMs</dt> | |
110 <dd><p>fpk | |
111 </p> | |
112 </dd> | |
113 <dt> Ubuntu packages</dt> | |
114 <dd><p>fp-compiler | |
115 </p> | |
116 </dd> | |
117 <dt> File extension</dt> | |
118 <dd><p><code>rst</code>, <code>rsj</code> | |
119 </p> | |
120 </dd> | |
121 <dt> Extractor</dt> | |
122 <dd><p><code>xgettext</code>, <code>rstconv</code> | |
123 </p></dd> | |
124 </dl> | |
125 | |
126 | |
127 <a name="Glade"></a> | |
128 <a name="SEC344"></a> | |
129 <h3 class="subsection"> <a href="gettext_toc.html#TOC337">16.1.3 Glade - GNOME user interface description</a> </h3> | |
130 | |
131 <dl compact="compact"> | |
132 <dt> RPMs</dt> | |
133 <dd><p>glade, libglade, glade2, libglade2, intltool | |
134 </p> | |
135 </dd> | |
136 <dt> Ubuntu packages</dt> | |
137 <dd><p>glade, libglade2-dev, intltool | |
138 </p> | |
139 </dd> | |
140 <dt> File extension</dt> | |
141 <dd><p><code>glade</code>, <code>glade2</code>, <code>ui</code> | |
142 </p> | |
143 </dd> | |
144 <dt> Extractor</dt> | |
145 <dd><p><code>xgettext</code>, <code>libglade-xgettext</code>, <code>xml-i18n-extract</code>, <code>intltool-extract</code> | |
146 </p></dd> | |
147 </dl> | |
148 | |
149 | |
150 <a name="GSettings"></a> | |
151 <a name="SEC345"></a> | |
152 <h3 class="subsection"> <a href="gettext_toc.html#TOC338">16.1.4 GSettings - GNOME user configuration schema</a> </h3> | |
153 | |
154 <dl compact="compact"> | |
155 <dt> RPMs</dt> | |
156 <dd><p>glib2 | |
157 </p> | |
158 </dd> | |
159 <dt> Ubuntu packages</dt> | |
160 <dd><p>libglib2.0-dev | |
161 </p> | |
162 </dd> | |
163 <dt> File extension</dt> | |
164 <dd><p><code>gschema.xml</code> | |
165 </p> | |
166 </dd> | |
167 <dt> Extractor</dt> | |
168 <dd><p><code>xgettext</code>, <code>intltool-extract</code> | |
169 </p></dd> | |
170 </dl> | |
171 | |
172 | |
173 <a name="AppData"></a> | |
174 <a name="SEC346"></a> | |
175 <h3 class="subsection"> <a href="gettext_toc.html#TOC339">16.1.5 AppData - freedesktop.org application description</a> </h3> | |
176 | |
177 <p>This file format is specified in | |
178 <a href="https://www.freedesktop.org/software/appstream/docs/">https://www.freedesktop.org/software/appstream/docs/</a>. | |
179 </p> | |
180 <dl compact="compact"> | |
181 <dt> RPMs</dt> | |
182 <dd><p>appdata-tools, appstream, libappstream-glib, libappstream-glib-builder | |
183 </p> | |
184 </dd> | |
185 <dt> Ubuntu packages</dt> | |
186 <dd><p>appdata-tools, appstream, libappstream-glib-dev | |
187 </p> | |
188 </dd> | |
189 <dt> File extension</dt> | |
190 <dd><p><code>appdata.xml</code>, <code>metainfo.xml</code> | |
191 </p> | |
192 </dd> | |
193 <dt> Extractor</dt> | |
194 <dd><p><code>xgettext</code>, <code>intltool-extract</code>, <code>itstool</code> | |
195 </p></dd> | |
196 </dl> | |
197 | |
198 | |
199 <a name="Preparing-ITS-Rules"></a> | |
200 <a name="SEC347"></a> | |
201 <h3 class="subsection"> <a href="gettext_toc.html#TOC340">16.1.6 Preparing Rules for XML Internationalization</a> </h3> | |
202 | |
203 <p>Marking translatable strings in an XML file is done through a separate | |
204 "rule" file, making use of the Internationalization Tag Set standard | |
205 (ITS, <a href="https://www.w3.org/TR/its20/">https://www.w3.org/TR/its20/</a>). The currently supported ITS | |
206 data categories are: ‘<samp>Translate</samp>’, ‘<samp>Localization Note</samp>’, | |
207 ‘<samp>Elements Within Text</samp>’, and ‘<samp>Preserve Space</samp>’. In addition to | |
208 them, <code>xgettext</code> also recognizes the following extended data | |
209 categories: | |
210 </p> | |
211 <dl compact="compact"> | |
212 <dt> ‘<samp>Context</samp>’</dt> | |
213 <dd> | |
214 <p>This data category associates <code>msgctxt</code> to the extracted text. In | |
215 the global rule, the <code>contextRule</code> element contains the following: | |
216 </p> | |
217 <ul class="toc"> | |
218 <li> | |
219 A required <code>selector</code> attribute. It contains an absolute selector | |
220 that selects the nodes to which this rule applies. | |
221 | |
222 </li><li> | |
223 A required <code>contextPointer</code> attribute that contains a relative | |
224 selector pointing to a node that holds the <code>msgctxt</code> value. | |
225 | |
226 </li><li> | |
227 An optional <code>textPointer</code> attribute that contains a relative | |
228 selector pointing to a node that holds the <code>msgid</code> value. | |
229 </li></ul> | |
230 | |
231 </dd> | |
232 <dt> ‘<samp>Escape Special Characters</samp>’</dt> | |
233 <dd> | |
234 <p>This data category indicates whether the special XML characters | |
235 (<code><</code>, <code>></code>, <code>&</code>, <code>"</code>) are escaped with entity | |
236 reference. In the global rule, the <code>escapeRule</code> element contains | |
237 the following: | |
238 </p> | |
239 <ul class="toc"> | |
240 <li> | |
241 A required <code>selector</code> attribute. It contains an absolute selector | |
242 that selects the nodes to which this rule applies. | |
243 | |
244 </li><li> | |
245 A required <code>escape</code> attribute with the value <code>yes</code> or <code>no</code>. | |
246 </li></ul> | |
247 | |
248 </dd> | |
249 <dt> ‘<samp>Extended Preserve Space</samp>’</dt> | |
250 <dd> | |
251 <p>This data category extends the standard ‘<samp>Preserve Space</samp>’ data | |
252 category with the additional values ‘<samp>trim</samp>’ and ‘<samp>paragraph</samp>’. | |
253 ‘<samp>trim</samp>’ means to remove the leading and trailing whitespaces of the | |
254 content, but not to normalize whitespaces in the middle. | |
255 ‘<samp>paragraph</samp>’ means to normalize the content but keep the paragraph | |
256 boundaries. In the global | |
257 rule, the <code>preserveSpaceRule</code> element contains the following: | |
258 </p> | |
259 <ul class="toc"> | |
260 <li> | |
261 A required <code>selector</code> attribute. It contains an absolute selector | |
262 that selects the nodes to which this rule applies. | |
263 | |
264 </li><li> | |
265 A required <code>space</code> attribute with the value <code>default</code>, | |
266 <code>preserve</code>, <code>trim</code>, or <code>paragraph</code>. | |
267 </li></ul> | |
268 | |
269 </dd> | |
270 </dl> | |
271 | |
272 <p>All those extended data categories can only be expressed with global | |
273 rules, and the rule elements have to have the | |
274 <code>https://www.gnu.org/s/gettext/ns/its/extensions/1.0</code> namespace. | |
275 </p> | |
276 <p>Given the following XML document in a file ‘<tt>messages.xml</tt>’: | |
277 </p> | |
278 <table><tr><td> </td><td><pre class="example"><?xml version="1.0"?> | |
279 <messages> | |
280 <message> | |
281 <p>A translatable string</p> | |
282 </message> | |
283 <message> | |
284 <p translatable="no">A non-translatable string</p> | |
285 </message> | |
286 </messages> | |
287 </pre></td></tr></table> | |
288 | |
289 <p>To extract the first text content ("A translatable string"), but not the | |
290 second ("A non-translatable string"), the following ITS rules can be used: | |
291 </p> | |
292 <table><tr><td> </td><td><pre class="example"><?xml version="1.0"?> | |
293 <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0"> | |
294 <its:translateRule selector="/messages" translate="no"/> | |
295 <its:translateRule selector="//message/p" translate="yes"/> | |
296 | |
297 <!-- If 'p' has an attribute 'translatable' with the value 'no', then | |
298 the content is not translatable. --> | |
299 <its:translateRule selector="//message/p[@translatable = 'no']" | |
300 translate="no"/> | |
301 </its:rules> | |
302 </pre></td></tr></table> | |
303 | |
304 <p>‘<samp>xgettext</samp>’ needs another file called "locating rule" to associate | |
305 an ITS rule with an XML file. If the above ITS file is saved as | |
306 ‘<tt>messages.its</tt>’, the locating rule would look like: | |
307 </p> | |
308 <table><tr><td> </td><td><pre class="example"><?xml version="1.0"?> | |
309 <locatingRules> | |
310 <locatingRule name="Messages" pattern="*.xml"> | |
311 <documentRule localName="messages" target="messages.its"/> | |
312 </locatingRule> | |
313 <locatingRule name="Messages" pattern="*.msg" target="messages.its"/> | |
314 </locatingRules> | |
315 </pre></td></tr></table> | |
316 | |
317 <p>The <code>locatingRule</code> element must have a <code>pattern</code> attribute, | |
318 which denotes either a literal file name or a wildcard pattern of the | |
319 XML file<a name="DOCF7" href="gettext_fot.html#FOOT7">(7)</a>. The <code>locatingRule</code> element can have child | |
320 <code>documentRule</code> element, which adds checks on the content of the XML | |
321 file. | |
322 </p> | |
323 <p>The first rule matches any file with the ‘<tt>.xml</tt>’ file extension, but | |
324 it only applies to XML files whose root element is ‘<samp><messages></samp>’. | |
325 </p> | |
326 <p>The second rule indicates that the same ITS rule file are also | |
327 applicable to any file with the ‘<tt>.msg</tt>’ file extension. The | |
328 optional <code>name</code> attribute of <code>locatingRule</code> allows to choose | |
329 rules by name, typically with <code>xgettext</code>'s <code>-L</code> option. | |
330 </p> | |
331 <p>The associated ITS rule file is indicated by the <code>target</code> attribute | |
332 of <code>locatingRule</code> or <code>documentRule</code>. If it is specified in a | |
333 <code>documentRule</code> element, the parent <code>locatingRule</code> shouldn't | |
334 have the <code>target</code> attribute. | |
335 </p> | |
336 <p>Locating rule files must have the ‘<tt>.loc</tt>’ file extension. Both ITS | |
337 rule files and locating rule files must be installed in the | |
338 ‘<tt>$prefix/share/gettext/its</tt>’ directory. Once those files are | |
339 properly installed, <code>xgettext</code> can extract translatable strings | |
340 from the matching XML files. | |
341 </p> | |
342 | |
343 <a name="SEC348"></a> | |
344 <h4 class="subsubsection"> <a href="gettext_toc.html#TOC341">16.1.6.1 Two Use-cases of Translated Strings in XML</a> </h4> | |
345 | |
346 <p>For XML, there are two use-cases of translated strings. One is the case | |
347 where the translated strings are directly consumed by programs, and the | |
348 other is the case where the translated strings are merged back to the | |
349 original XML document. In the former case, special characters in the | |
350 extracted strings shouldn't be escaped, while they should in the latter | |
351 case. To control wheter to escape special characters, the ‘<samp>Escape | |
352 Special Characters</samp>’ data category can be used. | |
353 </p> | |
354 <p>To merge the translations, the ‘<samp>msgfmt</samp>’ program can be used with | |
355 the option <code>--xml</code>. See section <a href="gettext_10.html#SEC174">Invoking the <code>msgfmt</code> Program</a>, for more details | |
356 about how one calls the ‘<samp>msgfmt</samp>’ program. ‘<samp>msgfmt</samp>’'s | |
357 <code>--xml</code> option doesn't perform character escaping, so translated | |
358 strings can have arbitrary XML constructs, such as elements for markup. | |
359 </p> | |
360 | |
361 | |
362 <a name="Localized-Data"></a> | |
363 <a name="SEC349"></a> | |
364 <h2 class="section"> <a href="gettext_toc.html#TOC342">16.2 Localized Data Formats</a> </h2> | |
365 | |
366 <p>Here is a list of file formats that contain localized data and that the | |
367 GNU gettext tools can manipulate. | |
368 </p> | |
369 | |
370 | |
371 <a name="Editable-Message-Catalogs"></a> | |
372 <a name="SEC350"></a> | |
373 <h3 class="subsection"> <a href="gettext_toc.html#TOC343">16.2.1 Editable Message Catalogs</a> </h3> | |
374 | |
375 <p>These file formats can be used with all of the <code>msg*</code> tools and with | |
376 the <code>xgettext</code> program. | |
377 </p> | |
378 <p>If you just want to convert among these formats, you can use the | |
379 <code>msgcat</code> program (with the appropriate option) or the <code>xgettext</code> | |
380 program. | |
381 </p> | |
382 | |
383 | |
384 <a name="PO"></a> | |
385 <a name="SEC351"></a> | |
386 <h4 class="subsubsection"> <a href="gettext_toc.html#TOC344">16.2.1.1 PO - Portable Object</a> </h4> | |
387 | |
388 <dl compact="compact"> | |
389 <dt> File extension</dt> | |
390 <dd><p><code>po</code> | |
391 </p></dd> | |
392 </dl> | |
393 | |
394 | |
395 <a name="Java-_002eproperties"></a> | |
396 <a name="SEC352"></a> | |
397 <h4 class="subsubsection"> <a href="gettext_toc.html#TOC345">16.2.1.2 Java .properties</a> </h4> | |
398 | |
399 <dl compact="compact"> | |
400 <dt> File extension</dt> | |
401 <dd><p><code>properties</code> | |
402 </p></dd> | |
403 </dl> | |
404 | |
405 | |
406 <a name="GNUstep-_002estrings"></a> | |
407 <a name="SEC353"></a> | |
408 <h4 class="subsubsection"> <a href="gettext_toc.html#TOC346">16.2.1.3 NeXTstep/GNUstep .strings</a> </h4> | |
409 | |
410 <dl compact="compact"> | |
411 <dt> File extension</dt> | |
412 <dd><p><code>strings</code> | |
413 </p></dd> | |
414 </dl> | |
415 | |
416 | |
417 <a name="Compiled-Message-Catalogs"></a> | |
418 <a name="SEC354"></a> | |
419 <h3 class="subsection"> <a href="gettext_toc.html#TOC347">16.2.2 Compiled Message Catalogs</a> </h3> | |
420 | |
421 <p>These file formats can be created through <code>msgfmt</code> and converted back | |
422 to PO format through <code>msgunfmt</code>. | |
423 </p> | |
424 | |
425 | |
426 <a name="MO"></a> | |
427 <a name="SEC355"></a> | |
428 <h4 class="subsubsection"> <a href="gettext_toc.html#TOC348">16.2.2.1 MO - Machine Object</a> </h4> | |
429 | |
430 <dl compact="compact"> | |
431 <dt> File extension</dt> | |
432 <dd><p><code>mo</code> | |
433 </p></dd> | |
434 </dl> | |
435 | |
436 <p>See section <a href="gettext_10.html#SEC196">The Format of GNU MO Files</a> for details. | |
437 </p> | |
438 | |
439 <a name="Java-ResourceBundle"></a> | |
440 <a name="SEC356"></a> | |
441 <h4 class="subsubsection"> <a href="gettext_toc.html#TOC349">16.2.2.2 Java ResourceBundle</a> </h4> | |
442 | |
443 <dl compact="compact"> | |
444 <dt> File extension</dt> | |
445 <dd><p><code>class</code> | |
446 </p></dd> | |
447 </dl> | |
448 | |
449 <p>For more information, see the section <a href="gettext_15.html#SEC299">Java</a> and the examples | |
450 <code>hello-java</code>, <code>hello-java-awt</code>, <code>hello-java-swing</code>. | |
451 </p> | |
452 | |
453 <a name="C_0023-Satellite-Assembly"></a> | |
454 <a name="SEC357"></a> | |
455 <h4 class="subsubsection"> <a href="gettext_toc.html#TOC350">16.2.2.3 C# Satellite Assembly</a> </h4> | |
456 | |
457 <dl compact="compact"> | |
458 <dt> File extension</dt> | |
459 <dd><p><code>dll</code> | |
460 </p></dd> | |
461 </dl> | |
462 | |
463 <p>For more information, see the section <a href="gettext_15.html#SEC300">C#</a>. | |
464 </p> | |
465 | |
466 <a name="C_0023-Resource"></a> | |
467 <a name="SEC358"></a> | |
468 <h4 class="subsubsection"> <a href="gettext_toc.html#TOC351">16.2.2.4 C# Resource</a> </h4> | |
469 | |
470 <dl compact="compact"> | |
471 <dt> File extension</dt> | |
472 <dd><p><code>resources</code> | |
473 </p></dd> | |
474 </dl> | |
475 | |
476 <p>For more information, see the section <a href="gettext_15.html#SEC300">C#</a>. | |
477 </p> | |
478 | |
479 <a name="Tcl-message-catalog"></a> | |
480 <a name="SEC359"></a> | |
481 <h4 class="subsubsection"> <a href="gettext_toc.html#TOC352">16.2.2.5 Tcl message catalog</a> </h4> | |
482 | |
483 <dl compact="compact"> | |
484 <dt> File extension</dt> | |
485 <dd><p><code>msg</code> | |
486 </p></dd> | |
487 </dl> | |
488 | |
489 <p>For more information, see the section <a href="gettext_15.html#SEC325">Tcl - Tk's scripting language</a> and the examples | |
490 <code>hello-tcl</code>, <code>hello-tcl-tk</code>. | |
491 </p> | |
492 | |
493 <a name="Qt-message-catalog"></a> | |
494 <a name="SEC360"></a> | |
495 <h4 class="subsubsection"> <a href="gettext_toc.html#TOC353">16.2.2.6 Qt message catalog</a> </h4> | |
496 | |
497 <dl compact="compact"> | |
498 <dt> File extension</dt> | |
499 <dd><p><code>qm</code> | |
500 </p></dd> | |
501 </dl> | |
502 | |
503 <p>For more information, see the examples <code>hello-c++-qt</code> and | |
504 <code>hello-c++-kde</code>. | |
505 </p> | |
506 | |
507 <a name="Desktop-Entry"></a> | |
508 <a name="SEC361"></a> | |
509 <h3 class="subsection"> <a href="gettext_toc.html#TOC354">16.2.3 Desktop Entry files</a> </h3> | |
510 | |
511 <p>The programmer produces a desktop entry file template with only the | |
512 English strings. These strings get included in the POT file, by way of | |
513 <code>xgettext</code> (usually by listing the template in <code>po/POTFILES.in</code>). | |
514 The translators produce PO files, one for each language. Finally, an | |
515 <code>msgfmt --desktop</code> invocation collects all the translations in the | |
516 desktop entry file. | |
517 </p> | |
518 <p>For more information, see the example <code>hello-c-gnome3</code>. | |
519 </p> | |
520 | |
521 | |
522 <a name="Icons"></a> | |
523 <a name="SEC362"></a> | |
524 <h4 class="subsubsection"> <a href="gettext_toc.html#TOC355">16.2.3.1 How to handle icons in Desktop Entry files</a> </h4> | |
525 | |
526 <p>Icons are generally locale dependent, for the following reasons: | |
527 </p> | |
528 <ul> | |
529 <li> | |
530 Icons may contain signs that are considered rude in some cultures. For | |
531 example, the high-five sign, in some cultures, is perceived as an | |
532 unfriendly “stop” sign. | |
533 </li><li> | |
534 Icons may contain metaphors that are culture specific. For example, a | |
535 mailbox in the U.S. looks different than mailboxes all around the world. | |
536 </li><li> | |
537 Icons may need to be mirrored for right-to-left locales. | |
538 </li><li> | |
539 Icons may contain text strings (a bad practice, but anyway). | |
540 </li></ul> | |
541 | |
542 <p>However, icons are not covered by GNU gettext localization, because | |
543 </p><ul> | |
544 <li> | |
545 Icons cannot be easily embedded in PO files, | |
546 </li><li> | |
547 The need to localize an icon is rare, and the ability to do so in a PO | |
548 file would introduce translator mistakes. | |
549 </li></ul> | |
550 | |
551 <p>Desktop Entry files may contain an ‘<samp>Icon</samp>’ property, and this | |
552 property is localizable. If a translator wishes to localize an icon, | |
553 she should do so by bypassing the normal workflow with PO files: | |
554 </p><ol> | |
555 <li> | |
556 The translator contacts the package developers directly, sending them | |
557 the icon appropriate for her locale, with a request to change the | |
558 template file. | |
559 </li><li> | |
560 The package developers add the icon file to their repository, and a | |
561 line | |
562 <table><tr><td> </td><td><pre class="smallexample">Icon[<var>locale</var>]=<var>icon_file_name</var> | |
563 </pre></td></tr></table> | |
564 <p>to the template file. | |
565 </p></li></ol> | |
566 <p>This line remains in place when this template file is merged with the | |
567 translators' PO files, through <code>msgfmt</code>. | |
568 </p> | |
569 | |
570 <a name="XML"></a> | |
571 <a name="SEC363"></a> | |
572 <h3 class="subsection"> <a href="gettext_toc.html#TOC356">16.2.4 XML files</a> </h3> | |
573 | |
574 <p>See the section <a href="#SEC347">Preparing Rules for XML Internationalization</a> and | |
575 <a href="gettext_10.html#SEC174">Invoking the <code>msgfmt</code> Program</a>, subsection “XML mode operations”. | |
576 </p> | |
577 | |
578 <table cellpadding="1" cellspacing="1" border="0"> | |
579 <tr><td valign="middle" align="left">[<a href="#SEC340" title="Beginning of this chapter or previous chapter"> << </a>]</td> | |
580 <td valign="middle" align="left">[<a href="gettext_17.html#SEC364" title="Next chapter"> >> </a>]</td> | |
581 <td valign="middle" align="left"> </td> | |
582 <td valign="middle" align="left"> </td> | |
583 <td valign="middle" align="left"> </td> | |
584 <td valign="middle" align="left"> </td> | |
585 <td valign="middle" align="left"> </td> | |
586 <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> | |
587 <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td> | |
588 <td valign="middle" align="left">[<a href="gettext_21.html#SEC389" title="Index">Index</a>]</td> | |
589 <td valign="middle" align="left">[<a href="gettext_abt.html#SEC_About" title="About (help)"> ? </a>]</td> | |
590 </tr></table> | |
591 <p> | |
592 <font size="-1"> | |
593 This document was generated by <em>Bruno Haible</em> on <em>February, 21 2024</em> using <a href="https://www.nongnu.org/texi2html/"><em>texi2html 1.78a</em></a>. | |
594 </font> | |
595 <br> | |
596 | |
597 </p> | |
598 </body> | |
599 </html> |