File: msgfmt.htm

package info (click to toggle)
wxwin2-doc 2.01-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 6,540 kB
  • ctags: 5,968
  • sloc: cpp: 15,157; makefile: 434; sh: 6
file content (222 lines) | stat: -rw-r--r-- 8,550 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<!-- manual page source format generated by PolyglotMan v3.0.3a12, -->
<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->

<HTML>
<HEAD>
<TITLE>msgfmt(1) manual page</TITLE>
</HEAD>
<BODY>
<A HREF="#toc">Table of Contents</A><P>
     
<H2><A NAME="sect0" HREF="#toc0">NAME </A></H2>
msgfmt - create a message object from a message file  
<H2><A NAME="sect1" HREF="#toc1">SYNOPSIS 
</A></H2>
<B>msgfmt</B> [ <B>-v</B> ] [ <B>-o</B><I> output-file</I> ]  ...    
<H2><A NAME="sect2" HREF="#toc2">DESCRIPTION </A></H2>
<P>
<B>msgfmt</B> creates message 
object files from portable object files (<I>filename<B>.po </B></I>), without changing 
the portable object files. <P>
The  <B>.po </B> file contains messages displayed to 
users by system commands or by application programs. <B>.po</B> files can be edited, 
and the messages in them can be rewritten in any language supported by 
the system. <P>
The <B><A HREF="http://hoth.stsci.edu/man/man1/xgettext.html">xgettext</B>(1)</A>
 command can be used to create  <B>.po</B> files from 
script or programs. <P>
<B>msgfmt</B> interprets data as characters according to the 
current setting of the <FONT SIZE=-1><B>LC_CTYPE </B></FONT>
  locale category.  
<H3><A NAME="sect3" HREF="#toc3">Portable Object Files 
</A></H3>
    <P>
Formats for all <B>.po</B> files are the same. Each <B>.po</B> file contains one or 
more lines, with each line containing either a comment or a statement. 
Comments start the line with a hash mark (#) and end with the newline 
character. All comments are ignored. The format of a statement is: 
<DL>

<DT><I>directive</I> 
value  </DT>
<DD></DD>
</DL>
<P>
Each directive starts at the beginning of the line and is separated 
from <I>value</I> by white space (such as one or more space or tab characters). 
<I>value</I> consists of one or more quoted strings separated by white space. 
Use any of the following types of directives:    <P>
 <blockquote><B>domain</B> <I>domainname</I>  <BR>
<B>msgid</B> 
<I>message_identifier</I>  <BR>
<B>msgstr</B> <I>message_string</I>  </blockquote>
<P>
The behavior of the  <B>domain</B> 
directive is affected by the options used. See <FONT SIZE=-1>OPTIONS</FONT>
 for the behavior 
when the  <B>-o</B> option is specified. If the <B>-o</B> option is not specified, the 
behavior of the <B>domain</B> directive is as follows:  <blockquote>
<UL>
&#183;<LI>All <I>msgids</I> from the beginning 
of each <B>.po</B> file to the first  domain directive are put into a default 
message object file, <B>messages.mo</B>. </LI>&#183;<LI>When <B>msgfmt</B> encounters a <B>domain</B><I> domainname</I> 
directive in the <B>.po</B> file, all following <I>msgids</I> until the next <B>domain</B> directive 
are put into the message object file  </LI>&#183;<LI>Duplicate  <I>msgids</I> are defined in 
the scope of each domain. That is, a <I>msgid</I> is considered a duplicate only 
if the identical <I>msgid</I> exists in the same domain. </LI>&#183;<LI>All duplicate <I>msgids</I> 
are ignored. </LI>
</UL>
 </blockquote>
<P>
The <B>msgid</B> directive specifies the value of a message identifier 
associated with the directive that follows it. The <I>message_identifier</I> string 
identifies a target string to be used at retrieval time. Each statement 
containing a <B>msgid</B> directive must be followed by a statement containing 
a <B>msgstr</B> directive. <P>
The <B>msgstr</B> directive specifies the target string associated 
with the <I>message_identifier</I> string declared in the immediately preceding 
<B>msgid</B> directive. <P>
Message strings can contain the escape sequences <B>\n</B> for 
newline, <B>\t</B> for tab, <B>\v</B> for vertical tab, <B>\b</B> for backspace, <B>\r</B> for carriage 
return, <B>\f</B> for formfeed, <B>\\</B> for backslash, \" for double quote, <B>\ddd</B> for octal 
bit pattern, and  <B>\xDD</B> for hexadecimal bit pattern.  
<H2><A NAME="sect4" HREF="#toc4">OPTIONS </A></H2>

<DL>

<DT><B>-v</B>  </DT>
<DD>Verbose. 
 List duplicate message identifiers. Message strings are not redefined. 
</DD>

<DT><B>-o</B><I> output-file</I>  </DT>
<DD>Specify output file name as <I>output-file</I>. All <B>domain</B> directives 
and duplicate <I>msgids</I> in the <B>.po</B> file are ignored. </DD>
</DL>
 
<H2><A NAME="sect5" HREF="#toc5">EXAMPLES </A></H2>
In this example 
<B>module1.po</B> and <B>module2.po</B> are portable message objects files. <P>
 <blockquote> example% 
cat module1.po <BR>
 # default domain "messages.mo" <BR>
 msgid  "msg 1" <BR>
 msgstr "msg 
1 translation" <BR>
 # <BR>
 domain "help_domain" <BR>
 msgid  "help 2" <BR>
 msgstr "help 
2 translation" <BR>
 # <BR>
 domain "error_domain" <BR>
 msgid  "error 3" <BR>
 msgstr "error 
3 translation" <BR>
 <P>
 example% cat module2.po <BR>
 # default domain "messages.mo" 
<BR>
 msgid  "mesg 4" <BR>
 msgstr "mesg 4 translation" <BR>
 # <BR>
 domain "error_domain" 
<BR>
 msgid  "error 5" <BR>
 msgstr "error 5 translation" <BR>
 # <BR>
 domain "window_domain" 
<BR>
 msgid  "window 6" <BR>
 msgstr "window 6 translation" <BR>
   </blockquote>
<P>
The following command 
will produce the output files, <B>messages.mo</B>, <B>help_domain.mo</B>, and <B>error_domain.mo</B>. 

<DL>

<DT><B>example% msgfmt module1.po</B>  </DT>
<DD></DD>
</DL>
<P>
The following command will produce the output 
files, <B>messages.mo</B>, <B>help_domain.mo</B>, <B>error_domain.mo</B>, and <B>window_domain.mo</B>. 

<DL>

<DT><B>example% msgfmt module1.po module2.po</B>  </DT>
<DD></DD>
</DL>
<P>
The following example will produce 
the output file <B>hello.mo</B>. 
<DL>

<DT><B>example% msgfmt -o hello.mo module1.po module2.po</B> 
 </DT>
<DD></DD>
</DL>
<P>
Install message object files in <B>/usr/lib/locale/</B><I>locale</I><B><FONT SIZE=-1>/LC_MESSAGES/</FONT>
</B><I>domain</I><B>.mo</B> 
where <I>locale</I> is the message locale as set by <B><A HREF="http://hoth.stsci.edu/man/man3C/setlocale.html">setlocale</B>(3C)</A>
, and <I>domain</I> 
is text domain as set by <B>textdomain()</B>. The <B>/usr/lib/locale</B> portion can 
optionally be changed by calling <B>bindtextdomain()</B>. See <B><A HREF="http://hoth.stsci.edu/man/man3C/gettext.html">gettext</B>(3C)</A>
.  
<H2><A NAME="sect6" HREF="#toc6">ENVIRONMENT 
</A></H2>
See <B><A HREF="http://hoth.stsci.edu/man/man5/environ.html">environ</B>(5)</A>
 for descriptions of the following environmental variables 
that affect the execution of <B>msgfmt</B>: <FONT SIZE=-1><B>LC_CTYPE</FONT>
 </B>,   <FONT SIZE=-1><B>LC_MESSAGES</FONT>
 </B>,   <FONT SIZE=-1><B>NLSPATH</FONT>
 
</B>.    
<H2><A NAME="sect7" HREF="#toc7">ATTRIBUTES </A></H2>
See <B><A HREF="http://hoth.stsci.edu/man/man5/attributes.html">attributes</B>(5)</A>
 for descriptions of the following attributes: 
 <P>
 <TABLE BORDER=0>
 <TR> <TD ALIGN=CENTER><B>ATTRIBUTE TYPE</B> </TD> <TD ALIGN=CENTER><B>ATTRIBUTE VALUE</B> </TD> </TR>
 <TR>  <TR> <TD ALIGN=LEFT>Availability </TD> <TD ALIGN=LEFT>SUNWloc </TD> </TR>
 <TR> <TD ALIGN=LEFT>CSI 
</TD> <TD ALIGN=LEFT>Enabled </TD> </TR>
 </TABLE>
 
<H2><A NAME="sect8" HREF="#toc8">SEE ALSO </A></H2>
<B><A HREF="http://hoth.stsci.edu/man/man1/xgettext.html">xgettext</B>(1)</A>
, <B><A HREF="http://hoth.stsci.edu/man/man3C/gettext.html">gettext</B>(3C)</A>
, <B><A HREF="http://hoth.stsci.edu/man/man3C/setlocale.html">setlocale</B>(3C)</A>
, <B><A HREF="http://hoth.stsci.edu/man/man5/attributes.html">attributes</B>(5)</A>
, 
<B><A HREF="http://hoth.stsci.edu/man/man5/environ.html">environ</B>(5)</A>
  
<H2><A NAME="sect9" HREF="#toc9">NOTES </A></H2>
<P>
Neither <B>msgfmt</B> nor any <B>gettext()</B> routine imposes a limit 
on the total length of a message. However, each line in the <B>*.po</B> file is 
limited to <FONT SIZE=-1><B>MAX_INPUT </B></FONT>
  (512) bytes. <P>
Installing message catalogs under the 
C locale is pointless, since they are ignored for the sake of efficiency. 
    <P>

<HR><P>
<A NAME="toc"><B>Table of Contents</B></A><P>
<UL>
<LI><A NAME="toc0" HREF="#sect0">NAME</A></LI>
<LI><A NAME="toc1" HREF="#sect1">SYNOPSIS</A></LI>
<LI><A NAME="toc2" HREF="#sect2">DESCRIPTION</A></LI>
<UL>
<LI><A NAME="toc3" HREF="#sect3">Portable Object Files</A></LI>
</UL>
<LI><A NAME="toc4" HREF="#sect4">OPTIONS</A></LI>
<LI><A NAME="toc5" HREF="#sect5">EXAMPLES</A></LI>
<LI><A NAME="toc6" HREF="#sect6">ENVIRONMENT</A></LI>
<LI><A NAME="toc7" HREF="#sect7">ATTRIBUTES</A></LI>
<LI><A NAME="toc8" HREF="#sect8">SEE ALSO</A></LI>
<LI><A NAME="toc9" HREF="#sect9">NOTES</A></LI>
</UL>
</BODY></HTML>