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