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