| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd"> |
| <html> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <head> |
| <title>GNU gettext utilities: 16. Other Data Formats</title> |
|
|
| <meta name="description" content="GNU gettext utilities: 16. Other Data Formats"> |
| <meta name="keywords" content="GNU gettext utilities: 16. Other Data Formats"> |
| <meta name="resource-type" content="document"> |
| <meta name="distribution" content="global"> |
| <meta name="Generator" content="texi2html 1.78a"> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| <style type="text/css"> |
| <!-- |
| a.summary-letter {text-decoration: none} |
| pre.display {font-family: serif} |
| pre.format {font-family: serif} |
| pre.menu-comment {font-family: serif} |
| pre.menu-preformatted {font-family: serif} |
| pre.smalldisplay {font-family: serif; font-size: smaller} |
| pre.smallexample {font-size: smaller} |
| pre.smallformat {font-family: serif; font-size: smaller} |
| pre.smalllisp {font-size: smaller} |
| span.roman {font-family:serif; font-weight:normal;} |
| span.sansserif {font-family:sans-serif; font-weight:normal;} |
| ul.toc {list-style: none} |
| --> |
| </style> |
|
|
|
|
| </head> |
|
|
| <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> |
|
|
| <table cellpadding="1" cellspacing="1" border="0"> |
| <tr><td valign="middle" align="left">[<a href="gettext_15.html#SEC271" title="Beginning of this chapter or previous chapter"> << </a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_17.html#SEC385" title="Next chapter"> >> </a>]</td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_21.html#SEC410" title="Index">Index</a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_abt.html#SEC_About" title="About (help)"> ? </a>]</td> |
| </tr></table> |
|
|
| <hr size="2"> |
| <a name="Data-Formats"></a> |
| <a name="SEC359"></a> |
| <h1 class="chapter"> <a href="gettext_toc.html#TOC351">16. Other Data Formats</a> </h1> |
|
|
| <p>While the GNU gettext tools deal mainly with POT and PO files, they can |
| also manipulate a couple of other data formats. |
| </p> |
|
|
|
|
| <a name="Internationalizable-Data"></a> |
| <a name="SEC360"></a> |
| <h2 class="section"> <a href="gettext_toc.html#TOC352">16.1 Internationalizable Data Formats</a> </h2> |
|
|
| <p>Here is a list of other data formats which can be internationalized |
| using GNU gettext. |
| </p> |
|
|
|
|
| <a name="POT"></a> |
| <a name="SEC361"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC353">16.1.1 POT - Portable Object Template</a> </h3> |
|
|
| <dl compact="compact"> |
| <dt> RPMs</dt> |
| <dd><p>gettext |
| </p> |
| </dd> |
| <dt> Ubuntu packages</dt> |
| <dd><p>gettext |
| </p> |
| </dd> |
| <dt> File extension</dt> |
| <dd><p><code>pot</code>, <code>po</code> |
| </p> |
| </dd> |
| <dt> Extractor</dt> |
| <dd><p><code>xgettext</code> |
| </p></dd> |
| </dl> |
|
|
|
|
| <a name="RST"></a> |
| <a name="SEC362"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC354">16.1.2 Resource String Table</a> </h3> |
|
|
| <p>RST is the format of resource string table files of the Free Pascal compiler |
| versions older than 3.0.0. RSJ is the new format of resource string table |
| files, created by the Free Pascal compiler version 3.0.0 or newer. |
| </p> |
| <dl compact="compact"> |
| <dt> RPMs</dt> |
| <dd><p>fpk |
| </p> |
| </dd> |
| <dt> Ubuntu packages</dt> |
| <dd><p>fp-compiler |
| </p> |
| </dd> |
| <dt> File extension</dt> |
| <dd><p><code>rst</code>, <code>rsj</code> |
| </p> |
| </dd> |
| <dt> Extractor</dt> |
| <dd><p><code>xgettext</code>, <code>rstconv</code> |
| </p></dd> |
| </dl> |
|
|
|
|
| <a name="Glade"></a> |
| <a name="SEC363"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC355">16.1.3 Glade - GNOME user interface description</a> </h3> |
|
|
| <dl compact="compact"> |
| <dt> RPMs</dt> |
| <dd><p>glade, libglade, glade2, libglade2, intltool |
| </p> |
| </dd> |
| <dt> Ubuntu packages</dt> |
| <dd><p>glade, libglade2-dev, intltool |
| </p> |
| </dd> |
| <dt> File extension</dt> |
| <dd><p><code>glade</code>, <code>glade2</code>, <code>ui</code> |
| </p> |
| </dd> |
| <dt> Extractor</dt> |
| <dd><p><code>xgettext</code>, <code>libglade-xgettext</code>, <code>xml-i18n-extract</code>, <code>intltool-extract</code> |
| </p></dd> |
| </dl> |
|
|
|
|
| <a name="GSettings"></a> |
| <a name="SEC364"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC356">16.1.4 GSettings - GNOME user configuration schema</a> </h3> |
|
|
| <dl compact="compact"> |
| <dt> RPMs</dt> |
| <dd><p>glib2 |
| </p> |
| </dd> |
| <dt> Ubuntu packages</dt> |
| <dd><p>libglib2.0-dev |
| </p> |
| </dd> |
| <dt> File extension</dt> |
| <dd><p><code>gschema.xml</code> |
| </p> |
| </dd> |
| <dt> Extractor</dt> |
| <dd><p><code>xgettext</code>, <code>intltool-extract</code> |
| </p></dd> |
| </dl> |
|
|
|
|
| <a name="AppData"></a> |
| <a name="SEC365"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC357">16.1.5 AppData - freedesktop.org application description</a> </h3> |
|
|
| <p>This file format is specified in |
| <a href="https://www.freedesktop.org/software/appstream/docs/">https://www.freedesktop.org/software/appstream/docs/</a>. |
| </p> |
| <dl compact="compact"> |
| <dt> RPMs</dt> |
| <dd><p>appdata-tools, appstream, libappstream-glib, libappstream-glib-builder |
| </p> |
| </dd> |
| <dt> Ubuntu packages</dt> |
| <dd><p>appdata-tools, appstream, libappstream-glib-dev |
| </p> |
| </dd> |
| <dt> File extension</dt> |
| <dd><p><code>appdata.xml</code>, <code>metainfo.xml</code> |
| </p> |
| </dd> |
| <dt> Extractor</dt> |
| <dd><p><code>xgettext</code>, <code>intltool-extract</code>, <code>itstool</code> |
| </p></dd> |
| </dl> |
|
|
|
|
| <a name="Preparing-ITS-Rules"></a> |
| <a name="SEC366"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC358">16.1.6 Preparing Rules for XML Internationalization</a> </h3> |
|
|
|
|
|
|
|
|
| <a name="ITS-Rules"></a> |
| <a name="SEC367"></a> |
| <h4 class="subsubsection"> <a href="gettext_toc.html#TOC359">16.1.6.1 Specifying ITS Rules</a> </h4> |
|
|
| <p>Marking translatable strings in an XML file is done through a separate |
| "rule" file, making use of the Internationalization Tag Set standard |
| (ITS, <a href="https://www.w3.org/TR/its20/">https://www.w3.org/TR/its20/</a>). The currently supported ITS |
| data categories are: ‘<samp>Translate</samp>’, ‘<samp>Localization Note</samp>’, |
| ‘<samp>Elements Within Text</samp>’, and ‘<samp>Preserve Space</samp>’. In addition to |
| them, <code>xgettext</code> also recognizes the following extended data |
| categories: |
| </p> |
| <dl compact="compact"> |
| <dt> ‘<samp>Context</samp>’</dt> |
| <dd> |
| <p>This data category associates <code>msgctxt</code> to the extracted text. In |
| the global rule, the <code>contextRule</code> element contains the following: |
| </p> |
| <ul> |
| <li> |
| A required <code>selector</code> attribute. It contains an absolute selector |
| that selects the nodes to which this rule applies. |
|
|
| </li><li> |
| A required <code>contextPointer</code> attribute that contains a relative |
| selector pointing to a node that holds the <code>msgctxt</code> value. |
|
|
| </li><li> |
| An optional <code>textPointer</code> attribute that contains a relative |
| selector pointing to a node that holds the <code>msgid</code> value. |
| </li></ul> |
|
|
| </dd> |
| <dt> ‘<samp>Extended Preserve Space</samp>’</dt> |
| <dd> |
| <p>This data category extends the standard ‘<samp>Preserve Space</samp>’ data |
| category with the additional values ‘<samp>trim</samp>’ and ‘<samp>paragraph</samp>’. |
| ‘<samp>trim</samp>’ means to remove the leading and trailing whitespaces of the |
| content, but not to normalize whitespaces in the middle. |
| ‘<samp>paragraph</samp>’ means to normalize the content but keep the paragraph |
| boundaries. In the global |
| rule, the <code>preserveSpaceRule</code> element contains the following: |
| </p> |
| <ul> |
| <li> |
| A required <code>selector</code> attribute. It contains an absolute selector |
| that selects the nodes to which this rule applies. |
|
|
| </li><li> |
| A required <code>space</code> attribute with the value <code>default</code>, |
| <code>preserve</code>, <code>trim</code>, or <code>paragraph</code>. |
| </li></ul> |
|
|
| </dd> |
| <dt> ‘<samp>Escape Special Characters</samp>’</dt> |
| <dd> |
| <p>This data category indicates whether the special XML characters |
| (<code><</code>, <code>></code>, <code>&</code>, <code>"</code>) are escaped with entity |
| references. In the global rule, the <code>escapeRule</code> element contains |
| the following: |
| </p> |
| <ul> |
| <li> |
| A required <code>selector</code> attribute. It contains an absolute selector |
| that selects the nodes to which this rule applies. |
|
|
| </li><li> |
| A required <code>escape</code> attribute with the value <code>yes</code> or <code>no</code>. |
|
|
| </li><li> |
| An optional <code>unescape-if</code> attribute with the value |
| <code>xml</code>, <code>xhtml</code>, <code>html</code>, or <code>no</code>. |
| </li></ul> |
|
|
| <p>The default values, <code>escape="no"</code> and <code>unescape-if="no"</code>, |
| should be good for most XML file types. |
| A rule with <code>escape="no"</code>, |
| that was necessary with GNU gettext versions before 0.23, |
| is now redundant. |
| </p> |
| <p>The <code>unescape-if</code> attribute is useful for XML file types |
| which present messages with embedded XML elements to the translator. |
| Such file types are for example DocBook or XHTML. |
| If <code>unescape-if="xml"</code> is specified and the translation |
| of a message looks like valid XML, the usual escaping of <code><</code>, |
| <code>></code>, and character references is omitted. |
| The resulting XML document then is likely what the translator intended. |
| However, if the translator did not merely copy the XML markup from the |
| message to the translation, but added or removed markup, |
| the resulting XML document may be invalid. |
| It is therefore useful if, after invoking <code>msgfmt</code>, you check |
| the resulting XML document against the appropriate XML schema or DTD. |
| </p> |
| <p>Similarly, if <code>unescape-if="xhtml"</code> is specified and the translation |
| looks like valid XHTML, the usual escaping is omitted. |
| And likewise for <code>unescape-if="html"</code>. |
| </p> |
| </dd> |
| </dl> |
|
|
| <p>All those extended data categories can only be expressed with global |
| rules, and the rule elements have to have the |
| <code>https://www.gnu.org/s/gettext/ns/its/extensions/1.0</code> namespace. |
| </p> |
| <p>Given the following XML document in a file ‘<tt>messages.xml</tt>’: |
| </p> |
| <table><tr><td> </td><td><pre class="example"><?xml version="1.0"?> |
| <messages> |
| <message> |
| <p>A translatable string</p> |
| </message> |
| <message> |
| <p translatable="no">A non-translatable string</p> |
| </message> |
| </messages> |
| </pre></td></tr></table> |
|
|
| <p>To extract the first text content ("A translatable string"), but not the |
| second ("A non-translatable string"), the following ITS rules can be used: |
| </p> |
| <table><tr><td> </td><td><pre class="example"><?xml version="1.0"?> |
| <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0"> |
| <its:translateRule selector="/messages" translate="no"/> |
| <its:translateRule selector="//message/p" translate="yes"/> |
|
|
| <!-- If 'p' has an attribute 'translatable' with the value 'no', then |
| the content is not translatable. --> |
| <its:translateRule selector="//message/p[@translatable = 'no']" |
| translate="no"/> |
| </its:rules> |
| </pre></td></tr></table> |
|
|
| <p>ITS rules files must have the ‘<tt>.its</tt>’ file extension and obey |
| the XML schema version 1.0 encoded by <code>its.xsd10</code> or |
| the XML schema version 1.1 encoded by <code>its.xsd11</code> |
| and its auxiliary schema <code>its-extensions.xsd</code>. |
| </p> |
|
|
| <a name="Locating-Rules"></a> |
| <a name="SEC368"></a> |
| <h4 class="subsubsection"> <a href="gettext_toc.html#TOC360">16.1.6.2 Specifying where to find the ITS Rules</a> </h4> |
|
|
| <p>‘<samp>xgettext</samp>’ needs another file called "locating rules" to associate |
| an ITS rule with an XML file. If the above ITS file is saved as |
| ‘<tt>messages.its</tt>’, the locating rules file would look like: |
| </p> |
| <table><tr><td> </td><td><pre class="example"><?xml version="1.0"?> |
| <locatingRules> |
| <locatingRule name="Messages" pattern="*.xml"> |
| <documentRule localName="messages" target="messages.its"/> |
| </locatingRule> |
| <locatingRule name="Messages" pattern="*.msg" target="messages.its"/> |
| </locatingRules> |
| </pre></td></tr></table> |
|
|
| <p>The <code>locatingRule</code> element must have a <code>pattern</code> attribute, |
| which denotes either a literal file name or a wildcard pattern of the |
| XML file<a name="DOCF7" href="gettext_fot.html#FOOT7">(7)</a>. The <code>locatingRule</code> element can have child |
| <code>documentRule</code> element, which adds checks on the content of the XML |
| file. |
| </p> |
| <p>The first rule matches any file with the ‘<tt>.xml</tt>’ file extension, but |
| it only applies to XML files whose root element is ‘<samp><messages></samp>’. |
| </p> |
| <p>The second rule indicates that the same ITS rules file are also |
| applicable to any file with the ‘<tt>.msg</tt>’ file extension. The |
| optional <code>name</code> attribute of <code>locatingRule</code> allows to choose |
| rules by name, typically with <code>xgettext</code>'s <code>-L</code> option. |
| </p> |
| <p>The associated ITS rules file is indicated by the <code>target</code> attribute |
| of <code>locatingRule</code> or <code>documentRule</code>. If it is specified in a |
| <code>documentRule</code> element, the parent <code>locatingRule</code> shouldn't |
| have the <code>target</code> attribute. |
| </p> |
| <p>Locating rules files must have the ‘<tt>.loc</tt>’ file extension and obey |
| the XML schema version 1.0 encoded by <code>locating-rules.xsd10</code> or |
| the XML schema version 1.1 encoded by <code>locating-rules.xsd11</code>. |
| Both ITS rules files and locating rules files must be installed in the |
| ‘<tt>$prefix/share/gettext/its</tt>’ directory. Once those files are |
| properly installed, <code>xgettext</code> can extract translatable strings |
| from the matching XML files. |
| </p> |
|
|
| <a name="SEC369"></a> |
| <h4 class="subsubsection"> <a href="gettext_toc.html#TOC361">16.1.6.3 Two Use-cases of Translated Strings in XML</a> </h4> |
|
|
| <p>After strings have been extracted from an XML file to a POT file |
| through <code>xgettext</code> |
| and the translator has produced a PO file with translations, |
| it can be used in two ways: |
| </p> |
| <ul> |
| <li> |
| The PO file (or the MO file generated from it) can be directly consumed |
| by a program. |
|
|
| </li><li> |
| Or the translated strings can be merged back to the original XML document. |
| To do this use the <code>msgfmt</code> program with the option <code>--xml</code>. |
| See section <a href="gettext_10.html#SEC189">Invoking the <code>msgfmt</code> Program</a>, for more details about how one calls |
| the ‘<samp>msgfmt</samp>’ program. |
|
|
| <p>During this merge from a PO file into an XML file, it may happen that |
| more escaping of special characters for XML is needed |
| than what <code>msgfmt</code> does by default. |
| In this case, you can enforce more escaping |
| either throuch an <code><escapeRule></code> ITS rule, |
| or through an attribute <code>gt:escape="yes"</code> on the particular XML element. |
| </p> |
| </li></ul> |
|
|
|
|
|
|
| <a name="Localized-Data"></a> |
| <a name="SEC370"></a> |
| <h2 class="section"> <a href="gettext_toc.html#TOC362">16.2 Localized Data Formats</a> </h2> |
|
|
| <p>Here is a list of file formats that contain localized data and that the |
| GNU gettext tools can manipulate. |
| </p> |
|
|
|
|
| <a name="Editable-Message-Catalogs"></a> |
| <a name="SEC371"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC363">16.2.1 Editable Message Catalogs</a> </h3> |
|
|
| <p>These file formats can be used with all of the <code>msg*</code> tools and with |
| the <code>xgettext</code> program. |
| </p> |
| <p>If you just want to convert among these formats, you can use the |
| <code>msgcat</code> program (with the appropriate option) or the <code>xgettext</code> |
| program. |
| </p> |
|
|
|
|
| <a name="PO"></a> |
| <a name="SEC372"></a> |
| <h4 class="subsubsection"> <a href="gettext_toc.html#TOC364">16.2.1.1 PO - Portable Object</a> </h4> |
|
|
| <dl compact="compact"> |
| <dt> File extension</dt> |
| <dd><p><code>po</code> |
| </p></dd> |
| </dl> |
|
|
|
|
| <a name="Java-_002eproperties"></a> |
| <a name="SEC373"></a> |
| <h4 class="subsubsection"> <a href="gettext_toc.html#TOC365">16.2.1.2 Java .properties</a> </h4> |
|
|
| <dl compact="compact"> |
| <dt> File extension</dt> |
| <dd><p><code>properties</code> |
| </p></dd> |
| </dl> |
|
|
|
|
| <a name="GNUstep-_002estrings"></a> |
| <a name="SEC374"></a> |
| <h4 class="subsubsection"> <a href="gettext_toc.html#TOC366">16.2.1.3 NeXTstep/GNUstep .strings</a> </h4> |
|
|
| <dl compact="compact"> |
| <dt> File extension</dt> |
| <dd><p><code>strings</code> |
| </p></dd> |
| </dl> |
|
|
|
|
| <a name="Compiled-Message-Catalogs"></a> |
| <a name="SEC375"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC367">16.2.2 Compiled Message Catalogs</a> </h3> |
|
|
| <p>These file formats can be created through <code>msgfmt</code> and converted back |
| to PO format through <code>msgunfmt</code>. |
| </p> |
|
|
|
|
| <a name="MO"></a> |
| <a name="SEC376"></a> |
| <h4 class="subsubsection"> <a href="gettext_toc.html#TOC368">16.2.2.1 MO - Machine Object</a> </h4> |
|
|
| <dl compact="compact"> |
| <dt> File extension</dt> |
| <dd><p><code>mo</code> |
| </p></dd> |
| </dl> |
|
|
| <p>See section <a href="gettext_10.html#SEC211">The Format of GNU MO Files</a> for details. |
| </p> |
|
|
| <a name="Java-ResourceBundle"></a> |
| <a name="SEC377"></a> |
| <h4 class="subsubsection"> <a href="gettext_toc.html#TOC369">16.2.2.2 Java ResourceBundle</a> </h4> |
|
|
| <dl compact="compact"> |
| <dt> File extension</dt> |
| <dd><p><code>class</code> |
| </p></dd> |
| </dl> |
|
|
| <p>For more information, see the section <a href="gettext_15.html#SEC312">Java</a> and the examples |
| <code>hello-java</code>, <code>hello-java-awt</code>, <code>hello-java-swing</code>. |
| </p> |
|
|
| <a name="C_0023-Satellite-Assembly"></a> |
| <a name="SEC378"></a> |
| <h4 class="subsubsection"> <a href="gettext_toc.html#TOC370">16.2.2.3 C# Satellite Assembly</a> </h4> |
|
|
| <dl compact="compact"> |
| <dt> File extension</dt> |
| <dd><p><code>dll</code> |
| </p></dd> |
| </dl> |
|
|
| <p>For more information, see the section <a href="gettext_15.html#SEC313">C#</a>. |
| </p> |
|
|
| <a name="C_0023-Resource"></a> |
| <a name="SEC379"></a> |
| <h4 class="subsubsection"> <a href="gettext_toc.html#TOC371">16.2.2.4 C# Resource</a> </h4> |
|
|
| <dl compact="compact"> |
| <dt> File extension</dt> |
| <dd><p><code>resources</code> |
| </p></dd> |
| </dl> |
|
|
| <p>For more information, see the section <a href="gettext_15.html#SEC313">C#</a>. |
| </p> |
|
|
| <a name="Tcl-message-catalog"></a> |
| <a name="SEC380"></a> |
| <h4 class="subsubsection"> <a href="gettext_toc.html#TOC372">16.2.2.5 Tcl message catalog</a> </h4> |
|
|
| <dl compact="compact"> |
| <dt> File extension</dt> |
| <dd><p><code>msg</code> |
| </p></dd> |
| </dl> |
|
|
| <p>For more information, see the section <a href="gettext_15.html#SEC344">Tcl - Tk's scripting language</a> and the examples |
| <code>hello-tcl</code>, <code>hello-tcl-tk</code>. |
| </p> |
|
|
| <a name="Qt-message-catalog"></a> |
| <a name="SEC381"></a> |
| <h4 class="subsubsection"> <a href="gettext_toc.html#TOC373">16.2.2.6 Qt message catalog</a> </h4> |
|
|
| <dl compact="compact"> |
| <dt> File extension</dt> |
| <dd><p><code>qm</code> |
| </p></dd> |
| </dl> |
|
|
| <p>For more information, see the examples <code>hello-c++-qt</code> and |
| <code>hello-c++-kde</code>. |
| </p> |
|
|
| <a name="Desktop-Entry"></a> |
| <a name="SEC382"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC374">16.2.3 Desktop Entry files</a> </h3> |
|
|
| <p>The programmer produces a desktop entry file template with only the |
| English strings. These strings get included in the POT file, by way of |
| <code>xgettext</code> (usually by listing the template in <code>po/POTFILES.in</code>). |
| The translators produce PO files, one for each language. Finally, an |
| <code>msgfmt --desktop</code> invocation collects all the translations in the |
| desktop entry file. |
| </p> |
| <p>For more information, see the example <code>hello-c-gnome3</code>. |
| </p> |
|
|
|
|
| <a name="Icons"></a> |
| <a name="SEC383"></a> |
| <h4 class="subsubsection"> <a href="gettext_toc.html#TOC375">16.2.3.1 How to handle icons in Desktop Entry files</a> </h4> |
|
|
| <p>Icons are generally locale dependent, for the following reasons: |
| </p> |
| <ul> |
| <li> |
| Icons may contain signs that are considered rude in some cultures. For |
| example, the high-five sign, in some cultures, is perceived as an |
| unfriendly “stop” sign. |
| </li><li> |
| Icons may contain metaphors that are culture specific. For example, a |
| mailbox in the U.S. looks different than mailboxes all around the world. |
| </li><li> |
| Icons may need to be mirrored for right-to-left locales. |
| </li><li> |
| Icons may contain text strings (a bad practice, but anyway). |
| </li></ul> |
|
|
| <p>However, icons are not covered by GNU gettext localization, because |
| </p><ul> |
| <li> |
| Icons cannot be easily embedded in PO files, |
| </li><li> |
| The need to localize an icon is rare, and the ability to do so in a PO |
| file would introduce translator mistakes. |
| </li></ul> |
|
|
| <p>Desktop Entry files may contain an ‘<samp>Icon</samp>’ property, and this |
| property is localizable. If a translator wishes to localize an icon, |
| she should do so by bypassing the normal workflow with PO files: |
| </p><ol> |
| <li> |
| The translator contacts the package developers directly, sending them |
| the icon appropriate for her locale, with a request to change the |
| template file. |
| </li><li> |
| The package developers add the icon file to their repository, and a |
| line |
| <table><tr><td> </td><td><pre class="smallexample">Icon[<var>locale</var>]=<var>icon_file_name</var> |
| </pre></td></tr></table> |
| <p>to the template file. |
| </p></li></ol> |
| <p>This line remains in place when this template file is merged with the |
| translators' PO files, through <code>msgfmt</code>. |
| </p> |
|
|
| <a name="XML"></a> |
| <a name="SEC384"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC376">16.2.4 XML files</a> </h3> |
|
|
| <p>See the section <a href="#SEC366">Preparing Rules for XML Internationalization</a> and |
| <a href="gettext_10.html#SEC189">Invoking the <code>msgfmt</code> Program</a>, subsection “XML mode operations”. |
| </p> |
|
|
| <table cellpadding="1" cellspacing="1" border="0"> |
| <tr><td valign="middle" align="left">[<a href="#SEC359" title="Beginning of this chapter or previous chapter"> << </a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_17.html#SEC385" title="Next chapter"> >> </a>]</td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_21.html#SEC410" title="Index">Index</a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_abt.html#SEC_About" title="About (help)"> ? </a>]</td> |
| </tr></table> |
| <p> |
| <font size="-1"> |
| This document was generated by <em>Bruno Haible</em> on <em>July, 2 2025</em> using <a href="https://www.nongnu.org/texi2html/"><em>texi2html 1.78a</em></a>. |
| </font> |
| <br> |
|
|
| </p> |
| </body> |
| </html> |
|
|