XGETTEXT(1p)

πŸ“¦
version 1.00 Β· 4 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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, STDIN is 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 β€” use NAME.po for 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 to STDOUT. 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-format right 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 .ext or .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 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>

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's perl v5.36.0, dated 2022-10-13, filed under XGETTEXT(1p). mwah πŸ«ΆπŸ’–
πŸ“¦ where this page comes from