• 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 msgattrib
6@cindex @code{msgattrib} program, usage
7@example
8msgattrib [@var{option}] [@var{inputfile}]
9@end example
10
11@cindex filter messages according to attributes
12@cindex attribute manipulation
13The @code{msgattrib} program filters the messages of a translation catalog
14according to their attributes, and manipulates the attributes.
15
16@subsection Input file location
17
18@table @samp
19@item @var{inputfile}
20Input PO file.
21
22@item -D @var{directory}
23@itemx --directory=@var{directory}
24@opindex -D@r{, @code{msgattrib} option}
25@opindex --directory@r{, @code{msgattrib} option}
26Add @var{directory} to the list of directories.  Source files are
27searched relative to this list of directories.  The resulting @file{.po}
28file will be written relative to the current directory, though.
29
30@end table
31
32If no @var{inputfile} is given or if it is @samp{-}, standard input is read.
33
34@subsection Output file location
35
36@table @samp
37@item -o @var{file}
38@itemx --output-file=@var{file}
39@opindex -o@r{, @code{msgattrib} option}
40@opindex --output-file@r{, @code{msgattrib} option}
41Write output to specified file.
42
43@end table
44
45The results are written to standard output if no output file is specified
46or if it is @samp{-}.
47
48@subsection Message selection
49
50@table @samp
51@item --translated
52@opindex --translated@r{, @code{msgattrib} option}
53Keep translated messages, remove untranslated messages.
54
55@item --untranslated
56@opindex --untranslated@r{, @code{msgattrib} option}
57Keep untranslated messages, remove translated messages.
58
59@item --no-fuzzy
60@opindex --no-fuzzy@r{, @code{msgattrib} option}
61Remove
62@ifhtml
63‘fuzzy’
64@end ifhtml
65@ifnothtml
66`fuzzy'
67@end ifnothtml
68marked messages.
69
70@item --only-fuzzy
71@opindex --only-fuzzy@r{, @code{msgattrib} option}
72Keep
73@ifhtml
74‘fuzzy’
75@end ifhtml
76@ifnothtml
77`fuzzy'
78@end ifnothtml
79marked messages, remove all other messages.
80
81@item --no-obsolete
82@opindex --no-obsolete@r{, @code{msgattrib} option}
83Remove obsolete #~ messages.
84
85@item --only-obsolete
86@opindex --only-obsolete@r{, @code{msgattrib} option}
87Keep obsolete #~ messages, remove all other messages.
88
89@end table
90
91@subsection Attribute manipulation
92
93@cindex modify message attributes
94Attributes are modified after the message selection/removal has been
95performed.  If the @samp{--only-file} or @samp{--ignore-file} option is
96specified, the attribute modification is applied only to those messages
97that are listed in the @var{only-file} and not listed in the
98@var{ignore-file}.
99
100@table @samp
101@item --set-fuzzy
102@opindex --set-fuzzy@r{, @code{msgattrib} option}
103Set all messages
104@ifhtml
105‘fuzzy’.
106@end ifhtml
107@ifnothtml
108`fuzzy'.
109@end ifnothtml
110
111@item --clear-fuzzy
112@opindex --clear-fuzzy@r{, @code{msgattrib} option}
113Set all messages
114@ifhtml
115non-‘fuzzy’.
116@end ifhtml
117@ifnothtml
118non-`fuzzy'.
119@end ifnothtml
120
121@item --set-obsolete
122@opindex --set-obsolete@r{, @code{msgattrib} option}
123Set all messages obsolete.
124
125@item --clear-obsolete
126@opindex --clear-obsolete@r{, @code{msgattrib} option}
127Set all messages non-obsolete.
128
129@item --previous
130@opindex --previous@r{, @code{msgattrib} option}
131When setting
132@ifhtml
133‘fuzzy’
134@end ifhtml
135@ifnothtml
136`fuzzy'
137@end ifnothtml
138mark, keep ``previous msgid'' of translated messages.
139
140@item --clear-previous
141@opindex --clear-previous@r{, @code{msgattrib} option}
142Remove the ``previous msgid'' (@samp{#|}) comments from all messages.
143
144@item --empty
145@opindex --empty@r{, @code{msgattrib} option}
146When removing
147@ifhtml
148‘fuzzy’
149@end ifhtml
150@ifnothtml
151`fuzzy'
152@end ifnothtml
153mark, also set msgstr empty.
154
155@item --only-file=@var{file}
156@opindex --only-file@r{, @code{msgattrib} option}
157Limit the attribute changes to entries that are listed in @var{file}.
158@var{file} should be a PO or POT file.
159
160@item --ignore-file=@var{file}
161@opindex --ignore-file@r{, @code{msgattrib} option}
162Limit the attribute changes to entries that are not listed in @var{file}.
163@var{file} should be a PO or POT file.
164
165@item --fuzzy
166@opindex --fuzzy@r{, @code{msgattrib} option}
167Synonym for @samp{--only-fuzzy --clear-fuzzy}: It keeps only the fuzzy
168messages and removes their
169@ifhtml
170‘fuzzy’
171@end ifhtml
172@ifnothtml
173`fuzzy'
174@end ifnothtml
175mark.
176
177@item --obsolete
178@opindex --obsolete@r{, @code{msgattrib} option}
179Synonym for @samp{--only-obsolete --clear-obsolete}: It keeps only the
180obsolete messages and makes them non-obsolete.
181
182@end table
183
184@subsection Input file syntax
185
186@table @samp
187@item -P
188@itemx --properties-input
189@opindex -P@r{, @code{msgattrib} option}
190@opindex --properties-input@r{, @code{msgattrib} option}
191Assume the input file is a Java ResourceBundle in Java @code{.properties}
192syntax, not in PO file syntax.
193
194@item --stringtable-input
195@opindex --stringtable-input@r{, @code{msgattrib} option}
196Assume the input file is a NeXTstep/GNUstep localized resource file in
197@code{.strings} syntax, not in PO file syntax.
198
199@end table
200
201@subsection Output details
202
203@c --no-escape and --escape omitted on purpose.  They are not useful.
204
205@table @samp
206@item --color
207@itemx --color=@var{when}
208@opindex --color@r{, @code{msgattrib} option}
209Specify whether or when to use colors and other text attributes.
210See @ref{The --color option} for details.
211
212@item --style=@var{style_file}
213@opindex --style@r{, @code{msgattrib} option}
214Specify the CSS style rule file to use for @code{--color}.
215See @ref{The --style option} for details.
216
217@item --force-po
218@opindex --force-po@r{, @code{msgattrib} option}
219Always write an output file even if it contains no message.
220
221@item -i
222@itemx --indent
223@opindex -i@r{, @code{msgattrib} option}
224@opindex --indent@r{, @code{msgattrib} option}
225Write the .po file using indented style.
226
227@item --no-location
228@opindex --no-location@r{, @code{msgattrib} option}
229Do not write @samp{#: @var{filename}:@var{line}} lines.
230
231@item -n
232@itemx --add-location=@var{type}
233@opindex -n@r{, @code{msgattrib} option}
234@opindex --add-location@r{, @code{msgattrib} option}
235Generate @samp{#: @var{filename}:@var{line}} lines (default).
236
237The optional @var{type} can be either @samp{full}, @samp{file}, or
238@samp{never}.  If it is not given or @samp{full}, it generates the
239lines with both file name and line number.  If it is @samp{file}, the
240line number part is omitted.  If it is @samp{never}, it completely
241suppresses the lines (same as @code{--no-location}).
242
243@item --strict
244@opindex --strict@r{, @code{msgattrib} option}
245Write out a strict Uniforum conforming PO file.  Note that this
246Uniforum format should be avoided because it doesn't support the
247GNU extensions.
248
249@item -p
250@itemx --properties-output
251@opindex -p@r{, @code{msgattrib} option}
252@opindex --properties-output@r{, @code{msgattrib} option}
253Write out a Java ResourceBundle in Java @code{.properties} syntax.  Note
254that this file format doesn't support plural forms and silently drops
255obsolete messages.
256
257@item --stringtable-output
258@opindex --stringtable-output@r{, @code{msgattrib} option}
259Write out a NeXTstep/GNUstep localized resource file in @code{.strings} syntax.
260Note that this file format doesn't support plural forms.
261
262@item -w @var{number}
263@itemx --width=@var{number}
264@opindex -w@r{, @code{msgattrib} option}
265@opindex --width@r{, @code{msgattrib} option}
266Set the output page width.  Long strings in the output files will be
267split across multiple lines in order to ensure that each line's width
268(= number of screen columns) is less or equal to the given @var{number}.
269
270@item --no-wrap
271@opindex --no-wrap@r{, @code{msgattrib} option}
272Do not break long message lines.  Message lines whose width exceeds the
273output page width will not be split into several lines.  Only file reference
274lines which are wider than the output page width will be split.
275
276@item -s
277@itemx --sort-output
278@opindex -s@r{, @code{msgattrib} option}
279@opindex --sort-output@r{, @code{msgattrib} option}
280Generate sorted output.  Note that using this option makes it much harder
281for the translator to understand each message's context.
282
283@item -F
284@itemx --sort-by-file
285@opindex -F@r{, @code{msgattrib} option}
286@opindex --sort-by-file@r{, @code{msgattrib} option}
287Sort output by file location.
288
289@end table
290
291@subsection Informative output
292
293@table @samp
294@item -h
295@itemx --help
296@opindex -h@r{, @code{msgattrib} option}
297@opindex --help@r{, @code{msgattrib} option}
298Display this help and exit.
299
300@item -V
301@itemx --version
302@opindex -V@r{, @code{msgattrib} option}
303@opindex --version@r{, @code{msgattrib} option}
304Output version information and exit.
305
306@end table
307