• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 msgcat
6@cindex @code{msgcat} program, usage
7@example
8msgcat [@var{option}] [@var{inputfile}]...
9@end example
10
11@cindex concatenate PO files
12@cindex merge PO files
13The @code{msgcat} program concatenates and merges the specified PO files.
14It finds messages which are common to two or more of the specified PO files.
15By using the @code{--more-than} option, greater commonality may be requested
16before messages are printed.  Conversely, the @code{--less-than} option may be
17used to specify less commonality before messages are printed (i.e.@:
18@samp{--less-than=2} will only print the unique messages).  Translations,
19comments, extracted comments, and file positions will be cumulated, except that
20if @code{--use-first} is specified, they will be taken from the first PO file
21to define them.
22
23To concatenate POT files, better use @code{xgettext}, not @code{msgcat},
24because @code{msgcat} would choke on the undefined charsets in the specified
25POT files.
26
27@subsection Input file location
28
29@table @samp
30@item @var{inputfile} @dots{}
31Input files.
32
33@item -f @var{file}
34@itemx --files-from=@var{file}
35@opindex -f@r{, @code{msgcat} option}
36@opindex --files-from@r{, @code{msgcat} option}
37Read the names of the input files from @var{file} instead of getting
38them from the command line.
39
40@item -D @var{directory}
41@itemx --directory=@var{directory}
42@opindex -D@r{, @code{msgcat} option}
43@opindex --directory@r{, @code{msgcat} option}
44Add @var{directory} to the list of directories.  Source files are
45searched relative to this list of directories.  The resulting @file{.po}
46file will be written relative to the current directory, though.
47
48@end table
49
50If @var{inputfile} is @samp{-}, standard input is read.
51
52@subsection Output file location
53
54@table @samp
55@item -o @var{file}
56@itemx --output-file=@var{file}
57@opindex -o@r{, @code{msgcat} option}
58@opindex --output-file@r{, @code{msgcat} option}
59Write output to specified file.
60
61@end table
62
63@cindex standard output, and @code{msgcat}
64The results are written to standard output if no output file is specified
65or if it is @samp{-}.
66
67@subsection Message selection
68
69@table @samp
70@item -< @var{number}
71@itemx --less-than=@var{number}
72@opindex -<@r{, @code{msgcat} option}
73@opindex --less-than@r{, @code{msgcat} option}
74Print messages with less than @var{number} definitions, defaults to infinite
75if not set.
76
77@item -> @var{number}
78@itemx --more-than=@var{number}
79@opindex ->@r{, @code{msgcat} option}
80@opindex --more-than@r{, @code{msgcat} option}
81Print messages with more than @var{number} definitions, defaults to 0 if not
82set.
83
84@item -u
85@itemx --unique
86@opindex -u@r{, @code{msgcat} option}
87@opindex --unique@r{, @code{msgcat} option}
88Shorthand for @samp{--less-than=2}.  Requests that only unique messages be
89printed.
90
91@end table
92
93@subsection Input file syntax
94
95@table @samp
96@item -P
97@itemx --properties-input
98@opindex -P@r{, @code{msgcat} option}
99@opindex --properties-input@r{, @code{msgcat} option}
100Assume the input files are Java ResourceBundles in Java @code{.properties}
101syntax, not in PO file syntax.
102
103@item --stringtable-input
104@opindex --stringtable-input@r{, @code{msgcat} option}
105Assume the input files are NeXTstep/GNUstep localized resource files in
106@code{.strings} syntax, not in PO file syntax.
107
108@end table
109
110@subsection Output details
111
112@c --no-escape and --escape omitted on purpose.  They are not useful.
113
114@table @samp
115@item -t
116@itemx --to-code=@var{name}
117@opindex -t@r{, @code{msgcat} option}
118@opindex --to-code@r{, @code{msgcat} option}
119Specify encoding for output.
120
121@item --use-first
122@opindex --use-first@r{, @code{msgcat} option}
123Use first available translation for each message.  Don't merge several
124translations into one.
125
126@item --lang=@var{catalogname}
127@opindex --lang@r{, @code{msgcat} option}
128Specify the @samp{Language} field to be used in the header entry.  See
129@ref{Header Entry} for the meaning of this field.  Note: The
130@samp{Language-Team} and @samp{Plural-Forms} fields are left unchanged.
131
132@item --color
133@itemx --color=@var{when}
134@opindex --color@r{, @code{msgcat} option}
135Specify whether or when to use colors and other text attributes.
136See @ref{The --color option} for details.
137
138@item --style=@var{style_file}
139@opindex --style@r{, @code{msgcat} option}
140Specify the CSS style rule file to use for @code{--color}.
141See @ref{The --style option} for details.
142
143@item --force-po
144@opindex --force-po@r{, @code{msgcat} option}
145Always write an output file even if it contains no message.
146
147@item -i
148@itemx --indent
149@opindex -i@r{, @code{msgcat} option}
150@opindex --indent@r{, @code{msgcat} option}
151Write the .po file using indented style.
152
153@item --no-location
154@opindex --no-location@r{, @code{msgcat} option}
155Do not write @samp{#: @var{filename}:@var{line}} lines.
156
157@item -n
158@itemx --add-location=@var{type}
159@opindex -n@r{, @code{msgcat} option}
160@opindex --add-location@r{, @code{msgcat} option}
161Generate @samp{#: @var{filename}:@var{line}} lines (default).
162
163The optional @var{type} can be either @samp{full}, @samp{file}, or
164@samp{never}.  If it is not given or @samp{full}, it generates the
165lines with both file name and line number.  If it is @samp{file}, the
166line number part is omitted.  If it is @samp{never}, it completely
167suppresses the lines (same as @code{--no-location}).
168
169@item --strict
170@opindex --strict@r{, @code{msgcat} option}
171Write out a strict Uniforum conforming PO file.  Note that this
172Uniforum format should be avoided because it doesn't support the
173GNU extensions.
174
175@item -p
176@itemx --properties-output
177@opindex -p@r{, @code{msgcat} option}
178@opindex --properties-output@r{, @code{msgcat} option}
179Write out a Java ResourceBundle in Java @code{.properties} syntax.  Note
180that this file format doesn't support plural forms and silently drops
181obsolete messages.
182
183@item --stringtable-output
184@opindex --stringtable-output@r{, @code{msgcat} option}
185Write out a NeXTstep/GNUstep localized resource file in @code{.strings} syntax.
186Note that this file format doesn't support plural forms.
187
188@item -w @var{number}
189@itemx --width=@var{number}
190@opindex -w@r{, @code{msgcat} option}
191@opindex --width@r{, @code{msgcat} option}
192Set the output page width.  Long strings in the output files will be
193split across multiple lines in order to ensure that each line's width
194(= number of screen columns) is less or equal to the given @var{number}.
195
196@item --no-wrap
197@opindex --no-wrap@r{, @code{msgcat} option}
198Do not break long message lines.  Message lines whose width exceeds the
199output page width will not be split into several lines.  Only file reference
200lines which are wider than the output page width will be split.
201
202@item -s
203@itemx --sort-output
204@opindex -s@r{, @code{msgcat} option}
205@opindex --sort-output@r{, @code{msgcat} option}
206@cindex sorting @code{msgcat} output
207Generate sorted output.  Note that using this option makes it much harder
208for the translator to understand each message's context.
209
210@item -F
211@itemx --sort-by-file
212@opindex -F@r{, @code{msgcat} option}
213@opindex --sort-by-file@r{, @code{msgcat} option}
214Sort output by file location.
215
216@end table
217
218@subsection Informative output
219
220@table @samp
221@item -h
222@itemx --help
223@opindex -h@r{, @code{msgcat} option}
224@opindex --help@r{, @code{msgcat} option}
225Display this help and exit.
226
227@item -V
228@itemx --version
229@opindex -V@r{, @code{msgcat} option}
230@opindex --version@r{, @code{msgcat} option}
231Output version information and exit.
232
233@end table
234