annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/share/doc/gettext/gettext_6.html @ 68:5028fdace37b

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 16:23:26 -0400
parents
children
rev   line source
jpayne@68 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
jpayne@68 2 <html>
jpayne@68 3 <!-- Created on February, 21 2024 by texi2html 1.78a -->
jpayne@68 4 <!--
jpayne@68 5 Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
jpayne@68 6 Karl Berry <karl@freefriends.org>
jpayne@68 7 Olaf Bachmann <obachman@mathematik.uni-kl.de>
jpayne@68 8 and many others.
jpayne@68 9 Maintained by: Many creative people.
jpayne@68 10 Send bugs and suggestions to <texi2html-bug@nongnu.org>
jpayne@68 11
jpayne@68 12 -->
jpayne@68 13 <head>
jpayne@68 14 <title>GNU gettext utilities: 6. Creating a New PO File</title>
jpayne@68 15
jpayne@68 16 <meta name="description" content="GNU gettext utilities: 6. Creating a New PO File">
jpayne@68 17 <meta name="keywords" content="GNU gettext utilities: 6. Creating a New PO File">
jpayne@68 18 <meta name="resource-type" content="document">
jpayne@68 19 <meta name="distribution" content="global">
jpayne@68 20 <meta name="Generator" content="texi2html 1.78a">
jpayne@68 21 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
jpayne@68 22 <style type="text/css">
jpayne@68 23 <!--
jpayne@68 24 a.summary-letter {text-decoration: none}
jpayne@68 25 pre.display {font-family: serif}
jpayne@68 26 pre.format {font-family: serif}
jpayne@68 27 pre.menu-comment {font-family: serif}
jpayne@68 28 pre.menu-preformatted {font-family: serif}
jpayne@68 29 pre.smalldisplay {font-family: serif; font-size: smaller}
jpayne@68 30 pre.smallexample {font-size: smaller}
jpayne@68 31 pre.smallformat {font-family: serif; font-size: smaller}
jpayne@68 32 pre.smalllisp {font-size: smaller}
jpayne@68 33 span.roman {font-family:serif; font-weight:normal;}
jpayne@68 34 span.sansserif {font-family:sans-serif; font-weight:normal;}
jpayne@68 35 ul.toc {list-style: none}
jpayne@68 36 -->
jpayne@68 37 </style>
jpayne@68 38
jpayne@68 39
jpayne@68 40 </head>
jpayne@68 41
jpayne@68 42 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
jpayne@68 43
jpayne@68 44 <table cellpadding="1" cellspacing="1" border="0">
jpayne@68 45 <tr><td valign="middle" align="left">[<a href="gettext_5.html#SEC35" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
jpayne@68 46 <td valign="middle" align="left">[<a href="gettext_7.html#SEC53" title="Next chapter"> &gt;&gt; </a>]</td>
jpayne@68 47 <td valign="middle" align="left"> &nbsp; </td>
jpayne@68 48 <td valign="middle" align="left"> &nbsp; </td>
jpayne@68 49 <td valign="middle" align="left"> &nbsp; </td>
jpayne@68 50 <td valign="middle" align="left"> &nbsp; </td>
jpayne@68 51 <td valign="middle" align="left"> &nbsp; </td>
jpayne@68 52 <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
jpayne@68 53 <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
jpayne@68 54 <td valign="middle" align="left">[<a href="gettext_21.html#SEC389" title="Index">Index</a>]</td>
jpayne@68 55 <td valign="middle" align="left">[<a href="gettext_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
jpayne@68 56 </tr></table>
jpayne@68 57
jpayne@68 58 <hr size="2">
jpayne@68 59 <a name="Creating"></a>
jpayne@68 60 <a name="SEC45"></a>
jpayne@68 61 <h1 class="chapter"> <a href="gettext_toc.html#TOC38">6. Creating a New PO File</a> </h1>
jpayne@68 62
jpayne@68 63 <p>When starting a new translation, the translator creates a file called
jpayne@68 64 &lsquo;<tt><var>LANG</var>.po</tt>&rsquo;, as a copy of the &lsquo;<tt><var>package</var>.pot</tt>&rsquo; template
jpayne@68 65 file with modifications in the initial comments (at the beginning of the file)
jpayne@68 66 and in the header entry (the first entry, near the beginning of the file).
jpayne@68 67 </p>
jpayne@68 68 <p>The easiest way to do so is by use of the &lsquo;<samp>msginit</samp>&rsquo; program.
jpayne@68 69 For example:
jpayne@68 70 </p>
jpayne@68 71 <table><tr><td>&nbsp;</td><td><pre class="example">$ cd <var>PACKAGE</var>-<var>VERSION</var>
jpayne@68 72 $ cd po
jpayne@68 73 $ msginit
jpayne@68 74 </pre></td></tr></table>
jpayne@68 75
jpayne@68 76 <p>The alternative way is to do the copy and modifications by hand.
jpayne@68 77 To do so, the translator copies &lsquo;<tt><var>package</var>.pot</tt>&rsquo; to
jpayne@68 78 &lsquo;<tt><var>LANG</var>.po</tt>&rsquo;. Then she modifies the initial comments and
jpayne@68 79 the header entry of this file.
jpayne@68 80 </p>
jpayne@68 81
jpayne@68 82
jpayne@68 83 <a name="msginit-Invocation"></a>
jpayne@68 84 <a name="SEC46"></a>
jpayne@68 85 <h2 class="section"> <a href="gettext_toc.html#TOC39">6.1 Invoking the <code>msginit</code> Program</a> </h2>
jpayne@68 86
jpayne@68 87
jpayne@68 88 <table><tr><td>&nbsp;</td><td><pre class="example">msginit [<var>option</var>]
jpayne@68 89 </pre></td></tr></table>
jpayne@68 90
jpayne@68 91 <a name="IDX227"></a>
jpayne@68 92 <a name="IDX228"></a>
jpayne@68 93 <p>The <code>msginit</code> program creates a new PO file, initializing the meta
jpayne@68 94 information with values from the user's environment.
jpayne@68 95 </p>
jpayne@68 96 <p>Here are more details. The following header fields of a PO file are
jpayne@68 97 automatically filled, when possible.
jpayne@68 98 </p>
jpayne@68 99 <dl compact="compact">
jpayne@68 100 <dt> &lsquo;<samp>Project-Id-Version</samp>&rsquo;</dt>
jpayne@68 101 <dd><p>The value is guessed from the <code>configure</code> script or any other files
jpayne@68 102 in the current directory.
jpayne@68 103 </p>
jpayne@68 104 </dd>
jpayne@68 105 <dt> &lsquo;<samp>PO-Revision-Date</samp>&rsquo;</dt>
jpayne@68 106 <dd><p>The value is taken from the <code>PO-Creation-Data</code> in the input POT
jpayne@68 107 file, or the current date is used.
jpayne@68 108 </p>
jpayne@68 109 </dd>
jpayne@68 110 <dt> &lsquo;<samp>Last-Translator</samp>&rsquo;</dt>
jpayne@68 111 <dd><p>The value is taken from user's password file entry and the mailer
jpayne@68 112 configuration files.
jpayne@68 113 </p>
jpayne@68 114 </dd>
jpayne@68 115 <dt> &lsquo;<samp>Language-Team, Language</samp>&rsquo;</dt>
jpayne@68 116 <dd><p>These values are set according to the current locale and the predefined
jpayne@68 117 list of translation teams.
jpayne@68 118 </p>
jpayne@68 119 </dd>
jpayne@68 120 <dt> &lsquo;<samp>MIME-Version, Content-Type, Content-Transfer-Encoding</samp>&rsquo;</dt>
jpayne@68 121 <dd><p>These values are set according to the content of the POT file and the
jpayne@68 122 current locale. If the POT file contains charset=UTF-8, it means that
jpayne@68 123 the POT file contains non-ASCII characters, and we keep the UTF-8
jpayne@68 124 encoding. Otherwise, when the POT file is plain ASCII, we use the
jpayne@68 125 locale's encoding.
jpayne@68 126 </p>
jpayne@68 127 </dd>
jpayne@68 128 <dt> &lsquo;<samp>Plural-Forms</samp>&rsquo;</dt>
jpayne@68 129 <dd><p>The value is first looked up from the embedded table.
jpayne@68 130 </p>
jpayne@68 131 <p>As an experimental feature, you can instruct <code>msginit</code> to use the
jpayne@68 132 information from Unicode CLDR, by setting the <code>GETTEXTCLDRDIR</code>
jpayne@68 133 environment variable. The program will look for a file named
jpayne@68 134 <code>common/supplemental/plurals.xml</code> under that directory. You can
jpayne@68 135 get the CLDR data from <a href="http://cldr.unicode.org/">http://cldr.unicode.org/</a>.
jpayne@68 136 </p>
jpayne@68 137 </dd>
jpayne@68 138 </dl>
jpayne@68 139
jpayne@68 140
jpayne@68 141 <a name="SEC47"></a>
jpayne@68 142 <h3 class="subsection"> <a href="gettext_toc.html#TOC40">6.1.1 Input file location</a> </h3>
jpayne@68 143
jpayne@68 144 <dl compact="compact">
jpayne@68 145 <dt> &lsquo;<samp>-i <var>inputfile</var></samp>&rsquo;</dt>
jpayne@68 146 <dt> &lsquo;<samp>--input=<var>inputfile</var></samp>&rsquo;</dt>
jpayne@68 147 <dd><a name="IDX229"></a>
jpayne@68 148 <a name="IDX230"></a>
jpayne@68 149 <p>Input POT file.
jpayne@68 150 </p>
jpayne@68 151 </dd>
jpayne@68 152 </dl>
jpayne@68 153
jpayne@68 154 <p>If no <var>inputfile</var> is given, the current directory is searched for the
jpayne@68 155 POT file. If it is &lsquo;<samp>-</samp>&rsquo;, standard input is read.
jpayne@68 156 </p>
jpayne@68 157
jpayne@68 158 <a name="SEC48"></a>
jpayne@68 159 <h3 class="subsection"> <a href="gettext_toc.html#TOC41">6.1.2 Output file location</a> </h3>
jpayne@68 160
jpayne@68 161 <dl compact="compact">
jpayne@68 162 <dt> &lsquo;<samp>-o <var>file</var></samp>&rsquo;</dt>
jpayne@68 163 <dt> &lsquo;<samp>--output-file=<var>file</var></samp>&rsquo;</dt>
jpayne@68 164 <dd><a name="IDX231"></a>
jpayne@68 165 <a name="IDX232"></a>
jpayne@68 166 <p>Write output to specified PO file.
jpayne@68 167 </p>
jpayne@68 168 </dd>
jpayne@68 169 </dl>
jpayne@68 170
jpayne@68 171 <p>If no output file is given, it depends on the &lsquo;<samp>--locale</samp>&rsquo; option or the
jpayne@68 172 user's locale setting. If it is &lsquo;<samp>-</samp>&rsquo;, the results are written to
jpayne@68 173 standard output.
jpayne@68 174 </p>
jpayne@68 175
jpayne@68 176 <a name="SEC49"></a>
jpayne@68 177 <h3 class="subsection"> <a href="gettext_toc.html#TOC42">6.1.3 Input file syntax</a> </h3>
jpayne@68 178
jpayne@68 179 <dl compact="compact">
jpayne@68 180 <dt> &lsquo;<samp>-P</samp>&rsquo;</dt>
jpayne@68 181 <dt> &lsquo;<samp>--properties-input</samp>&rsquo;</dt>
jpayne@68 182 <dd><a name="IDX233"></a>
jpayne@68 183 <a name="IDX234"></a>
jpayne@68 184 <p>Assume the input file is a Java ResourceBundle in Java <code>.properties</code>
jpayne@68 185 syntax, not in PO file syntax.
jpayne@68 186 </p>
jpayne@68 187 </dd>
jpayne@68 188 <dt> &lsquo;<samp>--stringtable-input</samp>&rsquo;</dt>
jpayne@68 189 <dd><a name="IDX235"></a>
jpayne@68 190 <p>Assume the input file is a NeXTstep/GNUstep localized resource file in
jpayne@68 191 <code>.strings</code> syntax, not in PO file syntax.
jpayne@68 192 </p>
jpayne@68 193 </dd>
jpayne@68 194 </dl>
jpayne@68 195
jpayne@68 196
jpayne@68 197 <a name="SEC50"></a>
jpayne@68 198 <h3 class="subsection"> <a href="gettext_toc.html#TOC43">6.1.4 Output details</a> </h3>
jpayne@68 199
jpayne@68 200 <dl compact="compact">
jpayne@68 201 <dt> &lsquo;<samp>-l <var>ll_CC[.encoding]</var></samp>&rsquo;</dt>
jpayne@68 202 <dt> &lsquo;<samp>--locale=<var>ll_CC[.encoding]</var></samp>&rsquo;</dt>
jpayne@68 203 <dd><a name="IDX236"></a>
jpayne@68 204 <a name="IDX237"></a>
jpayne@68 205 <p>Set target locale. <var>ll</var> should be a language code, and <var>CC</var> should
jpayne@68 206 be a country code. The optional part <var>.encoding</var> specifies the encoding
jpayne@68 207 of the locale; most often this part is <code>.UTF-8</code>.
jpayne@68 208 The command &lsquo;<samp>locale -a</samp>&rsquo; can be used to output a list
jpayne@68 209 of all installed locales. The default is the user's locale setting.
jpayne@68 210 </p>
jpayne@68 211 </dd>
jpayne@68 212 <dt> &lsquo;<samp>--no-translator</samp>&rsquo;</dt>
jpayne@68 213 <dd><a name="IDX238"></a>
jpayne@68 214 <p>Declares that the PO file will not have a human translator and is instead
jpayne@68 215 automatically generated.
jpayne@68 216 </p>
jpayne@68 217 </dd>
jpayne@68 218 <dt> &lsquo;<samp>--color</samp>&rsquo;</dt>
jpayne@68 219 <dt> &lsquo;<samp>--color=<var>when</var></samp>&rsquo;</dt>
jpayne@68 220 <dd><a name="IDX239"></a>
jpayne@68 221 <p>Specify whether or when to use colors and other text attributes.
jpayne@68 222 See <a href="gettext_9.html#SEC158">The <code>--color</code> option</a> for details.
jpayne@68 223 </p>
jpayne@68 224 </dd>
jpayne@68 225 <dt> &lsquo;<samp>--style=<var>style_file</var></samp>&rsquo;</dt>
jpayne@68 226 <dd><a name="IDX240"></a>
jpayne@68 227 <p>Specify the CSS style rule file to use for <code>--color</code>.
jpayne@68 228 See <a href="gettext_9.html#SEC160">The <code>--style</code> option</a> for details.
jpayne@68 229 </p>
jpayne@68 230 </dd>
jpayne@68 231 <dt> &lsquo;<samp>-p</samp>&rsquo;</dt>
jpayne@68 232 <dt> &lsquo;<samp>--properties-output</samp>&rsquo;</dt>
jpayne@68 233 <dd><a name="IDX241"></a>
jpayne@68 234 <a name="IDX242"></a>
jpayne@68 235 <p>Write out a Java ResourceBundle in Java <code>.properties</code> syntax. Note
jpayne@68 236 that this file format doesn't support plural forms and silently drops
jpayne@68 237 obsolete messages.
jpayne@68 238 </p>
jpayne@68 239 </dd>
jpayne@68 240 <dt> &lsquo;<samp>--stringtable-output</samp>&rsquo;</dt>
jpayne@68 241 <dd><a name="IDX243"></a>
jpayne@68 242 <p>Write out a NeXTstep/GNUstep localized resource file in <code>.strings</code> syntax.
jpayne@68 243 Note that this file format doesn't support plural forms.
jpayne@68 244 </p>
jpayne@68 245 </dd>
jpayne@68 246 <dt> &lsquo;<samp>-w <var>number</var></samp>&rsquo;</dt>
jpayne@68 247 <dt> &lsquo;<samp>--width=<var>number</var></samp>&rsquo;</dt>
jpayne@68 248 <dd><a name="IDX244"></a>
jpayne@68 249 <a name="IDX245"></a>
jpayne@68 250 <p>Set the output page width. Long strings in the output files will be
jpayne@68 251 split across multiple lines in order to ensure that each line's width
jpayne@68 252 (= number of screen columns) is less or equal to the given <var>number</var>.
jpayne@68 253 </p>
jpayne@68 254 </dd>
jpayne@68 255 <dt> &lsquo;<samp>--no-wrap</samp>&rsquo;</dt>
jpayne@68 256 <dd><a name="IDX246"></a>
jpayne@68 257 <p>Do not break long message lines. Message lines whose width exceeds the
jpayne@68 258 output page width will not be split into several lines. Only file reference
jpayne@68 259 lines which are wider than the output page width will be split.
jpayne@68 260 </p>
jpayne@68 261 </dd>
jpayne@68 262 </dl>
jpayne@68 263
jpayne@68 264
jpayne@68 265 <a name="SEC51"></a>
jpayne@68 266 <h3 class="subsection"> <a href="gettext_toc.html#TOC44">6.1.5 Informative output</a> </h3>
jpayne@68 267
jpayne@68 268 <dl compact="compact">
jpayne@68 269 <dt> &lsquo;<samp>-h</samp>&rsquo;</dt>
jpayne@68 270 <dt> &lsquo;<samp>--help</samp>&rsquo;</dt>
jpayne@68 271 <dd><a name="IDX247"></a>
jpayne@68 272 <a name="IDX248"></a>
jpayne@68 273 <p>Display this help and exit.
jpayne@68 274 </p>
jpayne@68 275 </dd>
jpayne@68 276 <dt> &lsquo;<samp>-V</samp>&rsquo;</dt>
jpayne@68 277 <dt> &lsquo;<samp>--version</samp>&rsquo;</dt>
jpayne@68 278 <dd><a name="IDX249"></a>
jpayne@68 279 <a name="IDX250"></a>
jpayne@68 280 <p>Output version information and exit.
jpayne@68 281 </p>
jpayne@68 282 </dd>
jpayne@68 283 </dl>
jpayne@68 284
jpayne@68 285
jpayne@68 286 <a name="Header-Entry"></a>
jpayne@68 287 <a name="SEC52"></a>
jpayne@68 288 <h2 class="section"> <a href="gettext_toc.html#TOC45">6.2 Filling in the Header Entry</a> </h2>
jpayne@68 289
jpayne@68 290 <p>The initial comments &quot;SOME DESCRIPTIVE TITLE&quot;, &quot;YEAR&quot; and
jpayne@68 291 &quot;FIRST AUTHOR &lt;EMAIL@ADDRESS&gt;, YEAR&quot; ought to be replaced by sensible
jpayne@68 292 information. This can be done in any text editor; if Emacs is used
jpayne@68 293 and it switched to PO mode automatically (because it has recognized
jpayne@68 294 the file's suffix), you can disable it by typing <kbd>M-x fundamental-mode</kbd>.
jpayne@68 295 </p>
jpayne@68 296 <p>Modifying the header entry can already be done using PO mode: in Emacs,
jpayne@68 297 type <kbd>M-x po-mode RET</kbd> and then <kbd>RET</kbd> again to start editing the
jpayne@68 298 entry. You should fill in the following fields.
jpayne@68 299 </p>
jpayne@68 300 <dl compact="compact">
jpayne@68 301 <dt> Project-Id-Version</dt>
jpayne@68 302 <dd><p>This is the name and version of the package. Fill it in if it has not
jpayne@68 303 already been filled in by <code>xgettext</code>.
jpayne@68 304 </p>
jpayne@68 305 </dd>
jpayne@68 306 <dt> Report-Msgid-Bugs-To</dt>
jpayne@68 307 <dd><p>This has already been filled in by <code>xgettext</code>. It contains an email
jpayne@68 308 address or URL where you can report bugs in the untranslated strings:
jpayne@68 309 </p>
jpayne@68 310 <ul class="toc">
jpayne@68 311 <li> - Strings which are not entire sentences, see the maintainer guidelines
jpayne@68 312 in <a href="gettext_4.html#SEC20">Preparing Translatable Strings</a>.
jpayne@68 313 </li><li> - Strings which use unclear terms or require additional context to be
jpayne@68 314 understood.
jpayne@68 315 </li><li> - Strings which make invalid assumptions about notation of date, time or
jpayne@68 316 money.
jpayne@68 317 </li><li> - Pluralisation problems.
jpayne@68 318 </li><li> - Incorrect English spelling.
jpayne@68 319 </li><li> - Incorrect formatting.
jpayne@68 320 </li></ul>
jpayne@68 321
jpayne@68 322 </dd>
jpayne@68 323 <dt> POT-Creation-Date</dt>
jpayne@68 324 <dd><p>This has already been filled in by <code>xgettext</code>.
jpayne@68 325 </p>
jpayne@68 326 </dd>
jpayne@68 327 <dt> PO-Revision-Date</dt>
jpayne@68 328 <dd><p>You don't need to fill this in. It will be filled by the PO file editor
jpayne@68 329 when you save the file.
jpayne@68 330 </p>
jpayne@68 331 </dd>
jpayne@68 332 <dt> Last-Translator</dt>
jpayne@68 333 <dd><p>Fill in your name and email address (without double quotes).
jpayne@68 334 </p>
jpayne@68 335 </dd>
jpayne@68 336 <dt> Language-Team</dt>
jpayne@68 337 <dd><p>Fill in the English name of the language, and the email address or
jpayne@68 338 homepage URL of the language team you are part of.
jpayne@68 339 </p>
jpayne@68 340 <p>Before starting a translation, it is a good idea to get in touch with
jpayne@68 341 your translation team, not only to make sure you don't do duplicated work,
jpayne@68 342 but also to coordinate difficult linguistic issues.
jpayne@68 343 </p>
jpayne@68 344 <a name="IDX251"></a>
jpayne@68 345 <p>In the Free Translation Project, each translation team has its own mailing
jpayne@68 346 list. The up-to-date list of teams can be found at the Free Translation
jpayne@68 347 Project's homepage, <a href="https://translationproject.org/">https://translationproject.org/</a>, in the &quot;Teams&quot;
jpayne@68 348 area.
jpayne@68 349 </p>
jpayne@68 350 </dd>
jpayne@68 351 <dt> Language</dt>
jpayne@68 352 <dd><p>Fill in the language code of the language. This can be in one of three
jpayne@68 353 forms:
jpayne@68 354 </p>
jpayne@68 355 <ul class="toc">
jpayne@68 356 <li> -
jpayne@68 357 &lsquo;<samp><var>ll</var></samp>&rsquo;, an ISO 639 two-letter language code (lowercase).
jpayne@68 358 See <a href="gettext_18.html#SEC373">Language Codes</a> for the list of codes.
jpayne@68 359
jpayne@68 360 </li><li> -
jpayne@68 361 &lsquo;<samp><var>ll</var>_<var>CC</var></samp>&rsquo;, where &lsquo;<samp><var>ll</var></samp>&rsquo; is an ISO 639 two-letter
jpayne@68 362 language code (lowercase) and &lsquo;<samp><var>CC</var></samp>&rsquo; is an ISO 3166 two-letter
jpayne@68 363 country code (uppercase). The country code specification is not redundant:
jpayne@68 364 Some languages have dialects in different countries. For example,
jpayne@68 365 &lsquo;<samp>de_AT</samp>&rsquo; is used for Austria, and &lsquo;<samp>pt_BR</samp>&rsquo; for Brazil. The country
jpayne@68 366 code serves to distinguish the dialects. See <a href="gettext_18.html#SEC373">Language Codes</a> and
jpayne@68 367 <a href="gettext_19.html#SEC376">Country Codes</a> for the lists of codes.
jpayne@68 368
jpayne@68 369 </li><li> -
jpayne@68 370 &lsquo;<samp><var>ll</var>_<var>CC</var>@<var>variant</var></samp>&rsquo;, where &lsquo;<samp><var>ll</var></samp>&rsquo; is an
jpayne@68 371 ISO 639 two-letter language code (lowercase), &lsquo;<samp><var>CC</var></samp>&rsquo; is an
jpayne@68 372 ISO 3166 two-letter country code (uppercase), and &lsquo;<samp><var>variant</var></samp>&rsquo; is
jpayne@68 373 a variant designator. The variant designator (lowercase) can be a script
jpayne@68 374 designator, such as &lsquo;<samp>latin</samp>&rsquo; or &lsquo;<samp>cyrillic</samp>&rsquo;.
jpayne@68 375 </li></ul>
jpayne@68 376
jpayne@68 377 <p>The naming convention &lsquo;<samp><var>ll</var>_<var>CC</var></samp>&rsquo; is also the way locales are
jpayne@68 378 named on systems based on GNU libc. But there are three important differences:
jpayne@68 379 </p>
jpayne@68 380 <ul>
jpayne@68 381 <li>
jpayne@68 382 In this PO file field, but not in locale names, &lsquo;<samp><var>ll</var>_<var>CC</var></samp>&rsquo;
jpayne@68 383 combinations denoting a language's main dialect are abbreviated as
jpayne@68 384 &lsquo;<samp><var>ll</var></samp>&rsquo;. For example, &lsquo;<samp>de</samp>&rsquo; is equivalent to &lsquo;<samp>de_DE</samp>&rsquo;
jpayne@68 385 (German as spoken in Germany), and &lsquo;<samp>pt</samp>&rsquo; to &lsquo;<samp>pt_PT</samp>&rsquo; (Portuguese as
jpayne@68 386 spoken in Portugal) in this context.
jpayne@68 387
jpayne@68 388 </li><li>
jpayne@68 389 In this PO file field, suffixes like &lsquo;<samp>.<var>encoding</var></samp>&rsquo; are not used.
jpayne@68 390
jpayne@68 391 </li><li>
jpayne@68 392 In this PO file field, variant designators that are not relevant to message
jpayne@68 393 translation, such as &lsquo;<samp>@euro</samp>&rsquo;, are not used.
jpayne@68 394 </li></ul>
jpayne@68 395
jpayne@68 396 <p>So, if your locale name is &lsquo;<samp>de_DE.UTF-8</samp>&rsquo;, the language specification in
jpayne@68 397 PO files is just &lsquo;<samp>de</samp>&rsquo;.
jpayne@68 398 </p>
jpayne@68 399 </dd>
jpayne@68 400 <dt> Content-Type</dt>
jpayne@68 401 <dd><a name="IDX252"></a>
jpayne@68 402 <a name="IDX253"></a>
jpayne@68 403 <p>Replace &lsquo;<samp>CHARSET</samp>&rsquo; with the character encoding used for your language,
jpayne@68 404 in your locale, or UTF-8. This field is needed for correct operation of the
jpayne@68 405 <code>msgmerge</code> and <code>msgfmt</code> programs, as well as for users whose
jpayne@68 406 locale's character encoding differs from yours (see <a href="gettext_11.html#SEC205">How to specify the output character set <code>gettext</code> uses</a>).
jpayne@68 407 </p>
jpayne@68 408 <a name="IDX254"></a>
jpayne@68 409 <p>You get the character encoding of your locale by running the shell command
jpayne@68 410 &lsquo;<samp>locale charmap</samp>&rsquo;. If the result is &lsquo;<samp>C</samp>&rsquo; or &lsquo;<samp>ANSI_X3.4-1968</samp>&rsquo;,
jpayne@68 411 which is equivalent to &lsquo;<samp>ASCII</samp>&rsquo; (= &lsquo;<samp>US-ASCII</samp>&rsquo;), it means that your
jpayne@68 412 locale is not correctly configured. In this case, ask your translation
jpayne@68 413 team which charset to use. &lsquo;<samp>ASCII</samp>&rsquo; is not usable for any language
jpayne@68 414 except Latin.
jpayne@68 415 </p>
jpayne@68 416 <a name="IDX255"></a>
jpayne@68 417 <p>Because the PO files must be portable to operating systems with less advanced
jpayne@68 418 internationalization facilities, the character encodings that can be used
jpayne@68 419 are limited to those supported by both GNU <code>libc</code> and GNU
jpayne@68 420 <code>libiconv</code>. These are:
jpayne@68 421 <code>ASCII</code>, <code>ISO-8859-1</code>, <code>ISO-8859-2</code>, <code>ISO-8859-3</code>,
jpayne@68 422 <code>ISO-8859-4</code>, <code>ISO-8859-5</code>, <code>ISO-8859-6</code>, <code>ISO-8859-7</code>,
jpayne@68 423 <code>ISO-8859-8</code>, <code>ISO-8859-9</code>, <code>ISO-8859-13</code>, <code>ISO-8859-14</code>,
jpayne@68 424 <code>ISO-8859-15</code>,
jpayne@68 425 <code>KOI8-R</code>, <code>KOI8-U</code>, <code>KOI8-T</code>,
jpayne@68 426 <code>CP850</code>, <code>CP866</code>, <code>CP874</code>,
jpayne@68 427 <code>CP932</code>, <code>CP949</code>, <code>CP950</code>, <code>CP1250</code>, <code>CP1251</code>,
jpayne@68 428 <code>CP1252</code>, <code>CP1253</code>, <code>CP1254</code>, <code>CP1255</code>, <code>CP1256</code>,
jpayne@68 429 <code>CP1257</code>, <code>GB2312</code>, <code>EUC-JP</code>, <code>EUC-KR</code>, <code>EUC-TW</code>,
jpayne@68 430 <code>BIG5</code>, <code>BIG5-HKSCS</code>, <code>GBK</code>, <code>GB18030</code>, <code>SHIFT_JIS</code>,
jpayne@68 431 <code>JOHAB</code>, <code>TIS-620</code>, <code>VISCII</code>, <code>GEORGIAN-PS</code>, <code>UTF-8</code>.
jpayne@68 432 </p>
jpayne@68 433 <a name="IDX256"></a>
jpayne@68 434 <p>In the GNU system, the following encodings are frequently used for the
jpayne@68 435 corresponding languages.
jpayne@68 436 </p>
jpayne@68 437 <a name="IDX257"></a>
jpayne@68 438 <ul class="toc">
jpayne@68 439 <li> <code>ISO-8859-1</code> for
jpayne@68 440 Afrikaans, Albanian, Basque, Breton, Catalan, Cornish, Danish, Dutch,
jpayne@68 441 English, Estonian, Faroese, Finnish, French, Galician, German,
jpayne@68 442 Greenlandic, Icelandic, Indonesian, Irish, Italian, Malay, Manx,
jpayne@68 443 Norwegian, Occitan, Portuguese, Spanish, Swedish, Tagalog, Uzbek,
jpayne@68 444 Walloon,
jpayne@68 445 </li><li> <code>ISO-8859-2</code> for
jpayne@68 446 Bosnian, Croatian, Czech, Hungarian, Polish, Romanian, Serbian, Slovak,
jpayne@68 447 Slovenian,
jpayne@68 448 </li><li> <code>ISO-8859-3</code> for Maltese,
jpayne@68 449 </li><li> <code>ISO-8859-5</code> for Macedonian, Serbian,
jpayne@68 450 </li><li> <code>ISO-8859-6</code> for Arabic,
jpayne@68 451 </li><li> <code>ISO-8859-7</code> for Greek,
jpayne@68 452 </li><li> <code>ISO-8859-8</code> for Hebrew,
jpayne@68 453 </li><li> <code>ISO-8859-9</code> for Turkish,
jpayne@68 454 </li><li> <code>ISO-8859-13</code> for Latvian, Lithuanian, Maori,
jpayne@68 455 </li><li> <code>ISO-8859-14</code> for Welsh,
jpayne@68 456 </li><li> <code>ISO-8859-15</code> for
jpayne@68 457 Basque, Catalan, Dutch, English, Finnish, French, Galician, German, Irish,
jpayne@68 458 Italian, Portuguese, Spanish, Swedish, Walloon,
jpayne@68 459 </li><li> <code>KOI8-R</code> for Russian,
jpayne@68 460 </li><li> <code>KOI8-U</code> for Ukrainian,
jpayne@68 461 </li><li> <code>KOI8-T</code> for Tajik,
jpayne@68 462 </li><li> <code>CP1251</code> for Bulgarian, Belarusian,
jpayne@68 463 </li><li> <code>GB2312</code>, <code>GBK</code>, <code>GB18030</code>
jpayne@68 464 for simplified writing of Chinese,
jpayne@68 465 </li><li> <code>BIG5</code>, <code>BIG5-HKSCS</code>
jpayne@68 466 for traditional writing of Chinese,
jpayne@68 467 </li><li> <code>EUC-JP</code> for Japanese,
jpayne@68 468 </li><li> <code>EUC-KR</code> for Korean,
jpayne@68 469 </li><li> <code>TIS-620</code> for Thai,
jpayne@68 470 </li><li> <code>GEORGIAN-PS</code> for Georgian,
jpayne@68 471 </li><li> <code>UTF-8</code> for any language, including those listed above.
jpayne@68 472 </li></ul>
jpayne@68 473
jpayne@68 474 <a name="IDX258"></a>
jpayne@68 475 <a name="IDX259"></a>
jpayne@68 476 <p>When single quote characters or double quote characters are used in
jpayne@68 477 translations for your language, and your locale's encoding is one of the
jpayne@68 478 ISO-8859-* charsets, it is best if you create your PO files in UTF-8
jpayne@68 479 encoding, instead of your locale's encoding. This is because in UTF-8
jpayne@68 480 the real quote characters can be represented (single quote characters:
jpayne@68 481 U+2018, U+2019, double quote characters: U+201C, U+201D), whereas none of
jpayne@68 482 ISO-8859-* charsets has them all. Users in UTF-8 locales will see the
jpayne@68 483 real quote characters, whereas users in ISO-8859-* locales will see the
jpayne@68 484 vertical apostrophe and the vertical double quote instead (because that's
jpayne@68 485 what the character set conversion will transliterate them to).
jpayne@68 486 </p>
jpayne@68 487 <a name="IDX260"></a>
jpayne@68 488 <p>To enter such quote characters under X11, you can change your keyboard
jpayne@68 489 mapping using the <code>xmodmap</code> program. The X11 names of the quote
jpayne@68 490 characters are &quot;leftsinglequotemark&quot;, &quot;rightsinglequotemark&quot;,
jpayne@68 491 &quot;leftdoublequotemark&quot;, &quot;rightdoublequotemark&quot;, &quot;singlelowquotemark&quot;,
jpayne@68 492 &quot;doublelowquotemark&quot;.
jpayne@68 493 </p>
jpayne@68 494 <p>Note that only recent versions of GNU Emacs support the UTF-8 encoding:
jpayne@68 495 Emacs 20 with Mule-UCS, and Emacs 21. As of January 2001, XEmacs doesn't
jpayne@68 496 support the UTF-8 encoding.
jpayne@68 497 </p>
jpayne@68 498 <p>The character encoding name can be written in either upper or lower case.
jpayne@68 499 Usually upper case is preferred.
jpayne@68 500 </p>
jpayne@68 501 </dd>
jpayne@68 502 <dt> Content-Transfer-Encoding</dt>
jpayne@68 503 <dd><p>Set this to <code>8bit</code>.
jpayne@68 504 </p>
jpayne@68 505 </dd>
jpayne@68 506 <dt> Plural-Forms</dt>
jpayne@68 507 <dd><p>This field is optional. It is only needed if the PO file has plural forms.
jpayne@68 508 You can find them by searching for the &lsquo;<samp>msgid_plural</samp>&rsquo; keyword. The
jpayne@68 509 format of the plural forms field is described in <a href="gettext_11.html#SEC207">Additional functions for plural forms</a> and
jpayne@68 510 <a href="gettext_12.html#SEC228">Translating plural forms</a>.
jpayne@68 511 </p></dd>
jpayne@68 512 </dl>
jpayne@68 513
jpayne@68 514
jpayne@68 515 <table cellpadding="1" cellspacing="1" border="0">
jpayne@68 516 <tr><td valign="middle" align="left">[<a href="#SEC45" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
jpayne@68 517 <td valign="middle" align="left">[<a href="gettext_7.html#SEC53" title="Next chapter"> &gt;&gt; </a>]</td>
jpayne@68 518 <td valign="middle" align="left"> &nbsp; </td>
jpayne@68 519 <td valign="middle" align="left"> &nbsp; </td>
jpayne@68 520 <td valign="middle" align="left"> &nbsp; </td>
jpayne@68 521 <td valign="middle" align="left"> &nbsp; </td>
jpayne@68 522 <td valign="middle" align="left"> &nbsp; </td>
jpayne@68 523 <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
jpayne@68 524 <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
jpayne@68 525 <td valign="middle" align="left">[<a href="gettext_21.html#SEC389" title="Index">Index</a>]</td>
jpayne@68 526 <td valign="middle" align="left">[<a href="gettext_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
jpayne@68 527 </tr></table>
jpayne@68 528 <p>
jpayne@68 529 <font size="-1">
jpayne@68 530 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>.
jpayne@68 531 </font>
jpayne@68 532 <br>
jpayne@68 533
jpayne@68 534 </p>
jpayne@68 535 </body>
jpayne@68 536 </html>