Print this page
10067 Miscellaneous man page typos
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: Volker A. Brandt <vab@bb-c.de>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1/msgfmt.1.man.txt
+++ new/usr/src/man/man1/msgfmt.1.man.txt
1 1 MSGFMT(1) User Commands MSGFMT(1)
2 2
3 3
4 4
5 5 NAME
6 6 msgfmt - create a message object from a message file
7 7
8 8 SYNOPSIS
9 9 msgfmt [-D dir | --directory=dir]
10 10 [-f | --use-fuzzy] [-g]
11 11 [-o output-file | --output-file=output-file]
12 12 [-s] [--strict] [-v] [--verbose] filename.po...
13 13
14 14
15 15 DESCRIPTION
16 16 The msgfmt utility creates message object files from portable object
17 17 files (filename.po), without changing the portable object files.
18 18
19 19
20 20 The .po file contains messages displayed to users by system commands or
21 21 by application programs. .po files can be edited. The messages in these
22 22 files can be rewritten in any language supported by the system.
23 23
24 24
25 25 The xgettext(1) command can be used to create .po files from script or
26 26 programs.
27 27
28 28
29 29 msgfmt interprets data as characters according to the current setting
30 30 of the LC_CTYPE locale category or according to the codeset specified
31 31 in the .po file.
32 32
33 33 OPTIONS
34 34 The following options are supported:
35 35
36 36 -D dir
37 37 --directory=dir
38 38 Adds dir to the list for input files search.
39 39
40 40
41 41 -f
42 42 --use-fuzzy
43 43 Uses fuzzy entries in output. If this option
44 44 is not specified, fuzzy entries are not
45 45 included into the output. These options are
46 46 ignored if Solaris message catalogs are
47 47 processed.
48 48
49 49
50 50 -g
51 51 Directs the utility to generate the GNU-
52 52 compatible message catalog file. This option
53 53 cannot be specified with the -s option.
54 54
55 55
56 56 -o output-file
57 57 --output=output-file
58 58 Specifies the output file name as output-
59 59 file. All domain directives and duplicate
60 60 msgids in the .po file are ignored.
61 61
62 62
63 63 -s
64 64 Directs the utility to generate the Solaris
65 65 message catalog file. This option cannot be
66 66 specified with the -g option.
67 67
68 68
69 69 --strict
70 70 Directs the utility to append the suffix .mo
71 71 to the generating message object file name
72 72 if it doesn't have this suffix. This option
73 73 is ignored if Solaris message catalogs are
74 74 processed.
75 75
76 76
77 77 -v
78 78 --verbose
79 79 Verbose. Lists duplicate message identifiers
80 80 if Solaris message catalog files are
81 81 processed. Message strings are not
82 82 redefined.
83 83
84 84 If GNU-compatible message files are
85 85 processed, this option detects and diagnoses
86 86 input file anomalies which might represent
87 87 translation errors. The msgid and msgstr
88 88 strings are studied and compared. It is
89 89 considered abnormal if one string starts or
90 90 ends with a newline while the other does
91 91 not. Also, if the string represents a format
92 92 string used in a printf-like function, both
93 93 strings should have the same number of %
94 94 format specifiers, with matching types. If
95 95 the flag c-format appears in the special
96 96 comment '#' for this entry, a check is
97 97 performed.
98 98
99 99
100 100 USAGE
101 101 The format of portable object files (.po files) is defined as follows.
102 102 Each .po file contains one or more lines, with each line containing
103 103 either a comment or a statement. Comments start the line with a pound
104 104 sign (#) and end with the newline character. All comments (except
105 105 special comments described later) and empty lines are ignored. The
106 106 format of a statement is:
107 107
108 108 directive value
109 109
110 110
111 111
112 112
113 113 Each directive starts at the beginning of the line and is separated
114 114 from value by white space (such as one or more space or tab
115 115 characters). value consists of one or more quoted strings separated by
116 116 white space. Use any of the following types of directives for the
117 117 Solaris message file:
118 118
119 119 domain domainname
120 120 msgid message_identifier
121 121 msgstr message_string
122 122
123 123
124 124
125 125
126 126 For a GNU-compatible message file, use any of the following types of
127 127 directives:
128 128
129 129 domain domainname
130 130 msgid message_identifier
131 131 msgid_plural untranslated_string_plural
132 132 msgstr message_string
133 133 msgstr[n] message_string
134 134
135 135
136 136
137 137
138 138 The behavior of the domain directive is affected by the options used.
139 139 See OPTIONS for the behavior when the -o or --output-file options are
140 140 specified. If the -o or --output-file options are not specified, the
141 141 behavior of the domain directive is as follows:
142 142
143 143 o All msgids from the beginning of each .po file to the first
144 144 domain directive are put into a default message object file.
145 145 The default message object file is named messages.mo, if the
146 146 Solaris message catalog file format is used to generate the
147 147 message object file or if the --strict option is specified.
148 148 Otherwise, the default message object file is named
149 149 messages.
150 150
151 151 o When msgfmt encounters a domain domainname directive in the
152 152 .po file, all following msgids until the next domain
153 153 directive are put into the message object file, named
154 154 domainname.mo, if the Solaris message catalog file format is
155 155 used to generate the message object file or if the --strict
156 156 option is specified. Otherwise, the msgids are put into the
157 157 message object file named domainname.
158 158
159 159 o Duplicate msgids are defined in the scope of each domain.
160 160 That is, a msgid is considered a duplicate only if the
161 161 identical msgid exists in the same domain.
162 162
163 163 o All duplicate msgids are ignored.
164 164
165 165
166 166 The msgid directive specifies the value of a message identifier
167 167 associated with the directive that follows it. The msgid_plural
168 168 directive specifies the plural form message specified to the plural
169 169 message handling functions ngettext(), dngettext(), or dcngettext().
170 170 The message_identifier string identifies a target string to be used at
171 171 retrieval time. Each statement containing a msgid directive must be
172 172 followed by a statement containing a msgstr directive or msgstr[n]
↓ open down ↓ |
172 lines elided |
↑ open up ↑ |
173 173 directives.
174 174
175 175
176 176 The msgstr directive specifies the target string associated with the
177 177 message_identifier string declared in the immediately preceding msgid
178 178 directive.
179 179
180 180
181 181 The directive msgstr[n] (where n = 0, 1, 2, ...) specifies the target
182 182 string to be used with plural form handling functions ngettext(),
183 - dngettext(), and dcngetttext().
183 + dngettext(), and dcngettext().
184 184
185 185
186 186 Message strings can contain the escape sequences \n for newline, \t for
187 187 tab, \v for vertical tab, \b for backspace, \r for carriage return, \f
188 188 for formfeed, \ for backslash, \" for double quote, \a for alarm, \ddd
189 189 for octal bit pattern, and \xDD for hexadecimal bit pattern.
190 190
191 191
192 192 Comments for a GNU-compatible message file should be in one of the
193 193 following formats (the msgfmt utility will ignore these comments when
194 194 processing Solaris message files):
195 195
196 196 # translator-comments
197 197 #. automatic-comments
198 198 #: reference..
199 199 #, flag
200 200
201 201
202 202
203 203
204 204 The '#:' comments indicate the location of the msgid string in the
205 205 source files in filename:line format. The '#', '#.', and '#:' comments
206 206 are informative only and are silently ignored by the msgfmt utility.
207 207 The '#,' comments require one or more flags separated by the comma
208 208 character. The following flags can be specified:
209 209
210 210 fuzzy
211 211 This flag can be inserted by the translator. It shows
212 212 that the msgstr string might not be a correct
213 213 translation (anymore). Only the translator can judge if
214 214 the translation requires further modification or is
215 215 acceptable as is. Once satisfied with the translation,
216 216 the translator removes this fuzzy flag. If this flag is
217 217 specified, the msgfmt utility will not generate the
218 218 entry for the immediately following msgid in the output
219 219 message catalog.
220 220
221 221
222 222 c-format
223 223 no-c-format
224 224 The c-format flag indicates that the msgid string is
225 225 used as a format string by printf-like functions. In
226 226 case the c-format flag is given for a string, the msgfmt
227 227 utility does some more tests to check the validity of
228 228 the translation.
229 229
230 230
231 231
232 232 In the GNU-compatible message file, the msgid entry with empty string
233 233 ("") is called the header entry and treated specially. If the message
234 234 string for the header entry contains nplurals=value, the value
235 235 indicates the number of plural forms. For example, if nplurals=4, there
236 236 are four plural forms. If nplurals is defined, the same line should
237 237 contain plural=expression, separated by a semicolon character. The
238 238 expression is a C language expression to determine which version of
239 239 msgstr[n] is to be used based on the value of n, the last argument of
240 240 ngettext(), dngettext(), or dcngettext(). For example,
241 241
242 242 nplurals=2; plural= n == 1 ? 0 : 1
243 243
244 244
245 245
246 246
247 247 indicates that there are two plural forms in the language. msgstr[0] is
248 248 used if n == 1, otherwise msgstr[1] is used. For another example:
249 249
250 250 nplurals=3; plural= n == 1 ? 0 : n == 2 ? 1 : 2
251 251
252 252
253 253
254 254
255 255 indicates that there are three plural forms in the language. msgstr[0]
256 256 is used if n == 1, msgstr[1] is used if n == 2, otherwise msgstr[2] is
257 257 used.
258 258
259 259
260 260 If the header entry contains a charset=codeset string, the codeset is
261 261 used to indicate the codeset to be used to encode the message strings.
262 262 If the output string's codeset is different from the message string's
263 263 codeset, codeset conversion from the message string's codeset to the
264 264 output string's codeset will be performed upon the call of gettext(),
265 265 dgettext(), dcgettext(), ngettext(), dngettext(), and dcngettext() for
266 266 the GNU-compatible message catalogs. The output string's codeset is
267 267 determined by the current locale's codeset (the return value of
268 268 nl_langinfo(CODESET)) by default, and can be changed by the call of
269 269 bind_textdomain_codeset().
270 270
271 271 Message catalog file format
272 272 The msgfmt utility can generate the message object both in Solaris
273 273 message catalog file format and in GNU-compatible message catalog file
274 274 format. If the -s option is specified and the input file is a Solaris
275 275 .po file, the msgfmt utility generates the message object in Solaris
276 276 message catalog file format. If the -g option is specified and the
277 277 input file is a GNU .po file, the msgfmt utility generates the message
278 278 object in GNU-compatible message catalog file format. If neither the -s
279 279 nor -g option is specified, the msgfmt utility determines the message
280 280 catalog file format as follows:
281 281
282 282 o If the .po file contains a valid GNU header entry (having an
283 283 empty string for msgid), the msgfmt utility uses the GNU-
284 284 compatible message catalog file format.
285 285
286 286 o Otherwise, the msgfmt utility uses the Solaris message
287 287 catalog file format.
288 288
289 289
290 290 If the msgfmt utility determined that the Solaris message catalog file
291 291 format is used, as above, but found the .po file contains directives
292 292 that are specific to the GNU-compatible message catalog file format,
293 293 such as msgid_plural and msgstr[n], the msgfmt utility handles those
294 294 directives as invalid specifications.
295 295
296 296 EXAMPLES
297 297 Example 1 Creating message objects from message files
298 298
299 299
300 300 In this example, module1.po and module2.po are portable message objects
301 301 files.
302 302
303 303
304 304 example% cat module1.po
305 305 # default domain "messages.mo"
306 306 msgid "msg 1"
307 307 msgstr "msg 1 translation"
308 308 #
309 309 domain "help_domain"
310 310 msgid "help 2"
311 311 msgstr "help 2 translation"
312 312 #
313 313 domain "error_domain"
314 314 msgid "error 3"
315 315 msgstr "error 3 translation"
316 316 example% cat module2.po
317 317 # default domain "messages.mo"
318 318 msgid "mesg 4"
319 319 msgstr "mesg 4 translation"
320 320 #
321 321 domain "error_domain"
322 322 msgid "error 5"
323 323 msgstr "error 5 translation"
324 324 #
325 325 domain "window_domain"
326 326 msgid "window 6"
327 327 msgstr "window 6 translation"
328 328
329 329
330 330
331 331
332 332 The following command will produce the output files messages.mo,
333 333 help_domain.mo, and error_domain.mo in Solaris message catalog file
334 334 format:
335 335
336 336
337 337 example% msgfmt module1.po
338 338
339 339
340 340
341 341
342 342 The following command will produce the output files messages.mo,
343 343 help_domain.mo, error_domain.mo, and window_domain.mo in Solaris
344 344 message catalog file format:
345 345
346 346
347 347 example% msgfmt module1.po module2.po
348 348
349 349
350 350
351 351
352 352 The following command will produce the output file hello.mo in Solaris
353 353 message catalog file format:
354 354
355 355
356 356 example% msgfmt -o hello.mo module1.po module2.po
357 357
358 358
359 359
360 360 ENVIRONMENT VARIABLES
361 361 See environ(5) for descriptions of the following environmental
362 362 variables that affect the execution of msgfmt: LC_CTYPE, LC_MESSAGES,
363 363 and NLSPATH.
364 364
365 365 ATTRIBUTES
366 366 See attributes(5) for descriptions of the following attributes:
367 367
368 368
369 369
370 370
371 371 +---------------+-----------------+
372 372 |ATTRIBUTE TYPE | ATTRIBUTE VALUE |
373 373 +---------------+-----------------+
374 374 |CSI | Enabled |
375 375 +---------------+-----------------+
376 376
377 377 SEE ALSO
378 378 xgettext(1), gettext(3C), setlocale(3C), attributes(5), environ(5)
379 379
380 380 NOTES
381 381 Installing message catalogs under the C locale is pointless, since they
382 382 are ignored for the sake of efficiency.
383 383
384 384
385 385
386 386 September 17, 2001 MSGFMT(1)
↓ open down ↓ |
193 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX