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
+++ new/usr/src/man/man1/msgfmt.1
1 1 '\" te
2 2 .\" Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
3 3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 6 .TH MSGFMT 1 "Sep 17, 2001"
7 7 .SH NAME
8 8 msgfmt \- create a message object from a message file
↓ open down ↓ |
8 lines elided |
↑ open up ↑ |
9 9 .SH SYNOPSIS
10 10 .LP
11 11 .nf
12 12 \fBmsgfmt\fR [\fB-D\fR \fIdir\fR | \fB-\(midirectory\fR=\fIdir\fR]
13 13 [\fB-f\fR | \fB-\(miuse-fuzzy\fR] [\fB-g\fR]
14 14 [\fB-o\fR \fIoutput-file\fR | \fB-\(mioutput-file\fR=\fIoutput-file\fR]
15 15 [\fB-s\fR] [\fB-\(mistrict\fR] [\fB-v\fR] [\fB-\(miverbose\fR] \fIfilename\fR.po...
16 16 .fi
17 17
18 18 .SH DESCRIPTION
19 -.sp
20 19 .LP
21 20 The \fBmsgfmt\fR utility creates message object files from portable object
22 21 files (\fIfilename\fR\fB\&.po\fR), without changing the portable object files.
23 22 .sp
24 23 .LP
25 24 The \fB\&.po\fR file contains messages displayed to users by system commands or
26 25 by application programs. \fB\&.po\fR files can be edited. The messages in these
27 26 files can be rewritten in any language supported by the system.
28 27 .sp
29 28 .LP
30 29 The \fBxgettext\fR(1) command can be used to create \fB\&.po\fR files from
31 30 script or programs.
32 31 .sp
33 32 .LP
34 33 \fBmsgfmt\fR interprets data as characters according to the current setting of
35 34 the \fBLC_CTYPE\fR locale category or according to the codeset specified in the
36 35 \fB\&.po\fR file.
37 36 .SH OPTIONS
38 -.sp
39 37 .LP
40 38 The following options are supported:
41 39 .sp
42 40 .ne 2
43 41 .na
44 42 \fB\fB-D\fR \fIdir\fR\fR
45 43 .ad
46 44 .br
47 45 .na
48 46 \fB\fB-\(midirectory=\fR\fIdir\fR\fR
49 47 .ad
50 48 .RS 27n
51 49 Adds \fIdir\fR to the list for input files search.
52 50 .RE
53 51
54 52 .sp
55 53 .ne 2
56 54 .na
57 55 \fB\fB-f\fR\fR
58 56 .ad
59 57 .br
60 58 .na
61 59 \fB\fB-\(miuse-fuzzy\fR\fR
62 60 .ad
63 61 .RS 27n
64 62 Uses fuzzy entries in output. If this option is not specified, fuzzy entries
65 63 are not included into the output. These options are ignored if Solaris message
66 64 catalogs are processed.
67 65 .RE
68 66
69 67 .sp
70 68 .ne 2
71 69 .na
72 70 \fB\fB-g\fR\fR
73 71 .ad
74 72 .RS 27n
75 73 Directs the utility to generate the GNU-compatible message catalog file. This
76 74 option cannot be specified with the \fB-s\fR option.
77 75 .RE
78 76
79 77 .sp
80 78 .ne 2
81 79 .na
82 80 \fB\fB-o\fR \fIoutput-file\fR\fR
83 81 .ad
84 82 .br
85 83 .na
86 84 \fB\fB-\(mioutput=\fR\fIoutput-file\fR\fR
87 85 .ad
88 86 .RS 27n
89 87 Specifies the output file name as \fIoutput-file\fR. All domain directives and
90 88 duplicate msgids in the .\fBpo\fR file are ignored.
91 89 .RE
92 90
93 91 .sp
94 92 .ne 2
95 93 .na
96 94 \fB\fB-s\fR\fR
97 95 .ad
98 96 .RS 27n
99 97 Directs the utility to generate the Solaris message catalog file. This option
100 98 cannot be specified with the \fB-g\fR option.
101 99 .RE
102 100
103 101 .sp
104 102 .ne 2
105 103 .na
106 104 \fB\fB-\(mistrict\fR\fR
107 105 .ad
108 106 .RS 27n
109 107 Directs the utility to append the suffix \fB\&.mo\fR to the generating message
110 108 object file name if it doesn't have this suffix. This option is ignored if
111 109 Solaris message catalogs are processed.
112 110 .RE
113 111
114 112 .sp
115 113 .ne 2
116 114 .na
117 115 \fB\fB-v\fR\fR
118 116 .ad
119 117 .br
120 118 .na
121 119 \fB\fB-\(miverbose\fR\fR
122 120 .ad
123 121 .RS 27n
124 122 Verbose. Lists duplicate message identifiers if Solaris message catalog files
125 123 are processed. Message strings are not redefined.
126 124 .sp
127 125 If GNU-compatible message files are processed, this option detects and
↓ open down ↓ |
79 lines elided |
↑ open up ↑ |
128 126 diagnoses input file anomalies which might represent translation errors. The
129 127 msgid and msgstr strings are studied and compared. It is considered abnormal if
130 128 one string starts or ends with a newline while the other does not. Also, if the
131 129 string represents a format string used in a printf-like function, both strings
132 130 should have the same number of % format specifiers, with matching types. If the
133 131 flag \fBc-format\fR appears in the special comment '\fB#\fR' for this entry, a
134 132 check is performed.
135 133 .RE
136 134
137 135 .SH USAGE
138 -.sp
139 136 .LP
140 137 The format of portable object files (\fB\&.po\fR files) is defined as follows.
141 138 Each \fB\&.po\fR file contains one or more lines, with each line containing
142 139 either a comment or a statement. Comments start the line with a pound sign
143 140 (\fB#\fR) and end with the newline character. All comments (except special
144 141 comments described later) and empty lines are ignored. The format of a
145 142 statement is:
146 143 .sp
147 144 .in +2
148 145 .nf
149 146 \fIdirective\fR \fIvalue\fR
150 147 .fi
151 148 .in -2
152 149 .sp
153 150
154 151 .sp
155 152 .LP
156 153 Each \fIdirective\fR starts at the beginning of the line and is separated from
157 154 \fIvalue\fR by white space (such as one or more space or tab characters).
158 155 \fIvalue\fR consists of one or more quoted strings separated by white space.
159 156 Use any of the following types of directives for the Solaris message file:
160 157 .sp
161 158 .in +2
162 159 .nf
163 160 domain \fIdomainname\fR
164 161 msgid \fImessage_identifier\fR
165 162 msgstr \fImessage_string\fR
166 163 .fi
167 164 .in -2
168 165 .sp
169 166
170 167 .sp
171 168 .LP
172 169 For a GNU-compatible message file, use any of the following types of
173 170 directives:
174 171 .sp
175 172 .in +2
176 173 .nf
177 174 domain \fIdomainname\fR
178 175 msgid \fImessage_identifier\fR
179 176 msgid_plural \fIuntranslated_string_plural\fR
180 177 msgstr \fImessage_string\fR
181 178 msgstr[\fIn\fR] \fImessage_string\fR
182 179 .fi
183 180 .in -2
184 181 .sp
185 182
186 183 .sp
187 184 .LP
188 185 The behavior of the \fBdomain\fR directive is affected by the options used. See
189 186 OPTIONS for the behavior when the \fB-o\fR or \fB-\(mioutput-file\fR options
190 187 are specified. If the \fB-o\fR or \fB-\(mioutput-file\fR options are not
191 188 specified, the behavior of the \fBdomain\fR directive is as follows:
192 189 .RS +4
193 190 .TP
194 191 .ie t \(bu
195 192 .el o
196 193 All msgids from the beginning of each \fB\&.po\fR file to the first
197 194 \fBdomain\fR directive are put into a default message object file. The default
198 195 message object file is named \fBmessages.mo\fR, if the Solaris message catalog
199 196 file format is used to generate the message object file or if the
200 197 \fB-\(mistrict\fR option is specified. Otherwise, the default message object
201 198 file is named \fBmessages\fR.
202 199 .RE
203 200 .RS +4
204 201 .TP
205 202 .ie t \(bu
206 203 .el o
207 204 When \fBmsgfmt\fR encounters a \fBdomain\fR \fIdomainname\fR directive in the
208 205 \fB\&.po\fR file, all following msgids until the next \fBdomain\fR directive
209 206 are put into the message object file, named \fBdomainname.mo\fR, if the Solaris
210 207 message catalog file format is used to generate the message object file or if
211 208 the \fB-\(mistrict\fR option is specified. Otherwise, the msgids are put into
212 209 the message object file named \fBdomainname\fR.
213 210 .RE
214 211 .RS +4
215 212 .TP
216 213 .ie t \(bu
217 214 .el o
218 215 Duplicate msgids are defined in the scope of each domain. That is, a msgid is
219 216 considered a duplicate only if the identical msgid exists in the same domain.
220 217 .RE
221 218 .RS +4
222 219 .TP
223 220 .ie t \(bu
224 221 .el o
225 222 All duplicate msgids are ignored.
226 223 .RE
227 224 .sp
228 225 .LP
229 226 The \fBmsgid\fR directive specifies the value of a message identifier
230 227 associated with the directive that follows it. The \fBmsgid_plural\fR directive
231 228 specifies the plural form message specified to the plural message handling
232 229 functions \fBngettext()\fR, \fBdngettext()\fR, or \fBdcngettext()\fR. The
233 230 \fImessage_identifier\fR string identifies a target string to be used at
234 231 retrieval time. Each statement containing a \fBmsgid\fR directive must be
235 232 followed by a statement containing a \fBmsgstr\fR directive or
↓ open down ↓ |
87 lines elided |
↑ open up ↑ |
236 233 \fBmsgstr\fR[\fIn\fR] directives.
237 234 .sp
238 235 .LP
239 236 The \fBmsgstr\fR directive specifies the target string associated with the
240 237 \fImessage_identifier\fR string declared in the immediately preceding
241 238 \fBmsgid\fR directive.
242 239 .sp
243 240 .LP
244 241 The directive \fBmsgstr\fR[\fIn\fR] (where \fIn\fR = 0, 1, 2, ...) specifies
245 242 the target string to be used with plural form handling functions
246 -\fBngettext()\fR, \fBdngettext()\fR, and \fBdcngetttext()\fR.
243 +\fBngettext()\fR, \fBdngettext()\fR, and \fBdcngettext()\fR.
247 244 .sp
248 245 .LP
249 246 Message strings can contain the escape sequences \fB\\n\fR for newline,
250 247 \fB\\t\fR for tab, \fB\\v\fR for vertical tab, \fB\\b\fR for backspace,
251 248 \fB\\r\fR for carriage return, \fB\\f\fR for formfeed, \fB\\\fR for backslash,
252 249 \fB\\"\fR for double quote, \fB\\a\fR for alarm, \fB\\ddd\fR for octal bit
253 250 pattern, and \fB\\xDD\fR for hexadecimal bit pattern.
254 251 .sp
255 252 .LP
256 253 Comments for a GNU-compatible message file should be in one of the following
257 254 formats (the \fBmsgfmt\fR utility will ignore these comments when processing
258 255 Solaris message files):
259 256 .sp
260 257 .in +2
261 258 .nf
262 259 # \fItranslator-comments\fR
263 260 #. \fIautomatic-comments\fR
264 261 #: \fIreference\fR..
265 262 #, \fIflag\fR
266 263 .fi
267 264 .in -2
268 265 .sp
269 266
270 267 .sp
271 268 .LP
272 269 The '\fB#:\fR' comments indicate the location of the msgid string in the source
273 270 files in \fIfilename\fR:\fIline\fR format. The '\fB#\fR', '\fB#.\fR',
274 271 and '\fB#:\fR' comments are informative only and are silently ignored by the
275 272 \fBmsgfmt\fR utility. The '\fB#,\fR' comments require one or more flags
276 273 separated by the comma character. The following \fIflag\fRs can be specified:
277 274 .sp
278 275 .ne 2
279 276 .na
280 277 \fB\fBfuzzy\fR\fR
281 278 .ad
282 279 .RS 15n
283 280 This flag can be inserted by the translator. It shows that the \fBmsgstr\fR
284 281 string might not be a correct translation (anymore). Only the translator can
285 282 judge if the translation requires further modification or is acceptable as is.
286 283 Once satisfied with the translation, the translator removes this \fBfuzzy\fR
287 284 flag. If this flag is specified, the \fBmsgfmt\fR utility will not generate the
288 285 entry for the immediately following msgid in the output message catalog.
289 286 .RE
290 287
291 288 .sp
292 289 .ne 2
293 290 .na
294 291 \fB\fBc-format\fR\fR
295 292 .ad
296 293 .br
297 294 .na
298 295 \fB\fBno-c-format\fR\fR
299 296 .ad
300 297 .RS 15n
301 298 The \fBc-format\fR flag indicates that the \fBmsgid\fR string is used as a
302 299 format string by printf-like functions. In case the \fBc-format\fR flag is
303 300 given for a string, the \fBmsgfmt\fR utility does some more tests to check the
304 301 validity of the translation.
305 302 .RE
306 303
307 304 .sp
308 305 .LP
309 306 In the GNU-compatible message file, the \fBmsgid\fR entry with empty string
310 307 ("") is called the header entry and treated specially. If the message string
311 308 for the header entry contains \fBnplurals\fR=\fIvalue\fR, the value indicates
312 309 the number of plural forms. For example, if \fBnplurals\fR=4, there are four
313 310 plural forms. If \fBnplurals\fR is defined, the same line should contain
314 311 \fBplural=\fR\fIexpression\fR, separated by a semicolon character. The
315 312 \fIexpression\fR is a C language expression to determine which version of
316 313 \fBmsgstr\fR[\fIn\fR] is to be used based on the value of \fIn\fR, the last
317 314 argument of \fBngettext()\fR, \fBdngettext()\fR, or \fBdcngettext()\fR. For
318 315 example,
319 316 .sp
320 317 .in +2
321 318 .nf
322 319 nplurals=2; plural= n == 1 ? 0 : 1
323 320 .fi
324 321 .in -2
325 322 .sp
326 323
327 324 .sp
328 325 .LP
329 326 indicates that there are two plural forms in the language. msgstr[0] is used if
330 327 n == 1, otherwise msgstr[1] is used. For another example:
331 328 .sp
332 329 .in +2
333 330 .nf
334 331 nplurals=3; plural= n == 1 ? 0 : n == 2 ? 1 : 2
335 332 .fi
336 333 .in -2
337 334 .sp
338 335
339 336 .sp
340 337 .LP
341 338 indicates that there are three plural forms in the language. msgstr[0] is used
342 339 if n == 1, msgstr[1] is used if n == 2, otherwise msgstr[2] is used.
343 340 .sp
344 341 .LP
345 342 If the header entry contains a \fBcharset\fR=\fIcodeset\fR string, the
↓ open down ↓ |
89 lines elided |
↑ open up ↑ |
346 343 \fIcodeset\fR is used to indicate the codeset to be used to encode the message
347 344 strings. If the output string's codeset is different from the message string's
348 345 codeset, codeset conversion from the message string's codeset to the output
349 346 string's codeset will be performed upon the call of \fBgettext()\fR,
350 347 \fBdgettext()\fR, \fBdcgettext()\fR, \fBngettext()\fR, \fBdngettext()\fR, and
351 348 \fBdcngettext()\fR for the GNU-compatible message catalogs. The output string's
352 349 codeset is determined by the current locale's codeset (the return value of
353 350 \fBnl_langinfo(CODESET\fR)) by default, and can be changed by the call of
354 351 \fBbind_textdomain_codeset()\fR.
355 352 .SS "Message catalog file format"
356 -.sp
357 353 .LP
358 354 The \fBmsgfmt\fR utility can generate the message object both in Solaris
359 355 message catalog file format and in GNU-compatible message catalog file format.
360 356 If the \fB-s\fR option is specified and the input file is a Solaris \fB\&.po\fR
361 357 file, the \fBmsgfmt\fR utility generates the message object in Solaris message
362 358 catalog file format. If the \fB-g\fR option is specified and the input file is
363 359 a GNU \fB\&.po\fR file, the \fBmsgfmt\fR utility generates the message object
364 360 in GNU-compatible message catalog file format. If neither the \fB-s\fR nor
365 361 \fB-g\fR option is specified, the \fBmsgfmt\fR utility determines the message
366 362 catalog file format as follows:
367 363 .RS +4
368 364 .TP
369 365 .ie t \(bu
370 366 .el o
371 367 If the \fB\&.po\fR file contains a valid GNU header entry (having an empty
372 368 string for \fBmsgid\fR), the \fBmsgfmt\fR utility uses the GNU-compatible
373 369 message catalog file format.
374 370 .RE
375 371 .RS +4
376 372 .TP
377 373 .ie t \(bu
378 374 .el o
379 375 Otherwise, the \fBmsgfmt\fR utility uses the Solaris message catalog file
380 376 format.
381 377 .RE
382 378 .sp
383 379 .LP
384 380 If the \fBmsgfmt\fR utility determined that the Solaris message catalog file
385 381 format is used, as above, but found the \fB\&.po\fR file contains directives
386 382 that are specific to the GNU-compatible message catalog file format, such as
387 383 \fBmsgid_plural\fR and \fBmsgstr\fR[\fIn\fR], the \fBmsgfmt\fR utility handles
388 384 those directives as invalid specifications.
389 385 .SH EXAMPLES
390 386 .LP
391 387 \fBExample 1 \fRCreating message objects from message files
392 388 .sp
393 389 .LP
394 390 In this example, \fBmodule1.po\fR and \fBmodule2.po\fR are portable message
395 391 objects files.
396 392
397 393 .sp
398 394 .in +2
399 395 .nf
400 396 example% \fBcat module1.po\fR
401 397 # default domain "messages.mo"
402 398 msgid "msg 1"
403 399 msgstr "msg 1 translation"
404 400 #
405 401 domain "help_domain"
406 402 msgid "help 2"
407 403 msgstr "help 2 translation"
408 404 #
409 405 domain "error_domain"
410 406 msgid "error 3"
411 407 msgstr "error 3 translation"
412 408 example% \fBcat module2.po\fR
413 409 # default domain "messages.mo"
414 410 msgid "mesg 4"
415 411 msgstr "mesg 4 translation"
416 412 #
417 413 domain "error_domain"
418 414 msgid "error 5"
419 415 msgstr "error 5 translation"
420 416 #
421 417 domain "window_domain"
422 418 msgid "window 6"
423 419 msgstr "window 6 translation"
424 420 .fi
425 421 .in -2
426 422 .sp
427 423
428 424 .sp
429 425 .LP
430 426 The following command will produce the output files \fBmessages.mo\fR,
431 427 \fBhelp_domain.mo\fR, and \fBerror_domain.mo\fR in Solaris message catalog file
432 428 format:
433 429
434 430 .sp
435 431 .in +2
436 432 .nf
437 433 example% \fBmsgfmt module1.po\fR
438 434 .fi
439 435 .in -2
440 436 .sp
441 437
442 438 .sp
443 439 .LP
444 440 The following command will produce the output files \fBmessages.mo\fR,
445 441 \fBhelp_domain.mo\fR, \fBerror_domain.mo\fR, and \fBwindow_domain.mo\fR in
446 442 Solaris message catalog file format:
447 443
448 444 .sp
449 445 .in +2
450 446 .nf
451 447 example% \fBmsgfmt module1.po module2.po\fR
452 448 .fi
453 449 .in -2
454 450 .sp
455 451
456 452 .sp
457 453 .LP
458 454 The following command will produce the output file \fBhello.mo\fR in Solaris
459 455 message catalog file format:
↓ open down ↓ |
93 lines elided |
↑ open up ↑ |
460 456
461 457 .sp
462 458 .in +2
463 459 .nf
464 460 example% \fBmsgfmt -o hello.mo module1.po module2.po\fR
465 461 .fi
466 462 .in -2
467 463 .sp
468 464
469 465 .SH ENVIRONMENT VARIABLES
470 -.sp
471 466 .LP
472 467 See \fBenviron\fR(5) for descriptions of the following environmental variables
473 468 that affect the execution of \fBmsgfmt\fR: \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR,
474 469 and \fBNLSPATH\fR.
475 470 .SH ATTRIBUTES
476 -.sp
477 471 .LP
478 472 See \fBattributes\fR(5) for descriptions of the following attributes:
479 473 .sp
480 474
481 475 .sp
482 476 .TS
483 477 box;
484 478 c | c
485 479 l | l .
486 480 ATTRIBUTE TYPE ATTRIBUTE VALUE
487 481 _
488 482 CSI Enabled
489 483 .TE
490 484
491 485 .SH SEE ALSO
492 -.sp
493 486 .LP
494 487 \fBxgettext\fR(1), \fBgettext\fR(3C), \fBsetlocale\fR(3C), \fBattributes\fR(5),
495 488 \fBenviron\fR(5)
496 489 .SH NOTES
497 -.sp
498 490 .LP
499 491 Installing message catalogs under the C locale is pointless, since they are
500 492 ignored for the sake of efficiency.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX