XGETTEXT(1p)
β¨ NAME β¨
okay so bestie, welcome to XGETTEXT(1p) from the User Contributed Perl Documentation crew π
xgettext.pl β it extracts translatable strings from your source files. that's the whole personality. π
πΈ VERSION πΈ
version 1.00 β¨
π SYNOPSIS π
xgettext.pl [OPTION] [INPUTFILE]...
π¦ DESCRIPTION π¦
This program extracts translatable strings from the input files you hand it, or from STDIN if you hand it literally nothing. main character energy either way π
for a list of supported input file formats, go look at Locale::Maketext::Extract. she has the receipts. π
π OPTIONS π
real talk: mandatory arguments to long options are mandatory for short options too. same rules for optional arguments. no exceptions, no cap. π«Ά
π Input file location
INPUTFILE...β the files you wanna extract messages from. if you don't specify any,STDINis assumed. yes, she'll read your vibes from the pipe. β¨-f,--files-from=FILEβ get ya list of input files from FILE instead.-D,--directory=DIRECTORYβ add DIRECTORY to the list of places to search for input files.
πΈ Input file format
-u,--use-gettext-styleβ says that the source program is doing the Gettext style (like%1) instead of the Maketext style (like"[_1]") inside its localization calls. pick your fighter. π
β Output file location
-d,--default-domain=NAMEβ useNAME.pofor output instead of"messages.po". glow up the filename bestie π-o,--output=FILEβ the PO file name to write, or to incrementally update. and"-"means writing toSTDOUT. iconic.-p,--output-dir=DIRβ output files get placed in directory DIR.
π Output details
-g,--gnu-gettextβ turns on GNU gettext interoperability by printing#, perl-maketext-formatright before each entry that has"%"variables. teamwork makes the dream work π€-W,--wrapβ if wrap is enabled, then for entries with multiple file locations, each location gets listed on its own separate line. the default is to put them all on a single line. Other comments are not affected β she's not gonna touch those, she's respectful. π
π§ Plugins
By default, all builtin parser plugins are enabled for all file types, with warnings turned off. silent mode. stealth mode. π
If any plugin is specified on the command line, then warnings are turned on by default β you can turn them off with "-now" β¨
-P|--plugin pluginnameβ use the specified plugin for the default file types recognised by that plugin.-P|--plugin 'pluginname=*'β use the specified plugin for all file types. all of them. every last one π-P|--plugin pluginname=ext,ext2β use the specified plugin for any files ending in.extor.ext2-P|--plugin My::Module::Name='*'β use your custom plugin module for all file types. build your own, we love to see it π«Ά
Multiple plugins can be specified on the command line. stack 'em up π
Available plugins:
"perl"β Locale::Maketext::Extract::Plugin::Perl
for a slightly more accurate but much slower Perl parser, you can use the PPI plugin. she does not have a short name, so you must specify her in full, eg: text xgettext.pl -P Locale::Maketext::Extract::Plugin::PPI
"tt2"β Locale::Maketext::Extract::Plugin::TT2"yaml"β Locale::Maketext::Extract::Plugin::YAML"formfu"β Locale::Maketext::Extract::Plugin::FormFu"mason"β Locale::Maketext::Extract::Plugin::Mason"text"β Locale::Maketext::Extract::Plugin::TextTemplate"generic"β Locale::Maketext::Extract::Plugin::Generic
π Warnings
If a parser plugin hits a syntax error while parsing, it will abort parsing and hand over to the next parser plugin. and if warnings are turned on, then the error gets echoed to STDERR. not a whisper, a whole announcement π’
Off by default, unless any plugin has been specified on the command line.
-w|--warnings-now|--nowarnings
π Verbose
If you would like to see which files have been processed, which plugins were used, and which strings were extracted, then enable "verbose". and heads up bestie: if no acceptable plugin was found, or no strings were extracted, then the file is not listed. she's not gonna list a file that gave nothing. π
-v|--verboseβ lists processed files.-v -v|--verbose --verboseβ lists processed files and which plugins managed to extract strings.-v -v|--verbose --verboseβ lists processed files, which plugins managed to extract strings, and the extracted strings, the line where they were found, and any variables. full lore drop π
π₯ SEE ALSO π₯
- Locale::Maketext::Extract
- Locale::Maketext::Lexicon::Gettext
- Locale::Maketext
- Locale::Maketext::Extract::Plugin::Perl
- Locale::Maketext::Extract::Plugin::PPI
- Locale::Maketext::Extract::Plugin::TT2
- Locale::Maketext::Extract::Plugin::YAML
- Locale::Maketext::Extract::Plugin::FormFu
- Locale::Maketext::Extract::Plugin::Mason
- Locale::Maketext::Extract::Plugin::TextTemplate
- Locale::Maketext::Extract::Plugin::Generic
π AUTHORS π
- Audrey Tang
<cpan@audreyt.org>
π COPYRIGHT π
Copyright 2002-2008 by Audrey Tang <cpan@audreyt.org>.
This software is released under the MIT license cited below.
πΈ The "MIT" License πΈ
okay so this next part is the actual legal text and legal text does NOT get a vibe rewrite, bestie. it stays verbatim. periodt. π
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
π AUTHORS π
- Clinton Gormley
<drtech@cpan.org> - Audrey Tang
<cpan@audreyt.org>
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2014 by Audrey Tang.
This is free software, licensed under:
The MIT (X11) License
okay that's the whole page, bestie, you're officially a xgettext.pl expert now, go extract some strings and slay π
β¨
for the record, this one'sperl v5.36.0, dated2022-10-13, filed underXGETTEXT(1p). mwah π«Άπ
π¦ where this page comes from
- ubuntu noble: liblocale-maketext-lexicon-perl 1.00-3 Β· MIT
- ubuntu resolute: liblocale-maketext-lexicon-perl 1.00-3 Β· MIT
- ubuntu stonking: liblocale-maketext-lexicon-perl 1.00-3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms