]>
Commit | Line | Data |
---|---|---|
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>xgettext(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> | |
12 | xgettext - extract gettext call strings from C programs | |
13 | <H2><A NAME="sect1" HREF="#toc1">SYNOPSIS | |
14 | </A></H2> | |
15 | <B>xgettext</B> [ <B>-ns</B> ] [ <B>-a</B> [ <B>-x</B><I> exclude-file</I> ] ] [ <B>-c</B><I> comment-tag</I> ] [ <B>-d</B><I> default-domain</I> | |
16 | ] [ <B>-j</B> ] [ <B>-m</B><I> prefix</I> ] [ <B>-M</B><I> suffix</I> ] [ <B>-p</B><I> pathname</I> ] <B>-</B>| <I>filename</I> ... <BR> | |
17 | <B>xgettext</B> | |
18 | <B>-h</B> | |
19 | <H2><A NAME="sect2" HREF="#toc2">DESCRIPTION </A></H2> | |
20 | <P> | |
21 | <B>xgettext</B> is used to automate the creation of portable | |
22 | message files (<B>.po</B>). A <B>.po</B> file contains copies of `C' strings that are found | |
23 | in ANSI C source code in <I>filename</I> or the standard input if `<B>-</B>' is specified | |
24 | on the command line. The <B>.po</B> file can be used as input to the <B><A HREF="http://hoth.stsci.edu/man/man1/msgfmt.html">msgfmt</B>(1)</A> | |
25 | ||
26 | utility, which produces a binary form of the message file that can be | |
27 | used by application during run-time. <P> | |
28 | <B>xgettext</B> writes <I>msgid</I> strings from | |
29 | <B><A HREF="http://hoth.stsci.edu/man/man3C/gettext.html">gettext</B>(3C)</A> | |
30 | calls in <I>filename</I> to the default output file <B>messages.po</B>. The | |
31 | default output file name can be changed by <B>-d</B> option. <I>msgid</I> strings in | |
32 | <B>dgettext()</B> calls are written to the output file where <I>domainname</I> is the | |
33 | first parameter to the <B>dgettext()</B> call. <P> | |
34 | By default, <B>xgettext</B> creates a | |
35 | <B>.po</B> file in the current working directory, and each entry is in the same | |
36 | order the strings are extracted from <I>filenames</I>. When the <B>-p</B> option is specified, | |
37 | the <B>.po</B> file is created in the <I>pathname</I> directory. An existing <B>.po</B> file | |
38 | is overwritten. <P> | |
39 | Duplicate <I>msgid</I>s are written to the <B>.po</B> file as comment | |
40 | lines. When the <B>-s </B> option is specified, the <B>.po</B> is sorted by the <I>msgid</I> | |
41 | string, and all duplicated <I>msgid</I>s are removed. All <I>msgstr</I> directives in | |
42 | the <B>.po</B> file are empty unless the <B>-m </B> option is used. | |
43 | <H2><A NAME="sect3" HREF="#toc3">OPTIONS </A></H2> | |
44 | ||
45 | <DL> | |
46 | ||
47 | <DT><B>-n</B> </DT> | |
48 | <DD>Add comment | |
49 | lines to the output file indicating file name and line number in the source | |
50 | file where each extracted string is encountered. These lines appear before | |
51 | each <I>msgid</I> in the following format: <blockquote><B>#</B> <B># File: </B><I>filename</I><B>, line: </DD> | |
52 | </DL> | |
53 | </B><I>line-number</I> | |
54 | </blockquote> | |
55 | ||
56 | <DL> | |
57 | ||
58 | <DT><B>-s</B> </DT> | |
59 | <DD>Generate output sorted by <I>msgid</I>s with all duplicate <I>msgid</I>s removed. | |
60 | </DD> | |
61 | ||
62 | <DT><B>-a</B> </DT> | |
63 | <DD>Extract all strings, not just those found in <B><A HREF="http://hoth.stsci.edu/man/man3C/gettext.html">gettext</B>(3C)</A> | |
64 | , and <B>dgettext | |
65 | ()</B> calls. Only one <B>.po</B> file is created. </DD> | |
66 | ||
67 | <DT><B>-c</B><I> comment-tag</I> </DT> | |
68 | <DD>The comment block | |
69 | beginning with <I>comment-tag</I> as the first token of the comment block is | |
70 | added to the output <B>.po</B> file as <I>#</I> delimited comments. For multiple domains, | |
71 | <B>xgettext</B> directs comments and messages to the prevailing text domain. </DD> | |
72 | ||
73 | <DT><B>-d</B><I> | |
74 | default-domain</I> </DT> | |
75 | <DD>Rename default output file from <B>messages.po</B> to <I>default-domain</I> | |
76 | <B>.po</B>. </DD> | |
77 | ||
78 | <DT><B>-j</B> </DT> | |
79 | <DD>Join messages with existing message files. If a <B>.po</B> file does not | |
80 | exist, it is created. If a <B>.po</B> file does exist, new messages are appended. | |
81 | Any duplicate <B>msgid</B>s are commented out in the resulting <B>.po</B> file. Domain | |
82 | directives in the existing <B>.po</B> file are ignored. Results not guaranteed | |
83 | if the existing message file has been edited. </DD> | |
84 | ||
85 | <DT><B>-m</B><I> prefix</I> </DT> | |
86 | <DD>Fill in the <I>msgstr</I> | |
87 | with <I>prefix</I>. This is useful for debugging purposes. To make <I>msgstr</I> identical | |
88 | to <I>msgid</I>, use an empty string (<B>"" </B>) for <I>prefix</I>. </DD> | |
89 | ||
90 | <DT><B>-M</B><I> suffix</I> </DT> | |
91 | <DD>Fill in the | |
92 | <I>msgstr</I> with <I>suffix</I>. This is useful for debugging purposes. </DD> | |
93 | ||
94 | <DT><B>-p</B><I> pathname</I> | |
95 | </DT> | |
96 | <DD>Specify the directory where the output files will be placed. This option | |
97 | overrides the current working directory. <BR> | |
98 | </DD> | |
99 | ||
100 | <DT><B>-x</B><I> exclude-file</I> </DT> | |
101 | <DD>Specify a <B>.po</B> | |
102 | file that contains a list of <I>msgid</I>s that are not to be extracted from | |
103 | the input files. The format of <I>exclude-file</I> is identical to the <B>.po</B> file. | |
104 | However, only the <I>msgid</I> directive line in <I>exclude-file</I> is used. All other | |
105 | lines are simply ignored. The <B>-x</B> option can only be used with the <B>-a</B> option. | |
106 | </DD> | |
107 | ||
108 | <DT><B>-h</B> </DT> | |
109 | <DD>Print a help message on the standard output. </DD> | |
110 | </DL> | |
111 | ||
112 | <H2><A NAME="sect4" HREF="#toc4">ATTRIBUTES </A></H2> | |
113 | See <B><A HREF="http://hoth.stsci.edu/man/man5/attributes.html">attributes</B>(5)</A> | |
114 | ||
115 | for descriptions of the following attributes: <P> | |
116 | <TABLE BORDER=0> | |
117 | <TR> <TD ALIGN=CENTER><B>ATTRIBUTE TYPE</B> </TD> <TD ALIGN=CENTER><B>ATTRIBUTE | |
118 | VALUE</B> </TD> </TR> | |
119 | <TR> <TR> <TD ALIGN=LEFT>Availability </TD> <TD ALIGN=LEFT>SUNWloc </TD> </TR> | |
120 | </TABLE> | |
121 | ||
122 | <H2><A NAME="sect5" HREF="#toc5">SEE ALSO </A></H2> | |
123 | <B><A HREF="http://hoth.stsci.edu/man/man1/msgfmt.html">msgfmt</B>(1)</A> | |
124 | , <B><A HREF="http://hoth.stsci.edu/man/man3C/gettext.html">gettext</B>(3C)</A> | |
125 | , <B><A HREF="http://hoth.stsci.edu/man/man5/attributes.html">attributes</B>(5)</A> | |
126 | ||
127 | ||
128 | <H2><A NAME="sect6" HREF="#toc6">NOTES </A></H2> | |
129 | <B>xgettext</B> is not able to extract cast strings, for example ANSI | |
130 | C casts of literal strings to <B>(const char *)</B>. This is unnecessary anyway, | |
131 | since the prototypes in <B><libintl.h></B> already specify this type. <P> | |
132 | ||
133 | <HR><P> | |
134 | <A NAME="toc"><B>Table of Contents</B></A><P> | |
135 | <UL> | |
136 | <LI><A NAME="toc0" HREF="#sect0">NAME</A></LI> | |
137 | <LI><A NAME="toc1" HREF="#sect1">SYNOPSIS</A></LI> | |
138 | <LI><A NAME="toc2" HREF="#sect2">DESCRIPTION</A></LI> | |
139 | <LI><A NAME="toc3" HREF="#sect3">OPTIONS</A></LI> | |
140 | <LI><A NAME="toc4" HREF="#sect4">ATTRIBUTES</A></LI> | |
141 | <LI><A NAME="toc5" HREF="#sect5">SEE ALSO</A></LI> | |
142 | <LI><A NAME="toc6" HREF="#sect6">NOTES</A></LI> | |
143 | </UL> | |
144 | </BODY></HTML> |