Un outil pour savoir si une commande est posix - retour accueil
git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |
msgfmt.html (26890B)
1 <!-- Copyright 2001-2024 IEEE and The Open Group, All Rights Reserved --> 2 <!DOCTYPE HTML> 3 <html lang="en"> 4 <head> 5 <meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.8.0"> 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 7 <link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group rhtm tool v1.2.4 --> 8 <!-- Copyright (c) 2001-2024 The Open Group, All Rights Reserved --> 9 <title>msgfmt</title> 10 </head> 11 <body bgcolor="white"> 12 <div class="NAVHEADER"> 13 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 14 <tr class="nav"> 15 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/more.html" accesskey="P"><<< 16 Previous</a></td> 17 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 18 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/mv.html" accesskey="N">Next >>></a></td> 19 </tr> 20 </table> 21 <hr align="left" width="100%"></div> 22 <script language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> 23 <center><font size="2">The Open Group Base Specifications Issue 8<br> 24 IEEE Std 1003.1-2024<br> 25 Copyright © 2001-2024 The IEEE and The Open Group</font></center> 26 <hr size="2" noshade> 27 <a name="top" id="top"></a> <a name="msgfmt" id="msgfmt"></a> <a name="tag_20_82" id="tag_20_82"></a><!-- msgfmt --> 28 <h4 class="mansect"><a name="tag_20_82_01" id="tag_20_82_01"></a>NAME</h4> 29 <blockquote>msgfmt — create messages objects from portable messages object source files</blockquote> 30 <h4 class="mansect"><a name="tag_20_82_02" id="tag_20_82_02"></a>SYNOPSIS</h4> 31 <blockquote class="synopsis"> 32 <p><code><tt>msgfmt</tt> <b>[</b><tt>-cfSv</tt><b>] [</b><tt>-D</tt> <i>dir</i><b>] [</b><tt>-o</tt> <i>outputfile</i><b>]</b> 33 <i>pathname</i><tt>...</tt></code></p> 34 </blockquote> 35 <h4 class="mansect"><a name="tag_20_82_03" id="tag_20_82_03"></a>DESCRIPTION</h4> 36 <blockquote> 37 <p>The <i>msgfmt</i> utility shall create messages object files from portable messages object source files (dot-po files).</p> 38 <p>A dot-po file contains messages to be output by system commands or by applications. The messages in these files should be able 39 to be translated to any language supported by the system.</p> 40 <p>The <i>msgfmt</i> utility shall interpret message strings for output as characters according to the codeset specified in the 41 dot-po file or, if not present, the current setting of the <i>LC_CTYPE</i> locale category.</p> 42 </blockquote> 43 <h4 class="mansect"><a name="tag_20_82_04" id="tag_20_82_04"></a>OPTIONS</h4> 44 <blockquote> 45 <p>The <i>msgfmt</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax 46 Guidelines</i></a> .</p> 47 <p>The following options shall be supported:</p> 48 <dl compact> 49 <dd></dd> 50 <dt><b>-c</b></dt> 51 <dd>If this option and <b>-v</b> are both specified, <i>msgfmt</i> shall detect and diagnose input file abnormalities which might 52 represent translation errors. The <b>msgid</b> and <b>msgstr</b> strings shall be compared. It shall be considered abnormal if one 53 string starts or ends with a <newline> while the other does not. Also, if the flag <b>c-format</b> appears in a <tt>"#,"</tt> 54 comment for a <b>msgid</b> directive (see EXTENDED DESCRIPTION), it shall be considered abnormal if the strings do not have the 55 same number of <tt>'%'</tt> conversion specifiers, or if corresponding conversion specifiers take different argument types (see XSH 56 <a href="../functions/fprintf.html#"><i>fprintf</i></a> ). If an abnormality is detected, the exit status shall be non-zero and a 57 diagnostic message shall be output. Additional checks beyond those described here may also be performed. These checks may produce 58 diagnostics or informational messages and need not affect the exit status. If <b>-c</b> is specified without <b>-v</b> or <b>-v</b> 59 is specified without <b>-c</b>, the behavior is unspecified.</dd> 60 <dt><b>-D </b><i>dir</i></dt> 61 <dd>Add <i>dir</i> to the list of directories to search for input files.</dd> 62 <dt><b>-f</b></dt> 63 <dd>Use fuzzy entries in output. If this option is not specified, fuzzy entries shall not be included in the output.</dd> 64 <dt><b>-o </b><i>outputfile</i></dt> 65 <dd><br> 66 Specify the name of an output file to be used instead of the default filename(s) specified in EXTENDED DESCRIPTION. All 67 <b>domain</b> <i>domainname</i> directives in the dot-po file(s) shall be ignored.</dd> 68 <dt><b>-S</b></dt> 69 <dd>Append the suffix <b>.mo</b> to each generated messages object filename if it does not have this suffix.</dd> 70 <dt><b>-v</b></dt> 71 <dd>See <b>-c</b>.</dd> 72 </dl> 73 </blockquote> 74 <h4 class="mansect"><a name="tag_20_82_05" id="tag_20_82_05"></a>OPERANDS</h4> 75 <blockquote> 76 <p>The following operand shall be supported:</p> 77 <dl compact> 78 <dd></dd> 79 <dt><i>pathname</i></dt> 80 <dd>A pathname of a dot-po file.</dd> 81 </dl> 82 </blockquote> 83 <h4 class="mansect"><a name="tag_20_82_06" id="tag_20_82_06"></a>STDIN</h4> 84 <blockquote> 85 <p>Not used.</p> 86 </blockquote> 87 <h4 class="mansect"><a name="tag_20_82_07" id="tag_20_82_07"></a>INPUT FILES</h4> 88 <blockquote> 89 <p>The input files shall be text files in the format described in EXTENDED DESCRIPTION.</p> 90 </blockquote> 91 <h4 class="mansect"><a name="tag_20_82_08" id="tag_20_82_08"></a>ENVIRONMENT VARIABLES</h4> 92 <blockquote> 93 <p>The following environment variables shall affect the execution of <i>msgfmt</i>:</p> 94 <dl compact> 95 <dd></dd> 96 <dt><i>LANG</i></dt> 97 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href= 98 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization 99 variables used to determine the values of locale categories.)</dd> 100 <dt><i>LANGUAGE</i></dt> 101 <dd>Determine the location of messages objects <sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src= 102 "../images/opt-start.gif" alt="[Option Start]" border="0"> if <i>NLSPATH</i> is not set or the evaluation of <i>NLSPATH</i> 103 did not lead to a suitable messages object being found. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd> 104 <dt><i>LC_ALL</i></dt> 105 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd> 106 <dt><i>LC_CTYPE</i></dt> 107 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as 108 opposed to multi-byte characters in arguments and input files).</dd> 109 <dt><i>LC_MESSAGES</i></dt> 110 <dd><br> 111 Determine the locale name used to locate messages objects, and the locale that should be used to affect the format and contents of 112 diagnostic messages written to standard error.</dd> 113 <dt><i>NLSPATH</i></dt> 114 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 115 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border= 116 "0"></dd> 117 </dl> 118 </blockquote> 119 <h4 class="mansect"><a name="tag_20_82_09" id="tag_20_82_09"></a>ASYNCHRONOUS EVENTS</h4> 120 <blockquote> 121 <p>Default.</p> 122 </blockquote> 123 <h4 class="mansect"><a name="tag_20_82_10" id="tag_20_82_10"></a>STDOUT</h4> 124 <blockquote> 125 <p>Not Used.</p> 126 </blockquote> 127 <h4 class="mansect"><a name="tag_20_82_11" id="tag_20_82_11"></a>STDERR</h4> 128 <blockquote> 129 <p>The standard error shall be used for diagnostic messages and may also be used for warning messages. If the <b>-c</b> and 130 <b>-v</b> options are specified, additional unspecified informational messages may be written to standard error.</p> 131 </blockquote> 132 <h4 class="mansect"><a name="tag_20_82_12" id="tag_20_82_12"></a>OUTPUT FILES</h4> 133 <blockquote> 134 <p>The format of the created messages object files is unspecified.</p> 135 </blockquote> 136 <h4 class="mansect"><a name="tag_20_82_13" id="tag_20_82_13"></a>EXTENDED DESCRIPTION</h4> 137 <blockquote> 138 <p>The <i>msgfmt</i> utility shall accept portable messages object source files (dot-po files) in the following format.</p> 139 <p>A dot-po file contains zero or more lines, with each non-blank line containing a comment, a statement, or a statement 140 continuation. A comment has an unquoted <number-sign> (<tt>'#'</tt>) as the first non-<blank> character and ends with 141 the next <newline> character. A statement continuation is a double-quoted string on a line by itself, optionally preceded 142 and/or followed by <blank> characters, and the string shall be concatenated with the string on the previous statement line. 143 If a comment occurs between a statement and a statement continuation, the behavior is unspecified. All other comments, except for 144 comments beginning with <number-sign><comma> (<tt>"#,"</tt>), and blank lines shall be ignored.</p> 145 <p>The format of a statement is:</p> 146 <pre> 147 <i>directive value</i><tt> 148 </tt></pre> 149 <p>The <i>directive</i> starts at the first non-<blank> character of the line and is separated from the <i>value</i> by one 150 or more <blank> characters. The <i>value</i> consists of a double-quoted string optionally followed by <blank> 151 characters. Zero or more statement continuation lines (see above) can follow the statement. The following directives shall be 152 supported:<br></p> 153 <pre> 154 <b>domain </b><i>domainname</i><tt> 155 </tt><b>msgid </b><i>message_identifier</i><tt> 156 </tt><b>msgid_plural </b><i>untranslated_string_plural</i><tt> 157 </tt><b>msgstr </b><i>message_string</i><tt> 158 </tt><b>msgstr[</b><i>index</i><b>] </b><i>message_string</i><tt> 159 </tt></pre> 160 <p>A dot-po file consists of zero or more sections. Each section specifies the messages to be processed in a domain. The first 161 directive in each section shall be a <b>domain</b> directive (except for the first section which shall behave as if</p> 162 <pre> 163 <tt>domain "messages" 164 </tt></pre> 165 <p>had been specified if the first directive is not a <b>domain</b> directive).</p> 166 <p>The behavior of the <b>domain</b> directive is affected by the options used. See OPTIONS for the behavior when the <b>-o</b> 167 option is specified. If the <b>-o</b> option is not specified, all data obtained from the non-<b>domain</b> directives in a dot-po 168 section shall be output to the messages object file named <i>domainname</i><b>.mo</b> when the <b>-S</b> option is specified. When 169 the <b>-S</b> option is not specified, it is implementation-defined whether <i>domainname</i> or <i>domainname</i><b>.mo</b> is 170 used.</p> 171 <p>If multiple <b>domain</b> directives specify the same <i>domainname</i>, the sections shall be processed as if there was only 172 one section that starts with a <b>domain</b> <i>domainname</i> statement which contained the statements of the sections, in the 173 same order, excluding all but the first <b>domain</b> <i>domainname</i> statement.</p> 174 <p>Within each section, there can be a header. A header is identified by having a <b>msgid</b> directive with the empty string 175 (<tt>""</tt>) as the <i>message_identifier</i> immediately followed by a statement containing a <b>msgstr</b> directive. The 176 <i>message_string</i> in this <b>msgstr</b> statement in a header shall be treated specially. If <i>message_string</i> contains a 177 specification of the form:</p> 178 <pre> 179 <tt>"nplurals=</tt><i>count</i><tt>; plural=</tt><i>expression</i><tt>" 180 </tt></pre> 181 <p>then <i>count</i> indicates the number of plural forms for messages in that domain, and <i>expression</i> is a C-language 182 expression that evaluates to an unsigned integer value which determines the <b>msgstr[</b><i>index</i><b>]</b> directive to be 183 used. The value of <i>expression</i> is used as the index value. The variable <i>n</i> in <i>expression</i> is assigned the value 184 of the <i>n</i> argument to the <a href="../functions/ngettext.html"><i>ngettext</i>()</a>, <a href= 185 "../functions/ngettext_l.html"><i>ngettext_l</i>()</a>, <a href="../functions/dngettext.html"><i>dngettext</i>()</a>, <a href= 186 "../functions/dngettext_l.html"><i>dngettext_l</i>()</a>, <a href="../functions/dcngettext.html"><i>dcngettext</i>()</a>, and 187 <a href="../functions/dcngettext_l.html"><i>dcngettext_l</i>()</a> functions or of the <i>n</i> operand of the <a href= 188 "../utilities/ngettext.html"><i>ngettext</i></a> utility before <i>expression</i> is evaluated. The application shall ensure that 189 <i>expression</i> evaluates to a non-negative value less than <i>count</i> for all <i>n</i> that can be supplied by the 190 aforementioned functions and utility.</p> 191 <p>If <i>message_string</i> in the header contains a specification of the form:</p> 192 <pre> 193 <tt>"charset=</tt><i>codeset</i><tt>" 194 </tt></pre> 195 <p>then <i>codeset</i> indicates the codeset to be used to encode the message strings in this section's domain (overriding 196 <i>LC_CTYPE ).</i> If the output string's codeset is different from the message string's codeset, codeset conversion from the 197 message string's codeset to the output string's codeset shall be performed by the <i>gettext</i> family of functions and by the 198 <a href="../utilities/gettext.html"><i>gettext</i></a> and <a href="../utilities/ngettext.html"><i>ngettext</i></a> utilities. See 199 XSH <a href="../functions/gettext.html#tag_17_238"><i>gettext</i></a> and <a href= 200 "../utilities/gettext.html#tag_20_54"><i>gettext</i></a> . The output string's codeset shall be determined by the current or 201 specified locale's codeset. <basefont size="2"></p> 202 <dl> 203 <dt><b>Note:</b></dt> 204 <dd>It is the responsibility of translators to ensure that the characters they enter into message strings in a dot-po file are 205 encoded in the codeset specified in the header.</dd> 206 </dl> 207 <basefont size="3"> 208 <p>If a header is present in a section, the application shall ensure that the header is provided by the first <b>msgid</b> 209 directive in that section.</p> 210 <p>After the header, if present, zero or more messages are identified by a <b>msgid</b> directive with a <i>message_identifier</i> 211 that is not an empty string. Each of these directives start a subsection that is used to get a translated message from the 212 <i>gettext</i> family of functions and from the <a href="../utilities/gettext.html"><i>gettext</i></a> and <a href= 213 "../utilities/ngettext.html"><i>ngettext</i></a> utilities. If the <i>message_identifier</i> string is the string identified by the 214 <i>gettext</i> family of functions <i>msgid</i> argument or by the <a href="../utilities/gettext.html"><i>gettext</i></a> and 215 <a href="../utilities/ngettext.html"><i>ngettext</i></a> utility <i>msgid</i> operand, this subsection specifies how that 216 translation is to be processed.</p> 217 <p>If there is only a singular form for the given <i>message_identifier</i>, the application shall ensure that the statement 218 containing the <b>msgid</b> directive is immediately followed by a <b>msgstr</b> directive.</p> 219 <p>If there are plural forms for the given <i>message_identifier</i> and the header for this section exists and contains an</p> 220 <pre> 221 <tt>"nplurals=</tt><i>count</i><tt>; plural=</tt><i>expression</i><tt>" 222 </tt></pre> 223 <p>specification, the application shall ensure that the statement containing the <b>msgid</b> directive is immediately followed by 224 a <b>msgid_plural</b> directive and that each statement containing a <b>msgid_plural</b> directive is followed by <i>count</i> 225 statements containing <b>msgstr[</b><i>index</i><b>]</b> directives, starting with <b>msgstr[0]</b> and ending with 226 <b>msgstr[</b><i>count</i><b>-1]</b> in increasing order, with no duplicate index values. If a header for this section does not 227 exist or does not contain an</p> 228 <pre> 229 <tt>"nplurals=</tt><i>count</i><tt>; plural=</tt><i>expression</i><tt>" 230 </tt></pre> 231 <p>specification, the application shall ensure that no <b>msgid_plural</b> or <b>msgstr[</b><i>index</i><b>]</b> directives are 232 used in this section.</p> 233 <p>For example, if the header's <i>message_string</i> contains the specification:</p> 234 <pre> 235 <tt>"nplurals=2; plural= n == 1 ? 0 : 1" 236 </tt></pre> 237 <p>there are two forms in the domain; <b>msgstr[0]</b> is used if <i>n</i> is equal to 1, otherwise <b>msgstr[1]</b> is used. For 238 another example, if the header's <i>message_string</i> contains:</p> 239 <pre> 240 <tt>"nplurals=3; plural= n == 1 ? 0 : n == 2 ? 1 : 2" 241 </tt></pre> 242 <p>there are three forms in the domain; <b>msgstr[0]</b> is used if <i>n</i> is equal to 1, <b>msgstr[1]</b> is used if <i>n</i> is 243 equal to 2, otherwise <b>msgstr[2]</b> is used.</p> 244 <p>C-language escape sequences in strings shall be processed as specified for character string literals in the ISO C standard, 245 except that <i>universal-character-name</i> escape sequences need not be supported.</p> 246 <p>Comments in a dot-po file can be in one of the following formats:</p> 247 <pre> 248 <tt>#: </tt><i>reference</i><tt> 249 #. </tt><i>utility-added-comments</i><tt> 250 #, </tt><i>flag</i><tt> 251 #</tt><i>translator-comments</i> (where <i>translator-comments</i> does not begin with <tt>'.'</tt>, <tt>':'</tt> or <tt>','</tt>)<tt> 252 </tt></pre> 253 <p>A <tt>#: <i>reference</i></tt> comment indicates the location(s) of the <b>msgid</b> string in the source files, in</p> 254 <pre> 255 <i>pathname1</i><tt>:</tt><i>linenumber1 </i><b>[</b><i>pathname2</i><tt>:</tt><i>linenumber2</i><tt> ... </tt><b>]</b><tt> 256 </tt></pre> 257 <p>format. They can be added, as might <tt>"#."</tt> prefixed additional comments of unspecified format, by the <a href= 258 "../utilities/xgettext.html"><i>xgettext</i></a> utility. All comments that do not begin with <tt>"#,"</tt> are informative only 259 and shall be silently ignored by the <i>msgfmt</i> utility. In <tt>"#,"</tt> comments the following values for <i>flag</i> can be 260 specified:</p> 261 <dl compact> 262 <dd></dd> 263 <dt><b>fuzzy</b></dt> 264 <dd>This flag indicates that the <b>msgstr</b> string might not be a correct translation at this point in time. Only the translator 265 can judge if the translation requires further modification or is acceptable as is. Once satisfied with the translation, the 266 translator should remove this <b>fuzzy</b> flag. If this flag is specified, the <i>msgfmt</i> utility shall not generate the entry 267 for the next following <b>msgid</b> in the output message catalog, unless the <b>-f</b> option is specified. If other flag comments 268 are specified between <b>fuzzy</b> and the <b>msgid</b>, the behavior is unspecified.</dd> 269 <dt><b>c-format</b></dt> 270 <dd></dd> 271 <dt><b>no-c-format</b></dt> 272 <dd>The <b>c-format</b> flag indicates that the next following <b>msgid</b> string contains a <a href= 273 "../functions/printf.html"><i>printf</i>()</a> format string. When the <b>c-format</b> flag is given and the <b>-c</b> and 274 <b>-v</b> options are specified, the <i>msgfmt</i> utility shall perform additional tests to check the validity of the translation 275 (see OPTIONS); these additional tests may also be performed if neither <b>c-format</b> nor <b>no-c-format</b> is given. When the 276 <b>no-c-format</b> flag is given for a string, no additional checks shall be performed for the string. When both the 277 <b>c-format</b> and the <b>no-c-format</b> flags are given, the last flag specified takes precedence.</dd> 278 </dl> 279 </blockquote> 280 <h4 class="mansect"><a name="tag_20_82_14" id="tag_20_82_14"></a>EXIT STATUS</h4> 281 <blockquote> 282 <p>The following exit values shall be returned:</p> 283 <dl compact> 284 <dd></dd> 285 <dt> 0</dt> 286 <dd>Successful completion.</dd> 287 <dt>>0</dt> 288 <dd>An error occurred.</dd> 289 </dl> 290 </blockquote> 291 <h4 class="mansect"><a name="tag_20_82_15" id="tag_20_82_15"></a>CONSEQUENCES OF ERRORS</h4> 292 <blockquote> 293 <p>The <i>msgfmt</i> utility need not continue processing later <i>pathname</i> operands when an error condition that affects the 294 exit status is detected. It is unspecified whether a messages object file is written when checks performed for the <b>-c</b> and 295 <b>-v</b> options fail.</p> 296 </blockquote> 297 <hr> 298 <div class="box"><em>The following sections are informative.</em></div> 299 <h4 class="mansect"><a name="tag_20_82_16" id="tag_20_82_16"></a>APPLICATION USAGE</h4> 300 <blockquote> 301 <p>The <a href="../utilities/xgettext.html"><i>xgettext</i></a> utility can be used to create template dot-po files from C-language 302 source files.</p> 303 <p>Installing messages object files for the POSIX or C locale is not recommended, since they may be ignored for the sake of 304 efficiency.</p> 305 <p>The first section for each domain in a dot-po file should include a header containing a</p> 306 <pre> 307 <tt>"charset=</tt><i>codeset</i><tt>" 308 </tt></pre> 309 <p>specification. If this specification is omitted, message conversions in the <i>gettext</i> family of functions and in the 310 <a href="../utilities/gettext.html"><i>gettext</i></a> and <a href="../utilities/ngettext.html"><i>ngettext</i></a> utilities may 311 fail.</p> 312 <p>The <b>msgid_plural</b> directive's <i>untranslated_string_plural</i> string comes from the <i>msgid_plural</i> arguments in 313 calls to the <a href="../functions/ngettext.html"><i>ngettext</i>()</a>, <a href= 314 "../functions/ngettext_l.html"><i>ngettext_l</i>()</a>, <a href="../functions/dngettext.html"><i>dngettext</i>()</a>, <a href= 315 "../functions/dngettext_l.html"><i>dngettext_l</i>()</a>, <a href="../functions/dcngettext.html"><i>dcngettext</i>()</a>, and 316 <a href="../functions/dcngettext_l.html"><i>dcngettext_l</i>()</a> functions when a prototype dot-po file is created by the 317 <a href="../utilities/xgettext.html"><i>xgettext</i></a> utility. These strings (and the <i>msgid_plural</i> operands in calls to 318 the <a href="../utilities/ngettext.html"><i>ngettext</i></a> utility) can provide context when a translator is modifying a template 319 dot-po file into a dot-po file for a specific language. These functions and the <a href= 320 "../utilities/ngettext.html"><i>ngettext</i></a> utility do not try to match the <i>msgid_plural</i> arguments or operands with 321 anything in a messages object file; they only match the <i>msgid</i> arguments and operands.</p> 322 <p>Unlike shell command language strings, double-quoted strings in dot-po files cannot contain a literal <newline> 323 character.</p> 324 </blockquote> 325 <h4 class="mansect"><a name="tag_20_82_17" id="tag_20_82_17"></a>EXAMPLES</h4> 326 <blockquote> 327 <p>In this example, <b>module1.po</b> and <b>module2.po</b> are portable messages object source files.</p> 328 <pre> 329 <b>$</b><tt> cat module1.po</tt><b> 330 # default domain "messages" 331 msgid "" 332 msgstr "charset=utf-8" 333 msgid "msg 1" 334 msgstr "msg 1 translation" 335 # 336 domain "help_domain" 337 msgid "" 338 msgstr "charset=utf-8" 339 msgid "help 2" 340 msgstr "help 2 translation" 341 # 342 domain "error_domain" 343 msgid "" 344 msgstr "charset=utf-8" 345 msgid "error 3" 346 msgstr "error 3 translation"</b><tt> 347 </tt></pre> 348 <pre> 349 <b>$</b><tt> cat module2.po</tt><b> 350 # default domain "messages" 351 msgid "" 352 msgstr "charset=utf-8" 353 msgid "mesg 4" 354 msgstr "mesg 4 translation" 355 # 356 domain "error_domain" 357 msgid "" 358 msgstr "charset=utf-8" 359 #, c-format 360 msgid "error 5 %s" 361 msgstr "error 5 translation %s" 362 # 363 domain "window_domain" 364 msgid "" 365 msgstr "charset=utf-8" 366 msgid "window 6" 367 msgstr "window 6 translation"</b><tt> 368 </tt></pre> 369 <pre> 370 <b>$</b><tt> cat module3.po</tt><b> 371 # default domain "messages" 372 # header will be used for the whole output file in the third example 373 msgid "" 374 msgstr "charset=utf-8" 375 msgid "info 0" 376 msgstr "info 0 translation"</b><tt> 377 </tt></pre> 378 <pre> 379 <b>$</b><tt> cat opt_debug.po</tt><b> 380 # 381 domain "debug_domain" 382 msgid "debug 8" 383 msgstr "debug 8 translation"</b><tt> 384 </tt></pre> 385 <p>The following command will produce the output files <b>messages.mo</b>, <b>help_domain.mo</b>, and <b>error_domain.mo</b>:</p> 386 <pre> 387 <b>$</b><tt> msgfmt -S module1.po 388 </tt></pre> 389 <p>The following command will produce the output files <b>messages.mo</b>, <b>help_domain.mo</b>, <b>error_domain.mo</b>, and 390 <b>window_domain.mo</b>:</p> 391 <pre> 392 <b>$</b><tt> msgfmt -S module1.po module2.po 393 </tt></pre> 394 <p>The following command will produce the output file <b>hello.mo</b>:</p> 395 <pre> 396 <b>$</b><tt> msgfmt -o hello.mo module3.po opt_debug.po 397 </tt></pre></blockquote> 398 <h4 class="mansect"><a name="tag_20_82_18" id="tag_20_82_18"></a>RATIONALE</h4> 399 <blockquote> 400 <p>Some implementations are less strict about the format of dot-po files and simply treat all occurrences of one or more white 401 space characters as a separator. The format described in this standard is accepted by all known implementations.</p> 402 <p>In some implementations, duplicate <b>msgid</b> directives within a domain are ignored, and only an entry for the first 403 <b>msgid</b> directive and the following <b>msgid</b>, <b>msgid_plural</b>, <b>msgstr</b>, or <b>msgstr[</b><i>index</i><b>]</b> 404 directives is created. However, some implementations consider duplicate <b>msgid</b> directives within a domain to be an error and 405 do not produce output at all. Consequently this standard does not specify the behavior of <i>msgfmt</i> if duplicate <b>msgid</b> 406 directives are encountered within one domain.</p> 407 </blockquote> 408 <h4 class="mansect"><a name="tag_20_82_19" id="tag_20_82_19"></a>FUTURE DIRECTIONS</h4> 409 <blockquote> 410 <p>If this utility is directed to create a new directory entry that contains any bytes that have the encoded value of a 411 <newline> character, implementations are encouraged to treat this as an error. A future version of this standard may require 412 implementations to treat this as an error.</p> 413 </blockquote> 414 <h4 class="mansect"><a name="tag_20_82_20" id="tag_20_82_20"></a>SEE ALSO</h4> 415 <blockquote> 416 <p><a href="../utilities/gettext.html#tag_20_54"><i>gettext</i></a> , <a href="../utilities/xgettext.html#"><i>xgettext</i></a></p> 417 <p>XSH <a href="../functions/fprintf.html#"><i>fprintf</i></a> , <a href= 418 "../functions/gettext.html#tag_17_238"><i>gettext</i></a></p> 419 </blockquote> 420 <h4 class="mansect"><a name="tag_20_82_21" id="tag_20_82_21"></a>CHANGE HISTORY</h4> 421 <blockquote> 422 <p>First released in Issue 8.</p> 423 </blockquote> 424 <div class="box"><em>End of informative text.</em></div> 425 <hr> 426 <p> </p> 427 <a href="#top"><span class="topOfPage">return to top of page</span></a><br> 428 <hr size="2" noshade> 429 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br> 430 POSIX™ is a Trademark of The IEEE.<br> 431 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br> 432 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href= 433 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a> 434 ]</font></center> 435 <hr size="2" noshade> 436 <div class="NAVHEADER"> 437 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 438 <tr class="nav"> 439 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/more.html" accesskey="P"><<< 440 Previous</a></td> 441 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 442 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/mv.html" accesskey="N">Next >>></a></td> 443 </tr> 444 </table> 445 <hr align="left" width="100%"></div> 446 </body> 447 </html>