1 '\" te
2 .\" Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
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 .\" 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 .\" 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 .TH MSGFMT 1 "Sep 17, 2001"
7 .SH NAME
8 msgfmt \- create a message object from a message file
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBmsgfmt\fR [\fB-D\fR \fIdir\fR | \fB-\(midirectory\fR=\fIdir\fR]
13 [\fB-f\fR | \fB-\(miuse-fuzzy\fR] [\fB-g\fR]
14 [\fB-o\fR \fIoutput-file\fR | \fB-\(mioutput-file\fR=\fIoutput-file\fR]
15 [\fB-s\fR] [\fB-\(mistrict\fR] [\fB-v\fR] [\fB-\(miverbose\fR] \fIfilename\fR.po...
16 .fi
17
18 .SH DESCRIPTION
19 .sp
20 .LP
21 The \fBmsgfmt\fR utility creates message object files from portable object
22 files (\fIfilename\fR\fB\&.po\fR), without changing the portable object files.
23 .sp
24 .LP
25 The \fB\&.po\fR file contains messages displayed to users by system commands or
26 by application programs. \fB\&.po\fR files can be edited. The messages in these
27 files can be rewritten in any language supported by the system.
28 .sp
29 .LP
30 The \fBxgettext\fR(1) command can be used to create \fB\&.po\fR files from
31 script or programs.
32 .sp
33 .LP
34 \fBmsgfmt\fR interprets data as characters according to the current setting of
35 the \fBLC_CTYPE\fR locale category or according to the codeset specified in the
36 \fB\&.po\fR file.
37 .SH OPTIONS
38 .sp
39 .LP
40 The following options are supported:
41 .sp
42 .ne 2
43 .na
44 \fB\fB-D\fR \fIdir\fR\fR
45 .ad
46 .br
47 .na
48 \fB\fB-\(midirectory=\fR\fIdir\fR\fR
49 .ad
50 .RS 27n
51 Adds \fIdir\fR to the list for input files search.
52 .RE
53
54 .sp
55 .ne 2
56 .na
57 \fB\fB-f\fR\fR
58 .ad
118 .ad
119 .br
120 .na
121 \fB\fB-\(miverbose\fR\fR
122 .ad
123 .RS 27n
124 Verbose. Lists duplicate message identifiers if Solaris message catalog files
125 are processed. Message strings are not redefined.
126 .sp
127 If GNU-compatible message files are processed, this option detects and
128 diagnoses input file anomalies which might represent translation errors. The
129 msgid and msgstr strings are studied and compared. It is considered abnormal if
130 one string starts or ends with a newline while the other does not. Also, if the
131 string represents a format string used in a printf-like function, both strings
132 should have the same number of % format specifiers, with matching types. If the
133 flag \fBc-format\fR appears in the special comment '\fB#\fR' for this entry, a
134 check is performed.
135 .RE
136
137 .SH USAGE
138 .sp
139 .LP
140 The format of portable object files (\fB\&.po\fR files) is defined as follows.
141 Each \fB\&.po\fR file contains one or more lines, with each line containing
142 either a comment or a statement. Comments start the line with a pound sign
143 (\fB#\fR) and end with the newline character. All comments (except special
144 comments described later) and empty lines are ignored. The format of a
145 statement is:
146 .sp
147 .in +2
148 .nf
149 \fIdirective\fR \fIvalue\fR
150 .fi
151 .in -2
152 .sp
153
154 .sp
155 .LP
156 Each \fIdirective\fR starts at the beginning of the line and is separated from
157 \fIvalue\fR by white space (such as one or more space or tab characters).
158 \fIvalue\fR consists of one or more quoted strings separated by white space.
226 .RE
227 .sp
228 .LP
229 The \fBmsgid\fR directive specifies the value of a message identifier
230 associated with the directive that follows it. The \fBmsgid_plural\fR directive
231 specifies the plural form message specified to the plural message handling
232 functions \fBngettext()\fR, \fBdngettext()\fR, or \fBdcngettext()\fR. The
233 \fImessage_identifier\fR string identifies a target string to be used at
234 retrieval time. Each statement containing a \fBmsgid\fR directive must be
235 followed by a statement containing a \fBmsgstr\fR directive or
236 \fBmsgstr\fR[\fIn\fR] directives.
237 .sp
238 .LP
239 The \fBmsgstr\fR directive specifies the target string associated with the
240 \fImessage_identifier\fR string declared in the immediately preceding
241 \fBmsgid\fR directive.
242 .sp
243 .LP
244 The directive \fBmsgstr\fR[\fIn\fR] (where \fIn\fR = 0, 1, 2, ...) specifies
245 the target string to be used with plural form handling functions
246 \fBngettext()\fR, \fBdngettext()\fR, and \fBdcngetttext()\fR.
247 .sp
248 .LP
249 Message strings can contain the escape sequences \fB\\n\fR for newline,
250 \fB\\t\fR for tab, \fB\\v\fR for vertical tab, \fB\\b\fR for backspace,
251 \fB\\r\fR for carriage return, \fB\\f\fR for formfeed, \fB\\\fR for backslash,
252 \fB\\"\fR for double quote, \fB\\a\fR for alarm, \fB\\ddd\fR for octal bit
253 pattern, and \fB\\xDD\fR for hexadecimal bit pattern.
254 .sp
255 .LP
256 Comments for a GNU-compatible message file should be in one of the following
257 formats (the \fBmsgfmt\fR utility will ignore these comments when processing
258 Solaris message files):
259 .sp
260 .in +2
261 .nf
262 # \fItranslator-comments\fR
263 #. \fIautomatic-comments\fR
264 #: \fIreference\fR..
265 #, \fIflag\fR
266 .fi
336 .in -2
337 .sp
338
339 .sp
340 .LP
341 indicates that there are three plural forms in the language. msgstr[0] is used
342 if n == 1, msgstr[1] is used if n == 2, otherwise msgstr[2] is used.
343 .sp
344 .LP
345 If the header entry contains a \fBcharset\fR=\fIcodeset\fR string, the
346 \fIcodeset\fR is used to indicate the codeset to be used to encode the message
347 strings. If the output string's codeset is different from the message string's
348 codeset, codeset conversion from the message string's codeset to the output
349 string's codeset will be performed upon the call of \fBgettext()\fR,
350 \fBdgettext()\fR, \fBdcgettext()\fR, \fBngettext()\fR, \fBdngettext()\fR, and
351 \fBdcngettext()\fR for the GNU-compatible message catalogs. The output string's
352 codeset is determined by the current locale's codeset (the return value of
353 \fBnl_langinfo(CODESET\fR)) by default, and can be changed by the call of
354 \fBbind_textdomain_codeset()\fR.
355 .SS "Message catalog file format"
356 .sp
357 .LP
358 The \fBmsgfmt\fR utility can generate the message object both in Solaris
359 message catalog file format and in GNU-compatible message catalog file format.
360 If the \fB-s\fR option is specified and the input file is a Solaris \fB\&.po\fR
361 file, the \fBmsgfmt\fR utility generates the message object in Solaris message
362 catalog file format. If the \fB-g\fR option is specified and the input file is
363 a GNU \fB\&.po\fR file, the \fBmsgfmt\fR utility generates the message object
364 in GNU-compatible message catalog file format. If neither the \fB-s\fR nor
365 \fB-g\fR option is specified, the \fBmsgfmt\fR utility determines the message
366 catalog file format as follows:
367 .RS +4
368 .TP
369 .ie t \(bu
370 .el o
371 If the \fB\&.po\fR file contains a valid GNU header entry (having an empty
372 string for \fBmsgid\fR), the \fBmsgfmt\fR utility uses the GNU-compatible
373 message catalog file format.
374 .RE
375 .RS +4
376 .TP
450 .nf
451 example% \fBmsgfmt module1.po module2.po\fR
452 .fi
453 .in -2
454 .sp
455
456 .sp
457 .LP
458 The following command will produce the output file \fBhello.mo\fR in Solaris
459 message catalog file format:
460
461 .sp
462 .in +2
463 .nf
464 example% \fBmsgfmt -o hello.mo module1.po module2.po\fR
465 .fi
466 .in -2
467 .sp
468
469 .SH ENVIRONMENT VARIABLES
470 .sp
471 .LP
472 See \fBenviron\fR(5) for descriptions of the following environmental variables
473 that affect the execution of \fBmsgfmt\fR: \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR,
474 and \fBNLSPATH\fR.
475 .SH ATTRIBUTES
476 .sp
477 .LP
478 See \fBattributes\fR(5) for descriptions of the following attributes:
479 .sp
480
481 .sp
482 .TS
483 box;
484 c | c
485 l | l .
486 ATTRIBUTE TYPE ATTRIBUTE VALUE
487 _
488 CSI Enabled
489 .TE
490
491 .SH SEE ALSO
492 .sp
493 .LP
494 \fBxgettext\fR(1), \fBgettext\fR(3C), \fBsetlocale\fR(3C), \fBattributes\fR(5),
495 \fBenviron\fR(5)
496 .SH NOTES
497 .sp
498 .LP
499 Installing message catalogs under the C locale is pointless, since they are
500 ignored for the sake of efficiency.
|
1 '\" te
2 .\" Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
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 .\" 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 .\" 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 .TH MSGFMT 1 "Sep 17, 2001"
7 .SH NAME
8 msgfmt \- create a message object from a message file
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBmsgfmt\fR [\fB-D\fR \fIdir\fR | \fB-\(midirectory\fR=\fIdir\fR]
13 [\fB-f\fR | \fB-\(miuse-fuzzy\fR] [\fB-g\fR]
14 [\fB-o\fR \fIoutput-file\fR | \fB-\(mioutput-file\fR=\fIoutput-file\fR]
15 [\fB-s\fR] [\fB-\(mistrict\fR] [\fB-v\fR] [\fB-\(miverbose\fR] \fIfilename\fR.po...
16 .fi
17
18 .SH DESCRIPTION
19 .LP
20 The \fBmsgfmt\fR utility creates message object files from portable object
21 files (\fIfilename\fR\fB\&.po\fR), without changing the portable object files.
22 .sp
23 .LP
24 The \fB\&.po\fR file contains messages displayed to users by system commands or
25 by application programs. \fB\&.po\fR files can be edited. The messages in these
26 files can be rewritten in any language supported by the system.
27 .sp
28 .LP
29 The \fBxgettext\fR(1) command can be used to create \fB\&.po\fR files from
30 script or programs.
31 .sp
32 .LP
33 \fBmsgfmt\fR interprets data as characters according to the current setting of
34 the \fBLC_CTYPE\fR locale category or according to the codeset specified in the
35 \fB\&.po\fR file.
36 .SH OPTIONS
37 .LP
38 The following options are supported:
39 .sp
40 .ne 2
41 .na
42 \fB\fB-D\fR \fIdir\fR\fR
43 .ad
44 .br
45 .na
46 \fB\fB-\(midirectory=\fR\fIdir\fR\fR
47 .ad
48 .RS 27n
49 Adds \fIdir\fR to the list for input files search.
50 .RE
51
52 .sp
53 .ne 2
54 .na
55 \fB\fB-f\fR\fR
56 .ad
116 .ad
117 .br
118 .na
119 \fB\fB-\(miverbose\fR\fR
120 .ad
121 .RS 27n
122 Verbose. Lists duplicate message identifiers if Solaris message catalog files
123 are processed. Message strings are not redefined.
124 .sp
125 If GNU-compatible message files are processed, this option detects and
126 diagnoses input file anomalies which might represent translation errors. The
127 msgid and msgstr strings are studied and compared. It is considered abnormal if
128 one string starts or ends with a newline while the other does not. Also, if the
129 string represents a format string used in a printf-like function, both strings
130 should have the same number of % format specifiers, with matching types. If the
131 flag \fBc-format\fR appears in the special comment '\fB#\fR' for this entry, a
132 check is performed.
133 .RE
134
135 .SH USAGE
136 .LP
137 The format of portable object files (\fB\&.po\fR files) is defined as follows.
138 Each \fB\&.po\fR file contains one or more lines, with each line containing
139 either a comment or a statement. Comments start the line with a pound sign
140 (\fB#\fR) and end with the newline character. All comments (except special
141 comments described later) and empty lines are ignored. The format of a
142 statement is:
143 .sp
144 .in +2
145 .nf
146 \fIdirective\fR \fIvalue\fR
147 .fi
148 .in -2
149 .sp
150
151 .sp
152 .LP
153 Each \fIdirective\fR starts at the beginning of the line and is separated from
154 \fIvalue\fR by white space (such as one or more space or tab characters).
155 \fIvalue\fR consists of one or more quoted strings separated by white space.
223 .RE
224 .sp
225 .LP
226 The \fBmsgid\fR directive specifies the value of a message identifier
227 associated with the directive that follows it. The \fBmsgid_plural\fR directive
228 specifies the plural form message specified to the plural message handling
229 functions \fBngettext()\fR, \fBdngettext()\fR, or \fBdcngettext()\fR. The
230 \fImessage_identifier\fR string identifies a target string to be used at
231 retrieval time. Each statement containing a \fBmsgid\fR directive must be
232 followed by a statement containing a \fBmsgstr\fR directive or
233 \fBmsgstr\fR[\fIn\fR] directives.
234 .sp
235 .LP
236 The \fBmsgstr\fR directive specifies the target string associated with the
237 \fImessage_identifier\fR string declared in the immediately preceding
238 \fBmsgid\fR directive.
239 .sp
240 .LP
241 The directive \fBmsgstr\fR[\fIn\fR] (where \fIn\fR = 0, 1, 2, ...) specifies
242 the target string to be used with plural form handling functions
243 \fBngettext()\fR, \fBdngettext()\fR, and \fBdcngettext()\fR.
244 .sp
245 .LP
246 Message strings can contain the escape sequences \fB\\n\fR for newline,
247 \fB\\t\fR for tab, \fB\\v\fR for vertical tab, \fB\\b\fR for backspace,
248 \fB\\r\fR for carriage return, \fB\\f\fR for formfeed, \fB\\\fR for backslash,
249 \fB\\"\fR for double quote, \fB\\a\fR for alarm, \fB\\ddd\fR for octal bit
250 pattern, and \fB\\xDD\fR for hexadecimal bit pattern.
251 .sp
252 .LP
253 Comments for a GNU-compatible message file should be in one of the following
254 formats (the \fBmsgfmt\fR utility will ignore these comments when processing
255 Solaris message files):
256 .sp
257 .in +2
258 .nf
259 # \fItranslator-comments\fR
260 #. \fIautomatic-comments\fR
261 #: \fIreference\fR..
262 #, \fIflag\fR
263 .fi
333 .in -2
334 .sp
335
336 .sp
337 .LP
338 indicates that there are three plural forms in the language. msgstr[0] is used
339 if n == 1, msgstr[1] is used if n == 2, otherwise msgstr[2] is used.
340 .sp
341 .LP
342 If the header entry contains a \fBcharset\fR=\fIcodeset\fR string, the
343 \fIcodeset\fR is used to indicate the codeset to be used to encode the message
344 strings. If the output string's codeset is different from the message string's
345 codeset, codeset conversion from the message string's codeset to the output
346 string's codeset will be performed upon the call of \fBgettext()\fR,
347 \fBdgettext()\fR, \fBdcgettext()\fR, \fBngettext()\fR, \fBdngettext()\fR, and
348 \fBdcngettext()\fR for the GNU-compatible message catalogs. The output string's
349 codeset is determined by the current locale's codeset (the return value of
350 \fBnl_langinfo(CODESET\fR)) by default, and can be changed by the call of
351 \fBbind_textdomain_codeset()\fR.
352 .SS "Message catalog file format"
353 .LP
354 The \fBmsgfmt\fR utility can generate the message object both in Solaris
355 message catalog file format and in GNU-compatible message catalog file format.
356 If the \fB-s\fR option is specified and the input file is a Solaris \fB\&.po\fR
357 file, the \fBmsgfmt\fR utility generates the message object in Solaris message
358 catalog file format. If the \fB-g\fR option is specified and the input file is
359 a GNU \fB\&.po\fR file, the \fBmsgfmt\fR utility generates the message object
360 in GNU-compatible message catalog file format. If neither the \fB-s\fR nor
361 \fB-g\fR option is specified, the \fBmsgfmt\fR utility determines the message
362 catalog file format as follows:
363 .RS +4
364 .TP
365 .ie t \(bu
366 .el o
367 If the \fB\&.po\fR file contains a valid GNU header entry (having an empty
368 string for \fBmsgid\fR), the \fBmsgfmt\fR utility uses the GNU-compatible
369 message catalog file format.
370 .RE
371 .RS +4
372 .TP
446 .nf
447 example% \fBmsgfmt module1.po module2.po\fR
448 .fi
449 .in -2
450 .sp
451
452 .sp
453 .LP
454 The following command will produce the output file \fBhello.mo\fR in Solaris
455 message catalog file format:
456
457 .sp
458 .in +2
459 .nf
460 example% \fBmsgfmt -o hello.mo module1.po module2.po\fR
461 .fi
462 .in -2
463 .sp
464
465 .SH ENVIRONMENT VARIABLES
466 .LP
467 See \fBenviron\fR(5) for descriptions of the following environmental variables
468 that affect the execution of \fBmsgfmt\fR: \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR,
469 and \fBNLSPATH\fR.
470 .SH ATTRIBUTES
471 .LP
472 See \fBattributes\fR(5) for descriptions of the following attributes:
473 .sp
474
475 .sp
476 .TS
477 box;
478 c | c
479 l | l .
480 ATTRIBUTE TYPE ATTRIBUTE VALUE
481 _
482 CSI Enabled
483 .TE
484
485 .SH SEE ALSO
486 .LP
487 \fBxgettext\fR(1), \fBgettext\fR(3C), \fBsetlocale\fR(3C), \fBattributes\fR(5),
488 \fBenviron\fR(5)
489 .SH NOTES
490 .LP
491 Installing message catalogs under the C locale is pointless, since they are
492 ignored for the sake of efficiency.
|