1XGETTEXT(1) User Contributed Perl Documentation XGETTEXT(1)
2
3
4
6 xgettext.pl - Extract translatable strings from source
7
9 xgettext.pl [OPTION] [INPUTFILE]...
10
12 This program extracts translatable strings from given input files, or
13 from STDIN if none are given.
14
15 Please see Locale::Maketext::Extract for a list of supported input file
16 formats.
17
19 Mandatory arguments to long options are mandatory for short options
20 too. Similarly for optional arguments.
21
22 Input file location:
23 INPUTFILE...
24 Files to extract messages from. If not specified, STDIN is
25 assumed.
26
27 -f, --files-from=FILE
28 Get list of input files from FILE.
29
30 -D, --directory=DIRECTORY
31 Add DIRECTORY to list for input files search.
32
33 Input file format:
34 -u, --use-gettext-style
35 Specifies that the source programs uses the Gettext style (e.g.
36 %1) instead of the Maketext style (e.g. "[_1]") in its localization
37 calls.
38
39 Output file location:
40 -d, --default-domain=NAME
41 Use NAME.po for output, instead of "messages.po".
42
43 -o, --output=FILE
44 PO file name to be written or incrementally updated; "-" means
45 writing to STDOUT.
46
47 -p, --output-dir=DIR
48 Output files will be placed in directory DIR.
49
50 Output details:
51 -g, --gnu-gettext
52 Enables GNU gettext interoperability by printing "#,
53 perl-maketext-format" before each entry that has "%" variables.
54
55 -W, --wrap
56 If wrap is enabled, then, for entries with multiple file locations,
57 each location is listed on a separate line. The default is to put
58 them all on a single line.
59
60 Other comments are not affected.
61
62 Plugins:
63 By default, all builtin parser plugins are enabled for all file types,
64 with warnings turned off.
65
66 If any plugin is specified on the command line, then warnings are
67 turned on by default - you can turn them off with "-now"
68
69 -P|--plugin pluginname
70 Use the specified plugin for the default file types recognised by that
71 plugin.
72
73 -P|--plugin 'pluginname=*'
74 Use the specified plugin for all file types.
75
76 -P|--plugin pluginname=ext,ext2
77 Use the specified plugin for any files ending in C<.ext> or C<.ext2>
78
79 -P|--plugin My::Module::Name='*'
80 Use your custom plugin module for all file types
81
82 Multiple plugins can be specified on the command line.
83
84 Available plugins:
85
86 "perl" : Locale::Maketext::Extract::Plugin::Perl
87 For a slightly more accurate but much slower Perl parser, you can
88 use the PPI plugin. This does not have a short name, but must be
89 specified in full, eg:
90
91 xgettext.pl -P Locale::Maketext::Extract::Plugin::PPI
92
93 "tt2" : Locale::Maketext::Extract::Plugin::TT2
94 "yaml" : Locale::Maketext::Extract::Plugin::YAML
95 "formfu" : Locale::Maketext::Extract::Plugin::FormFu
96 "mason" : Locale::Maketext::Extract::Plugin::Mason
97 "text" : Locale::Maketext::Extract::Plugin::TextTemplate
98 "generic" : Locale::Maketext::Extract::Plugin::Generic
99
100 Warnings:
101 If a parser plugin encounters a syntax error while parsing, it will
102 abort parsing and hand over to the next parser plugin. If warnings are
103 turned on then the error will be echoed to STDERR.
104
105 Off by default, unless any plugin has been specified on the command
106 line.
107
108 -w|--warnings
109 -now|--nowarnings
110
111 Verbose:
112 If you would like to see which files have been processed, which plugins
113 were used, and which strings were extracted, then enable "verbose". If
114 no acceptable plugin was found, or no strings were extracted, then the
115 file is not listed:
116
117 -v|--verbose
118 Lists processed files.
119
120 -v -v|--verbose --verbose :
121 Lists processed files and which plugins managed to extract strings.
122
123 -v -v|--verbose --verbose :
124 Lists processed files, which plugins managed to extract strings,
125 and the extracted strings, the line where they were found, and any
126 variables.
127
129 Locale::Maketext::Extract
130 Locale::Maketext::Lexicon::Gettext
131 Locale::Maketext
132 Locale::Maketext::Extract::Plugin::Perl
133 Locale::Maketext::Extract::Plugin::PPI
134 Locale::Maketext::Extract::Plugin::TT2
135 Locale::Maketext::Extract::Plugin::YAML
136 Locale::Maketext::Extract::Plugin::FormFu
137 Locale::Maketext::Extract::Plugin::Mason
138 Locale::Maketext::Extract::Plugin::TextTemplate
139 Locale::Maketext::Extract::Plugin::Generic
140
142 Audrey Tang <cpan@audreyt.org>
143
145 Copyright 2002-2008 by Audrey Tang <cpan@audreyt.org>.
146
147 This software is released under the MIT license cited below.
148
149 The "MIT" License
150 Permission is hereby granted, free of charge, to any person obtaining a
151 copy of this software and associated documentation files (the
152 "Software"), to deal in the Software without restriction, including
153 without limitation the rights to use, copy, modify, merge, publish,
154 distribute, sublicense, and/or sell copies of the Software, and to
155 permit persons to whom the Software is furnished to do so, subject to
156 the following conditions:
157
158 The above copyright notice and this permission notice shall be included
159 in all copies or substantial portions of the Software.
160
161 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
162 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
163 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
164 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
165 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
166 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
167 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
168
169
170
171perl v5.12.2 2010-08-10 XGETTEXT(1)