1XGETTEXT(1) User Commands XGETTEXT(1)
2
3
4
6 xgettext - extract gettext strings from source
7
9 xgettext [OPTION] [INPUTFILE]...
10
12 Extract translatable strings from given input files.
13
14 Mandatory arguments to long options are mandatory for short options
15 too. Similarly for optional arguments.
16
17 Input file location:
18 INPUTFILE ...
19 input files
20
21 -f, --files-from=FILE
22 get list of input files from FILE
23
24 -D, --directory=DIRECTORY
25 add DIRECTORY to list for input files search
26
27 If input file is -, standard input is read.
28
29 Output file location:
30 -d, --default-domain=NAME
31 use NAME.po for output (instead of messages.po)
32
33 -o, --output=FILE
34 write output to specified file
35
36 -p, --output-dir=DIR
37 output files will be placed in directory DIR
38
39 If output file is -, output is written to standard output.
40
41 Choice of input file language:
42 -L, --language=NAME
43 recognise the specified language (C, C++, ObjectiveC, PO, Shell,
44 Python, Lisp, EmacsLisp, librep, Scheme, Smalltalk, Java,
45 JavaProperties, C#, awk, YCP, Tcl, Perl, PHP, GCC-source,
46 NXStringTable, RST, RSJ, Glade, Lua, JavaScript, Vala, Desktop)
47
48 -C, --c++
49 shorthand for --language=C++
50
51 By default the language is guessed depending on the input file name
52 extension.
53
54 Input file interpretation:
55 --from-code=NAME
56 encoding of input files (except for Python, Tcl, Glade)
57
58 By default the input files are assumed to be in ASCII.
59
60 Operation mode:
61 -j, --join-existing
62 join messages with existing file
63
64 -x, --exclude-file=FILE.po
65 entries from FILE.po are not extracted
66
67 -cTAG, --add-comments=TAG
68 place comment blocks starting with TAG and preceding keyword
69 lines in output file
70
71 -c, --add-comments
72 place all comment blocks preceding keyword lines in output file
73
74 --check=NAME
75 perform syntax check on messages (ellipsis-unicode, space-ellip‐
76 sis,
77
78 quote-unicode, bullet-unicode)
79
80 --sentence-end=TYPE
81 type describing the end of sentence (single-space, which is the
82 default,
83
84 or double-space)
85
86 Language specific options:
87 -a, --extract-all
88 extract all strings (only languages C, C++, ObjectiveC, Shell,
89 Python, Lisp, EmacsLisp, librep, Scheme, Java, C#, awk, Tcl,
90 Perl, PHP, GCC-source, Glade, Lua, JavaScript, Vala)
91
92 -kWORD, --keyword=WORD
93 look for WORD as an additional keyword
94
95 -k, --keyword
96 do not to use default keywords (only languages C, C++, Objec‐
97 tiveC, Shell, Python, Lisp, EmacsLisp, librep, Scheme, Java, C#,
98 awk, Tcl, Perl, PHP, GCC-source, Glade, Lua, JavaScript, Vala,
99 Desktop)
100
101 --flag=WORD:ARG:FLAG
102 additional flag for strings inside the argument number ARG of
103 keyword WORD
104
105 (only languages C, C++, ObjectiveC, Shell,
106 Python, Lisp, EmacsLisp, librep, Scheme, Java, C#, awk, YCP,
107 Tcl, Perl, PHP, GCC-source, Lua, JavaScript, Vala)
108
109 -T, --trigraphs
110 understand ANSI C trigraphs for input (only languages C, C++,
111 ObjectiveC)
112
113 --its=FILE
114 apply ITS rules from FILE (only XML based languages)
115
116 --qt recognize Qt format strings (only language C++)
117
118 --kde recognize KDE 4 format strings (only language C++)
119
120 --boost
121 recognize Boost format strings (only language C++)
122
123 --debug
124 more detailed formatstring recognition result
125
126 Output details:
127 --color
128 use colors and other text attributes always
129
130 --color=WHEN
131 use colors and other text attributes if WHEN. WHEN may be
132 'always', 'never', 'auto', or 'html'.
133
134 --style=STYLEFILE
135 specify CSS style rule file for --color
136
137 -e, --no-escape
138 do not use C escapes in output (default)
139
140 -E, --escape
141 use C escapes in output, no extended chars
142
143 --force-po
144 write PO file even if empty
145
146 -i, --indent
147 write the .po file using indented style
148
149 --no-location
150 do not write '#: filename:line' lines
151
152 -n, --add-location
153 generate '#: filename:line' lines (default)
154
155 --strict
156 write out strict Uniforum conforming .po file
157
158 --properties-output
159 write out a Java .properties file
160
161 --stringtable-output
162 write out a NeXTstep/GNUstep .strings file
163
164 --itstool
165 write out itstool comments
166
167 -w, --width=NUMBER
168 set output page width
169
170 --no-wrap
171 do not break long message lines, longer than the output page
172 width, into several lines
173
174 -s, --sort-output
175 generate sorted output
176
177 -F, --sort-by-file
178 sort output by file location
179
180 --omit-header
181 don't write header with 'msgid ""' entry
182
183 --copyright-holder=STRING
184 set copyright holder in output
185
186 --foreign-user
187 omit FSF copyright in output for foreign user
188
189 --package-name=PACKAGE
190 set package name in output
191
192 --package-version=VERSION
193 set package version in output
194
195 --msgid-bugs-address=EMAIL@ADDRESS
196 set report address for msgid bugs
197
198 -m[STRING], --msgstr-prefix[=STRING]
199 use STRING or "" as prefix for msgstr values
200
201 -M[STRING], --msgstr-suffix[=STRING]
202 use STRING or "" as suffix for msgstr values
203
204 Informative output:
205 -h, --help
206 display this help and exit
207
208 -V, --version
209 output version information and exit
210
212 Written by Ulrich Drepper.
213
215 Report bugs in the bug tracker at <https://savan‐
216 nah.gnu.org/projects/gettext> or by email to <bug-gettext@gnu.org>.
217
219 Copyright © 1995-2020 Free Software Foundation, Inc. License GPLv3+:
220 GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
221 This is free software: you are free to change and redistribute it.
222 There is NO WARRANTY, to the extent permitted by law.
223
225 The full documentation for xgettext is maintained as a Texinfo manual.
226 If the info and xgettext programs are properly installed at your site,
227 the command
228
229 info xgettext
230
231 should give you access to the complete manual.
232
233
234
235GNU gettext-tools 0.20.2 April 2020 XGETTEXT(1)