Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / doc / gettext_6.html
index 6f86767..fb0beb4 100644 (file)
@@ -1,7 +1,7 @@
 <HTML>
 <HEAD>
 <!-- This HTML file has been created by texi2html 1.52b
-     from gettext.texi on 7 January 2014 -->
+     from gettext.texi on 28 December 2015 -->
 
 <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
 <TITLE>GNU gettext utilities - 6  Creating a New PO File</TITLE>
@@ -13,7 +13,7 @@ Go to the <A HREF="gettext_1.html">first</A>, <A HREF="gettext_5.html">previous<
 
 <H1><A NAME="SEC37" HREF="gettext_toc.html#TOC37">6  Creating a New PO File</A></H1>
 <P>
-<A NAME="IDX244"></A>
+<A NAME="IDX250"></A>
 
 </P>
 <P>
@@ -48,20 +48,65 @@ the header entry of this file.
 <H2><A NAME="SEC38" HREF="gettext_toc.html#TOC38">6.1  Invoking the <CODE>msginit</CODE> Program</A></H2>
 
 <P>
-<A NAME="IDX245"></A>
-<A NAME="IDX246"></A>
+<A NAME="IDX251"></A>
+<A NAME="IDX252"></A>
 
 <PRE>
 msginit [<VAR>option</VAR>]
 </PRE>
 
 <P>
-<A NAME="IDX247"></A>
-<A NAME="IDX248"></A>
+<A NAME="IDX253"></A>
+<A NAME="IDX254"></A>
 The <CODE>msginit</CODE> program creates a new PO file, initializing the meta
 information with values from the user's environment.
 
 </P>
+<P>
+Here are more details.  The following header fields of a PO file are
+automatically filled, when possible.
+
+</P>
+<DL COMPACT>
+
+<DT><SAMP>&lsquo;Project-Id-Version&rsquo;</SAMP>
+<DD>
+The value is guessed from the <CODE>configure</CODE> script or any other files
+in the current directory.
+
+<DT><SAMP>&lsquo;PO-Revision-Date&rsquo;</SAMP>
+<DD>
+The value is taken from the <CODE>PO-Creation-Data</CODE> in the input POT
+file, or the current date is used.
+
+<DT><SAMP>&lsquo;Last-Translator&rsquo;</SAMP>
+<DD>
+The value is taken from user's password file entry and the mailer
+configuration files.
+
+<DT><SAMP>&lsquo;Language-Team, Language&rsquo;</SAMP>
+<DD>
+These values are set according to the current locale and the predefined
+list of translation teams.
+
+<DT><SAMP>&lsquo;MIME-Version, Content-Type, Content-Transfer-Encoding&rsquo;</SAMP>
+<DD>
+These values are set according to the content of the POT file and the
+current locale.  If the POT file contains charset=UTF-8, it means that
+the POT file contains non-ASCII characters, and we keep the UTF-8
+encoding.  Otherwise, when the POT file is plain ASCII, we use the
+locale's encoding.
+
+<DT><SAMP>&lsquo;Plural-Forms&rsquo;</SAMP>
+<DD>
+The value is first looked up from the embedded table.
+
+As an experimental feature, you can instruct <CODE>msginit</CODE> to use the
+information from Unicode CLDR, by setting the <CODE>GETTEXTCLDRDIR</CODE>
+environment variable.
+
+</DL>
+
 
 
 <H3><A NAME="SEC39" HREF="gettext_toc.html#TOC39">6.1.1  Input file location</A></H3>
@@ -72,8 +117,8 @@ information with values from the user's environment.
 <DD>
 <DT><SAMP>&lsquo;--input=<VAR>inputfile</VAR>&rsquo;</SAMP>
 <DD>
-<A NAME="IDX249"></A>
-<A NAME="IDX250"></A>
+<A NAME="IDX255"></A>
+<A NAME="IDX256"></A>
 Input POT file.
 
 </DL>
@@ -93,8 +138,8 @@ POT file.  If it is <SAMP>&lsquo;-&rsquo;</SAMP>, standard input is read.
 <DD>
 <DT><SAMP>&lsquo;--output-file=<VAR>file</VAR>&rsquo;</SAMP>
 <DD>
-<A NAME="IDX251"></A>
-<A NAME="IDX252"></A>
+<A NAME="IDX257"></A>
+<A NAME="IDX258"></A>
 Write output to specified PO file.
 
 </DL>
@@ -115,14 +160,14 @@ standard output.
 <DD>
 <DT><SAMP>&lsquo;--properties-input&rsquo;</SAMP>
 <DD>
-<A NAME="IDX253"></A>
-<A NAME="IDX254"></A>
+<A NAME="IDX259"></A>
+<A NAME="IDX260"></A>
 Assume the input file is a Java ResourceBundle in Java <CODE>.properties</CODE>
 syntax, not in PO file syntax.
 
 <DT><SAMP>&lsquo;--stringtable-input&rsquo;</SAMP>
 <DD>
-<A NAME="IDX255"></A>
+<A NAME="IDX261"></A>
 Assume the input file is a NeXTstep/GNUstep localized resource file in
 <CODE>.strings</CODE> syntax, not in PO file syntax.
 
@@ -138,15 +183,15 @@ Assume the input file is a NeXTstep/GNUstep localized resource file in
 <DD>
 <DT><SAMP>&lsquo;--locale=<VAR>ll_CC</VAR>&rsquo;</SAMP>
 <DD>
-<A NAME="IDX256"></A>
-<A NAME="IDX257"></A>
+<A NAME="IDX262"></A>
+<A NAME="IDX263"></A>
 Set target locale.  <VAR>ll</VAR> should be a language code, and <VAR>CC</VAR> should
 be a country code.  The command <SAMP>&lsquo;locale -a&rsquo;</SAMP> can be used to output a list
 of all installed locales.  The default is the user's locale setting.
 
 <DT><SAMP>&lsquo;--no-translator&rsquo;</SAMP>
 <DD>
-<A NAME="IDX258"></A>
+<A NAME="IDX264"></A>
 Declares that the PO file will not have a human translator and is instead
 automatically generated.
 
@@ -154,13 +199,13 @@ automatically generated.
 <DD>
 <DT><SAMP>&lsquo;--color=<VAR>when</VAR>&rsquo;</SAMP>
 <DD>
-<A NAME="IDX259"></A>
+<A NAME="IDX265"></A>
 Specify whether or when to use colors and other text attributes.
 See section <A HREF="gettext_9.html#SEC150">9.11.1  The <CODE>--color</CODE> option</A> for details.
 
 <DT><SAMP>&lsquo;--style=<VAR>style_file</VAR>&rsquo;</SAMP>
 <DD>
-<A NAME="IDX260"></A>
+<A NAME="IDX266"></A>
 Specify the CSS style rule file to use for <CODE>--color</CODE>.
 See section <A HREF="gettext_9.html#SEC152">9.11.3  The <CODE>--style</CODE> option</A> for details.
 
@@ -168,15 +213,15 @@ See section <A HREF="gettext_9.html#SEC152">9.11.3  The <CODE>--style</CODE> opt
 <DD>
 <DT><SAMP>&lsquo;--properties-output&rsquo;</SAMP>
 <DD>
-<A NAME="IDX261"></A>
-<A NAME="IDX262"></A>
+<A NAME="IDX267"></A>
+<A NAME="IDX268"></A>
 Write out a Java ResourceBundle in Java <CODE>.properties</CODE> syntax.  Note
 that this file format doesn't support plural forms and silently drops
 obsolete messages.
 
 <DT><SAMP>&lsquo;--stringtable-output&rsquo;</SAMP>
 <DD>
-<A NAME="IDX263"></A>
+<A NAME="IDX269"></A>
 Write out a NeXTstep/GNUstep localized resource file in <CODE>.strings</CODE> syntax.
 Note that this file format doesn't support plural forms.
 
@@ -184,15 +229,15 @@ Note that this file format doesn't support plural forms.
 <DD>
 <DT><SAMP>&lsquo;--width=<VAR>number</VAR>&rsquo;</SAMP>
 <DD>
-<A NAME="IDX264"></A>
-<A NAME="IDX265"></A>
+<A NAME="IDX270"></A>
+<A NAME="IDX271"></A>
 Set the output page width.  Long strings in the output files will be
 split across multiple lines in order to ensure that each line's width
 (= number of screen columns) is less or equal to the given <VAR>number</VAR>.
 
 <DT><SAMP>&lsquo;--no-wrap&rsquo;</SAMP>
 <DD>
-<A NAME="IDX266"></A>
+<A NAME="IDX272"></A>
 Do not break long message lines.  Message lines whose width exceeds the
 output page width will not be split into several lines.  Only file reference
 lines which are wider than the output page width will be split.
@@ -209,16 +254,16 @@ lines which are wider than the output page width will be split.
 <DD>
 <DT><SAMP>&lsquo;--help&rsquo;</SAMP>
 <DD>
-<A NAME="IDX267"></A>
-<A NAME="IDX268"></A>
+<A NAME="IDX273"></A>
+<A NAME="IDX274"></A>
 Display this help and exit.
 
 <DT><SAMP>&lsquo;-V&rsquo;</SAMP>
 <DD>
 <DT><SAMP>&lsquo;--version&rsquo;</SAMP>
 <DD>
-<A NAME="IDX269"></A>
-<A NAME="IDX270"></A>
+<A NAME="IDX275"></A>
+<A NAME="IDX276"></A>
 Output version information and exit.
 
 </DL>
@@ -227,7 +272,7 @@ Output version information and exit.
 
 <H2><A NAME="SEC44" HREF="gettext_toc.html#TOC44">6.2  Filling in the Header Entry</A></H2>
 <P>
-<A NAME="IDX271"></A>
+<A NAME="IDX277"></A>
 
 </P>
 <P>
@@ -297,7 +342,7 @@ Before starting a translation, it is a good idea to get in touch with
 your translation team, not only to make sure you don't do duplicated work,
 but also to coordinate difficult linguistic issues.
 
-<A NAME="IDX272"></A>
+<A NAME="IDX278"></A>
 In the Free Translation Project, each translation team has its own mailing
 list.  The up-to-date list of teams can be found at the Free Translation
 Project's homepage, <A HREF="http://translationproject.org/">http://translationproject.org/</A>, in the "Teams"
@@ -313,7 +358,7 @@ forms:
 <LI>
 
 <SAMP>&lsquo;<VAR>ll</VAR>&rsquo;</SAMP>, an ISO 639 two-letter language code (lowercase).
-See section <A HREF="gettext_17.html#SEC322">A  Language Codes</A> for the list of codes.
+See section <A HREF="gettext_17.html#SEC331">A  Language Codes</A> for the list of codes.
 
 <LI>
 
@@ -322,8 +367,8 @@ language code (lowercase) and <SAMP>&lsquo;<VAR>CC</VAR>&rsquo;</SAMP> is an ISO
 country code (uppercase).  The country code specification is not redundant:
 Some languages have dialects in different countries.  For example,
 <SAMP>&lsquo;de_AT&rsquo;</SAMP> is used for Austria, and <SAMP>&lsquo;pt_BR&rsquo;</SAMP> for Brazil.  The country
-code serves to distinguish the dialects. See section <A HREF="gettext_17.html#SEC322">A  Language Codes</A> and
-section <A HREF="gettext_18.html#SEC325">B  Country Codes</A> for the lists of codes.
+code serves to distinguish the dialects. See section <A HREF="gettext_17.html#SEC331">A  Language Codes</A> and
+section <A HREF="gettext_18.html#SEC334">B  Country Codes</A> for the lists of codes.
 
 <LI>
 
@@ -362,14 +407,14 @@ PO files is just <SAMP>&lsquo;de&rsquo;</SAMP>.
 
 <DT>Content-Type
 <DD>
-<A NAME="IDX273"></A>
-<A NAME="IDX274"></A>
+<A NAME="IDX279"></A>
+<A NAME="IDX280"></A>
 Replace <SAMP>&lsquo;CHARSET&rsquo;</SAMP> with the character encoding used for your language,
 in your locale, or UTF-8.  This field is needed for correct operation of the
 <CODE>msgmerge</CODE> and <CODE>msgfmt</CODE> programs, as well as for users whose
-locale's character encoding differs from yours (see section <A HREF="gettext_11.html#SEC186">11.2.4  How to specify the output character set <CODE>gettext</CODE> uses</A>).
+locale's character encoding differs from yours (see section <A HREF="gettext_11.html#SEC188">11.2.4  How to specify the output character set <CODE>gettext</CODE> uses</A>).
 
-<A NAME="IDX275"></A>
+<A NAME="IDX281"></A>
 You get the character encoding of your locale by running the shell command
 <SAMP>&lsquo;locale charmap&rsquo;</SAMP>.  If the result is <SAMP>&lsquo;C&rsquo;</SAMP> or <SAMP>&lsquo;ANSI_X3.4-1968&rsquo;</SAMP>,
 which is equivalent to <SAMP>&lsquo;ASCII&rsquo;</SAMP> (= <SAMP>&lsquo;US-ASCII&rsquo;</SAMP>), it means that your
@@ -377,7 +422,7 @@ locale is not correctly configured.  In this case, ask your translation
 team which charset to use.  <SAMP>&lsquo;ASCII&rsquo;</SAMP> is not usable for any language
 except Latin.
 
-<A NAME="IDX276"></A>
+<A NAME="IDX282"></A>
 Because the PO files must be portable to operating systems with less advanced
 internationalization facilities, the character encodings that can be used
 are limited to those supported by both GNU <CODE>libc</CODE> and GNU
@@ -394,11 +439,11 @@ are limited to those supported by both GNU <CODE>libc</CODE> and GNU
 <CODE>BIG5</CODE>, <CODE>BIG5-HKSCS</CODE>, <CODE>GBK</CODE>, <CODE>GB18030</CODE>, <CODE>SHIFT_JIS</CODE>,
 <CODE>JOHAB</CODE>, <CODE>TIS-620</CODE>, <CODE>VISCII</CODE>, <CODE>GEORGIAN-PS</CODE>, <CODE>UTF-8</CODE>.
 
-<A NAME="IDX277"></A>
+<A NAME="IDX283"></A>
 In the GNU system, the following encodings are frequently used for the
 corresponding languages.
 
-<A NAME="IDX278"></A>
+<A NAME="IDX284"></A>
 
 <UL>
 <LI><CODE>ISO-8859-1</CODE> for
@@ -458,8 +503,8 @@ for traditional writing of Chinese,
 
 </UL>
 
-<A NAME="IDX279"></A>
-<A NAME="IDX280"></A>
+<A NAME="IDX285"></A>
+<A NAME="IDX286"></A>
 When single quote characters or double quote characters are used in
 translations for your language, and your locale's encoding is one of the
 ISO-8859-* charsets, it is best if you create your PO files in UTF-8
@@ -471,7 +516,7 @@ real quote characters, whereas users in ISO-8859-* locales will see the
 vertical apostrophe and the vertical double quote instead (because that's
 what the character set conversion will transliterate them to).
 
-<A NAME="IDX281"></A>
+<A NAME="IDX287"></A>
 To enter such quote characters under X11, you can change your keyboard
 mapping using the <CODE>xmodmap</CODE> program.  The X11 names of the quote
 characters are "leftsinglequotemark", "rightsinglequotemark",
@@ -493,8 +538,8 @@ Set this to <CODE>8bit</CODE>.
 <DD>
 This field is optional.  It is only needed if the PO file has plural forms.
 You can find them by searching for the <SAMP>&lsquo;msgid_plural&rsquo;</SAMP> keyword.  The
-format of the plural forms field is described in section <A HREF="gettext_11.html#SEC188">11.2.6  Additional functions for plural forms</A> and
-section <A HREF="gettext_12.html#SEC209">12.6  Translating plural forms</A>.
+format of the plural forms field is described in section <A HREF="gettext_11.html#SEC190">11.2.6  Additional functions for plural forms</A> and
+section <A HREF="gettext_12.html#SEC211">12.6  Translating plural forms</A>.
 </DL>
 
 <P><HR><P>