]> git.saurik.com Git - wxWidgets.git/blame - docs/html/gettext/msgfmt.htm
fixed wxBITMAP macro under wxGTK
[wxWidgets.git] / docs / html / gettext / msgfmt.htm
CommitLineData
90e94c04
JS
1<!-- manual page source format generated by PolyglotMan v3.0.3a12, -->
2<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
3
4<HTML>
5<HEAD>
6<TITLE>msgfmt(1) manual page</TITLE>
7</HEAD>
8<BODY>
9<A HREF="#toc">Table of Contents</A><P>
10
11<H2><A NAME="sect0" HREF="#toc0">NAME </A></H2>
12msgfmt - create a message object from a message file
13<H2><A NAME="sect1" HREF="#toc1">SYNOPSIS
14</A></H2>
15<B>msgfmt</B> [ <B>-v</B> ] [ <B>-o</B><I> output-file</I> ] ...
16<H2><A NAME="sect2" HREF="#toc2">DESCRIPTION </A></H2>
17<P>
18<B>msgfmt</B> creates message
19object files from portable object files (<I>filename<B>.po </B></I>), without changing
20the portable object files. <P>
21The <B>.po </B> file contains messages displayed to
22users by system commands or by application programs. <B>.po</B> files can be edited,
23and the messages in them can be rewritten in any language supported by
24the system. <P>
25The <B><A HREF="http://hoth.stsci.edu/man/man1/xgettext.html">xgettext</B>(1)</A>
26 command can be used to create <B>.po</B> files from
27script or programs. <P>
28<B>msgfmt</B> interprets data as characters according to the
29current setting of the <FONT SIZE=-1><B>LC_CTYPE </B></FONT>
30 locale category.
31<H3><A NAME="sect3" HREF="#toc3">Portable Object Files
32</A></H3>
33 <P>
34Formats for all <B>.po</B> files are the same. Each <B>.po</B> file contains one or
35more lines, with each line containing either a comment or a statement.
36Comments start the line with a hash mark (#) and end with the newline
37character. All comments are ignored. The format of a statement is:
38<DL>
39
40<DT><I>directive</I>
41value </DT>
42<DD></DD>
43</DL>
44<P>
45Each directive starts at the beginning of the line and is separated
46from <I>value</I> by white space (such as one or more space or tab characters).
47<I>value</I> consists of one or more quoted strings separated by white space.
48Use any of the following types of directives: <P>
49 <blockquote><B>domain</B> <I>domainname</I> <BR>
50<B>msgid</B>
51<I>message_identifier</I> <BR>
52<B>msgstr</B> <I>message_string</I> </blockquote>
53<P>
54The behavior of the <B>domain</B>
55directive is affected by the options used. See <FONT SIZE=-1>OPTIONS</FONT>
56 for the behavior
57when the <B>-o</B> option is specified. If the <B>-o</B> option is not specified, the
58behavior of the <B>domain</B> directive is as follows: <blockquote>
59<UL>
60&#183;<LI>All <I>msgids</I> from the beginning
61of each <B>.po</B> file to the first domain directive are put into a default
62message object file, <B>messages.mo</B>. </LI>&#183;<LI>When <B>msgfmt</B> encounters a <B>domain</B><I> domainname</I>
63directive in the <B>.po</B> file, all following <I>msgids</I> until the next <B>domain</B> directive
64are put into the message object file </LI>&#183;<LI>Duplicate <I>msgids</I> are defined in
65the scope of each domain. That is, a <I>msgid</I> is considered a duplicate only
66if the identical <I>msgid</I> exists in the same domain. </LI>&#183;<LI>All duplicate <I>msgids</I>
67are ignored. </LI>
68</UL>
69 </blockquote>
70<P>
71The <B>msgid</B> directive specifies the value of a message identifier
72associated with the directive that follows it. The <I>message_identifier</I> string
73identifies a target string to be used at retrieval time. Each statement
74containing a <B>msgid</B> directive must be followed by a statement containing
75a <B>msgstr</B> directive. <P>
76The <B>msgstr</B> directive specifies the target string associated
77with the <I>message_identifier</I> string declared in the immediately preceding
78<B>msgid</B> directive. <P>
79Message strings can contain the escape sequences <B>\n</B> for
80newline, <B>\t</B> for tab, <B>\v</B> for vertical tab, <B>\b</B> for backspace, <B>\r</B> for carriage
81return, <B>\f</B> for formfeed, <B>\\</B> for backslash, \" for double quote, <B>\ddd</B> for octal
82bit pattern, and <B>\xDD</B> for hexadecimal bit pattern.
83<H2><A NAME="sect4" HREF="#toc4">OPTIONS </A></H2>
84
85<DL>
86
87<DT><B>-v</B> </DT>
88<DD>Verbose.
89 List duplicate message identifiers. Message strings are not redefined.
90</DD>
91
92<DT><B>-o</B><I> output-file</I> </DT>
93<DD>Specify output file name as <I>output-file</I>. All <B>domain</B> directives
94and duplicate <I>msgids</I> in the <B>.po</B> file are ignored. </DD>
95</DL>
96
97<H2><A NAME="sect5" HREF="#toc5">EXAMPLES </A></H2>
98In this example
99<B>module1.po</B> and <B>module2.po</B> are portable message objects files. <P>
100 <blockquote> example%
101cat module1.po <BR>
102 # default domain "messages.mo" <BR>
103 msgid "msg 1" <BR>
104 msgstr "msg
1051 translation" <BR>
106 # <BR>
107 domain "help_domain" <BR>
108 msgid "help 2" <BR>
109 msgstr "help
1102 translation" <BR>
111 # <BR>
112 domain "error_domain" <BR>
113 msgid "error 3" <BR>
114 msgstr "error
1153 translation" <BR>
116 <P>
117 example% cat module2.po <BR>
118 # default domain "messages.mo"
119<BR>
120 msgid "mesg 4" <BR>
121 msgstr "mesg 4 translation" <BR>
122 # <BR>
123 domain "error_domain"
124<BR>
125 msgid "error 5" <BR>
126 msgstr "error 5 translation" <BR>
127 # <BR>
128 domain "window_domain"
129<BR>
130 msgid "window 6" <BR>
131 msgstr "window 6 translation" <BR>
132 </blockquote>
133<P>
134The following command
135will produce the output files, <B>messages.mo</B>, <B>help_domain.mo</B>, and <B>error_domain.mo</B>.
136
137<DL>
138
139<DT><B>example% msgfmt module1.po</B> </DT>
140<DD></DD>
141</DL>
142<P>
143The following command will produce the output
144files, <B>messages.mo</B>, <B>help_domain.mo</B>, <B>error_domain.mo</B>, and <B>window_domain.mo</B>.
145
146<DL>
147
148<DT><B>example% msgfmt module1.po module2.po</B> </DT>
149<DD></DD>
150</DL>
151<P>
152The following example will produce
153the output file <B>hello.mo</B>.
154<DL>
155
156<DT><B>example% msgfmt -o hello.mo module1.po module2.po</B>
157 </DT>
158<DD></DD>
159</DL>
160<P>
161Install message object files in <B>/usr/lib/locale/</B><I>locale</I><B><FONT SIZE=-1>/LC_MESSAGES/</FONT>
162</B><I>domain</I><B>.mo</B>
163where <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>
164, and <I>domain</I>
165is text domain as set by <B>textdomain()</B>. The <B>/usr/lib/locale</B> portion can
166optionally be changed by calling <B>bindtextdomain()</B>. See <B><A HREF="http://hoth.stsci.edu/man/man3C/gettext.html">gettext</B>(3C)</A>
167.
168<H2><A NAME="sect6" HREF="#toc6">ENVIRONMENT
169</A></H2>
170See <B><A HREF="http://hoth.stsci.edu/man/man5/environ.html">environ</B>(5)</A>
171 for descriptions of the following environmental variables
172that affect the execution of <B>msgfmt</B>: <FONT SIZE=-1><B>LC_CTYPE</FONT>
173 </B>, <FONT SIZE=-1><B>LC_MESSAGES</FONT>
174 </B>, <FONT SIZE=-1><B>NLSPATH</FONT>
175
176</B>.
177<H2><A NAME="sect7" HREF="#toc7">ATTRIBUTES </A></H2>
178See <B><A HREF="http://hoth.stsci.edu/man/man5/attributes.html">attributes</B>(5)</A>
179 for descriptions of the following attributes:
180 <P>
181 <TABLE BORDER=0>
182 <TR> <TD ALIGN=CENTER><B>ATTRIBUTE TYPE</B> </TD> <TD ALIGN=CENTER><B>ATTRIBUTE VALUE</B> </TD> </TR>
183 <TR> <TR> <TD ALIGN=LEFT>Availability </TD> <TD ALIGN=LEFT>SUNWloc </TD> </TR>
184 <TR> <TD ALIGN=LEFT>CSI
185</TD> <TD ALIGN=LEFT>Enabled </TD> </TR>
186 </TABLE>
187
188<H2><A NAME="sect8" HREF="#toc8">SEE ALSO </A></H2>
189<B><A HREF="http://hoth.stsci.edu/man/man1/xgettext.html">xgettext</B>(1)</A>
190, <B><A HREF="http://hoth.stsci.edu/man/man3C/gettext.html">gettext</B>(3C)</A>
191, <B><A HREF="http://hoth.stsci.edu/man/man3C/setlocale.html">setlocale</B>(3C)</A>
192, <B><A HREF="http://hoth.stsci.edu/man/man5/attributes.html">attributes</B>(5)</A>
193,
194<B><A HREF="http://hoth.stsci.edu/man/man5/environ.html">environ</B>(5)</A>
195
196<H2><A NAME="sect9" HREF="#toc9">NOTES </A></H2>
197<P>
198Neither <B>msgfmt</B> nor any <B>gettext()</B> routine imposes a limit
199on the total length of a message. However, each line in the <B>*.po</B> file is
200limited to <FONT SIZE=-1><B>MAX_INPUT </B></FONT>
201 (512) bytes. <P>
202Installing message catalogs under the
203C locale is pointless, since they are ignored for the sake of efficiency.
204 <P>
205
206<HR><P>
207<A NAME="toc"><B>Table of Contents</B></A><P>
208<UL>
209<LI><A NAME="toc0" HREF="#sect0">NAME</A></LI>
210<LI><A NAME="toc1" HREF="#sect1">SYNOPSIS</A></LI>
211<LI><A NAME="toc2" HREF="#sect2">DESCRIPTION</A></LI>
212<UL>
213<LI><A NAME="toc3" HREF="#sect3">Portable Object Files</A></LI>
214</UL>
215<LI><A NAME="toc4" HREF="#sect4">OPTIONS</A></LI>
216<LI><A NAME="toc5" HREF="#sect5">EXAMPLES</A></LI>
217<LI><A NAME="toc6" HREF="#sect6">ENVIRONMENT</A></LI>
218<LI><A NAME="toc7" HREF="#sect7">ATTRIBUTES</A></LI>
219<LI><A NAME="toc8" HREF="#sect8">SEE ALSO</A></LI>
220<LI><A NAME="toc9" HREF="#sect9">NOTES</A></LI>
221</UL>
222</BODY></HTML>