1@c This file is part of the GNU gettext manual. 2@c Copyright (C) 1995-2019 Free Software Foundation, Inc. 3@c See the file gettext.texi for copying conditions. 4 5@pindex msginit 6@cindex @code{msginit} program, usage 7@example 8msginit [@var{option}] 9@end example 10 11@cindex create new PO file 12@cindex initialize new PO file 13The @code{msginit} program creates a new PO file, initializing the meta 14information with values from the user's environment. 15 16Here are more details. The following header fields of a PO file are 17automatically filled, when possible. 18 19@table @samp 20@item Project-Id-Version 21The value is guessed from the @code{configure} script or any other files 22in the current directory. 23 24@item PO-Revision-Date 25The value is taken from the @code{PO-Creation-Data} in the input POT 26file, or the current date is used. 27 28@item Last-Translator 29The value is taken from user's password file entry and the mailer 30configuration files. 31 32@item Language-Team, Language 33These values are set according to the current locale and the predefined 34list of translation teams. 35 36@item MIME-Version, Content-Type, Content-Transfer-Encoding 37These values are set according to the content of the POT file and the 38current locale. If the POT file contains charset=UTF-8, it means that 39the POT file contains non-ASCII characters, and we keep the UTF-8 40encoding. Otherwise, when the POT file is plain ASCII, we use the 41locale's encoding. 42 43@item Plural-Forms 44The value is first looked up from the embedded table. 45 46As an experimental feature, you can instruct @code{msginit} to use the 47information from Unicode CLDR, by setting the @code{GETTEXTCLDRDIR} 48environment variable. The program will look for a file named 49@code{common/supplemental/plurals.xml} under that directory. You can 50get the CLDR data from @url{http://cldr.unicode.org/}. 51 52@end table 53 54@subsection Input file location 55 56@table @samp 57@item -i @var{inputfile} 58@itemx --input=@var{inputfile} 59@opindex -i@r{, @code{msginit} option} 60@opindex --input@r{, @code{msginit} option} 61Input POT file. 62 63@end table 64 65If no @var{inputfile} is given, the current directory is searched for the 66POT file. If it is @samp{-}, standard input is read. 67 68@subsection Output file location 69 70@table @samp 71@item -o @var{file} 72@itemx --output-file=@var{file} 73@opindex -o@r{, @code{msginit} option} 74@opindex --output-file@r{, @code{msginit} option} 75Write output to specified PO file. 76 77@end table 78 79If no output file is given, it depends on the @samp{--locale} option or the 80user's locale setting. If it is @samp{-}, the results are written to 81standard output. 82 83@subsection Input file syntax 84 85@table @samp 86@item -P 87@itemx --properties-input 88@opindex -P@r{, @code{msginit} option} 89@opindex --properties-input@r{, @code{msginit} option} 90Assume the input file is a Java ResourceBundle in Java @code{.properties} 91syntax, not in PO file syntax. 92 93@item --stringtable-input 94@opindex --stringtable-input@r{, @code{msginit} option} 95Assume the input file is a NeXTstep/GNUstep localized resource file in 96@code{.strings} syntax, not in PO file syntax. 97 98@end table 99 100@subsection Output details 101 102@table @samp 103@item -l @var{ll_CC[.encoding]} 104@itemx --locale=@var{ll_CC[.encoding]} 105@opindex -l@r{, @code{msginit} option} 106@opindex --locale@r{, @code{msginit} option} 107Set target locale. @var{ll} should be a language code, and @var{CC} should 108be a country code. The optional part @var{.encoding} specifies the encoding 109of the locale; most often this part is @code{.UTF-8}. 110The command @samp{locale -a} can be used to output a list 111of all installed locales. The default is the user's locale setting. 112 113@item --no-translator 114@opindex --no-translator@r{, @code{msginit} option} 115Declares that the PO file will not have a human translator and is instead 116automatically generated. 117 118@item --color 119@itemx --color=@var{when} 120@opindex --color@r{, @code{msginit} option} 121Specify whether or when to use colors and other text attributes. 122See @ref{The --color option} for details. 123 124@item --style=@var{style_file} 125@opindex --style@r{, @code{msginit} option} 126Specify the CSS style rule file to use for @code{--color}. 127See @ref{The --style option} for details. 128 129@item -p 130@itemx --properties-output 131@opindex -p@r{, @code{msginit} option} 132@opindex --properties-output@r{, @code{msginit} option} 133Write out a Java ResourceBundle in Java @code{.properties} syntax. Note 134that this file format doesn't support plural forms and silently drops 135obsolete messages. 136 137@item --stringtable-output 138@opindex --stringtable-output@r{, @code{msginit} option} 139Write out a NeXTstep/GNUstep localized resource file in @code{.strings} syntax. 140Note that this file format doesn't support plural forms. 141 142@item -w @var{number} 143@itemx --width=@var{number} 144@opindex -w@r{, @code{msginit} option} 145@opindex --width@r{, @code{msginit} option} 146Set the output page width. Long strings in the output files will be 147split across multiple lines in order to ensure that each line's width 148(= number of screen columns) is less or equal to the given @var{number}. 149 150@item --no-wrap 151@opindex --no-wrap@r{, @code{msginit} option} 152Do not break long message lines. Message lines whose width exceeds the 153output page width will not be split into several lines. Only file reference 154lines which are wider than the output page width will be split. 155 156@end table 157 158@subsection Informative output 159 160@table @samp 161@item -h 162@itemx --help 163@opindex -h@r{, @code{msginit} option} 164@opindex --help@r{, @code{msginit} option} 165Display this help and exit. 166 167@item -V 168@itemx --version 169@opindex -V@r{, @code{msginit} option} 170@opindex --version@r{, @code{msginit} option} 171Output version information and exit. 172 173@end table 174