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 --> 
   6 <TITLE>msgfmt(
1) manual page
</TITLE> 
   9 <A HREF=
"#toc">Table of Contents
</A><P> 
  11 <H2><A NAME=
"sect0" HREF=
"#toc0">NAME 
</A></H2> 
  12 msgfmt - create a message object from a message file  
 
  13 <H2><A NAME=
"sect1" HREF=
"#toc1">SYNOPSIS 
 
  15 <B>msgfmt
</B> [ 
<B>-v
</B> ] [ 
<B>-o
</B><I> output-file
</I> ]  ...    
 
  16 <H2><A NAME=
"sect2" HREF=
"#toc2">DESCRIPTION 
</A></H2> 
  18 <B>msgfmt
</B> creates message 
 
  19 object files from portable object files (
<I>filename
<B>.po 
</B></I>), without changing 
 
  20 the portable object files. 
<P> 
  21 The  
<B>.po 
</B> file contains messages displayed to 
 
  22 users by system commands or by application programs. 
<B>.po
</B> files can be edited, 
 
  23 and the messages in them can be rewritten in any language supported by 
 
  25 The 
<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 
 
  27 script or programs. 
<P> 
  28 <B>msgfmt
</B> interprets data as characters according to the 
 
  29 current setting of the 
<FONT SIZE=-
1><B>LC_CTYPE 
</B></FONT> 
  31 <H3><A NAME=
"sect3" HREF=
"#toc3">Portable Object Files 
 
  34 Formats for all 
<B>.po
</B> files are the same. Each 
<B>.po
</B> file contains one or 
 
  35 more lines, with each line containing either a comment or a statement. 
 
  36 Comments start the line with a hash mark (#) and end with the newline 
 
  37 character. All comments are ignored. The format of a statement is: 
 
  45 Each directive starts at the beginning of the line and is separated 
 
  46 from 
<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. 
 
  48 Use any of the following types of directives:    
<P> 
  49  <blockquote><B>domain
</B> <I>domainname
</I>  <BR> 
  51 <I>message_identifier
</I>  <BR> 
  52 <B>msgstr
</B> <I>message_string
</I>  </blockquote> 
  54 The behavior of the  
<B>domain
</B>  
  55 directive is affected by the options used. See 
<FONT SIZE=-
1>OPTIONS
</FONT> 
  57 when the  
<B>-o
</B> option is specified. If the 
<B>-o
</B> option is not specified, the 
 
  58 behavior of the 
<B>domain
</B> directive is as follows:  
<blockquote> 
  60 ·<LI>All 
<I>msgids
</I> from the beginning 
 
  61 of each 
<B>.po
</B> file to the first  domain directive are put into a default 
 
  62 message object file, 
<B>messages.mo
</B>. 
</LI>·<LI>When 
<B>msgfmt
</B> encounters a 
<B>domain
</B><I> domainname
</I>  
  63 directive in the 
<B>.po
</B> file, all following 
<I>msgids
</I> until the next 
<B>domain
</B> directive 
 
  64 are put into the message object file  
</LI>·<LI>Duplicate  
<I>msgids
</I> are defined in 
 
  65 the scope of each domain. That is, a 
<I>msgid
</I> is considered a duplicate only 
 
  66 if the identical 
<I>msgid
</I> exists in the same domain. 
</LI>·<LI>All duplicate 
<I>msgids
</I>  
  71 The 
<B>msgid
</B> directive specifies the value of a message identifier 
 
  72 associated with the directive that follows it. The 
<I>message_identifier
</I> string 
 
  73 identifies a target string to be used at retrieval time. Each statement 
 
  74 containing a 
<B>msgid
</B> directive must be followed by a statement containing 
 
  75 a 
<B>msgstr
</B> directive. 
<P> 
  76 The 
<B>msgstr
</B> directive specifies the target string associated 
 
  77 with the 
<I>message_identifier
</I> string declared in the immediately preceding 
 
  78 <B>msgid
</B> directive. 
<P> 
  79 Message strings can contain the escape sequences 
<B>\n
</B> for 
 
  80 newline, 
<B>\t
</B> for tab, 
<B>\v
</B> for vertical tab, 
<B>\b
</B> for backspace, 
<B>\r
</B> for carriage 
 
  81 return, 
<B>\f
</B> for formfeed, 
<B>\\
</B> for backslash, \" for double quote, 
<B>\ddd
</B> for octal 
 
  82 bit pattern, and  
<B>\xDD
</B> for hexadecimal bit pattern.  
 
  83 <H2><A NAME=
"sect4" HREF=
"#toc4">OPTIONS 
</A></H2> 
  89  List duplicate message identifiers. Message strings are not redefined. 
 
  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 
 
  94 and duplicate 
<I>msgids
</I> in the 
<B>.po
</B> file are ignored. 
</DD> 
  97 <H2><A NAME=
"sect5" HREF=
"#toc5">EXAMPLES 
</A></H2> 
  99 <B>module1.po
</B> and 
<B>module2.po
</B> are portable message objects files. 
<P> 
 100  <blockquote> example% 
 
 102  # default domain "messages.mo" 
<BR> 
 107  domain "help_domain" 
<BR> 
 112  domain "error_domain" 
<BR> 
 117  example% cat module2.po 
<BR> 
 118  # default domain "messages.mo" 
 
 121  msgstr "mesg 
4 translation" 
<BR> 
 123  domain "error_domain" 
 
 126  msgstr "error 
5 translation" 
<BR> 
 128  domain "window_domain" 
 
 130  msgid  "window 
6" 
<BR> 
 131  msgstr "window 
6 translation" 
<BR> 
 134 The following command 
 
 135 will produce the output files, 
<B>messages.mo
</B>, 
<B>help_domain.mo
</B>, and 
<B>error_domain.mo
</B>. 
 
 139 <DT><B>example% msgfmt module1.po
</B>  </DT> 
 143 The following command will produce the output 
 
 144 files, 
<B>messages.mo
</B>, 
<B>help_domain.mo
</B>, 
<B>error_domain.mo
</B>, and 
<B>window_domain.mo
</B>. 
 
 148 <DT><B>example% msgfmt module1.po module2.po
</B>  </DT> 
 152 The following example will produce 
 
 153 the output file 
<B>hello.mo
</B>. 
 
 156 <DT><B>example% msgfmt -o hello.mo module1.po module2.po
</B>  
 161 Install 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>  
 163 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> 
 165 is text domain as set by 
<B>textdomain()
</B>. The 
<B>/usr/lib/locale
</B> portion can 
 
 166 optionally be changed by calling 
<B>bindtextdomain()
</B>. See 
<B><A HREF=
"http://hoth.stsci.edu/man/man3C/gettext.html">gettext
</B>(
3C)
</A> 
 168 <H2><A NAME=
"sect6" HREF=
"#toc6">ENVIRONMENT 
 
 170 See 
<B><A HREF=
"http://hoth.stsci.edu/man/man5/environ.html">environ
</B>(
5)
</A> 
 171  for descriptions of the following environmental variables 
 
 172 that 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> 
 177 <H2><A NAME=
"sect7" HREF=
"#toc7">ATTRIBUTES 
</A></H2> 
 178 See 
<B><A HREF=
"http://hoth.stsci.edu/man/man5/attributes.html">attributes
</B>(
5)
</A> 
 179  for descriptions of the following attributes: 
 
 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> 
 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> 
 194 <B><A HREF=
"http://hoth.stsci.edu/man/man5/environ.html">environ
</B>(
5)
</A> 
 196 <H2><A NAME=
"sect9" HREF=
"#toc9">NOTES 
</A></H2> 
 198 Neither 
<B>msgfmt
</B> nor any 
<B>gettext()
</B> routine imposes a limit 
 
 199 on the total length of a message. However, each line in the 
<B>*.po
</B> file is 
 
 200 limited to 
<FONT SIZE=-
1><B>MAX_INPUT 
</B></FONT> 
 202 Installing message catalogs under the 
 
 203 C locale is pointless, since they are ignored for the sake of efficiency. 
 
 207 <A NAME=
"toc"><B>Table of Contents
</B></A><P> 
 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> 
 213 <LI><A NAME=
"toc3" HREF=
"#sect3">Portable Object Files
</A></LI> 
 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>