Locale::Maketext::Extract - Extract translatable strings from source
my $Ext = Locale::Maketext::Extract->new; $Ext->read_po('messages.po'); $Ext->extract_file($_) for <*.pl>; $Ext->compile; $Ext->write_po('messages.po');
This module can extract translatable strings from files, and write them back to PO files. It can also parse existing PO files and merge their contents with newly extracted strings.
A command-line utility, xgettext.pl, is installed with this module as well.
Following formats of input files are supported:
Valid localization function names are: translate, maketext, gettext, loc, x, _ and __.
translate
maketext
gettext
loc
x
_
__
Strings inside <&|/l>...</&> and <&|/loc>...</&> are extracted.
<&|/l>...</&>
<&|/loc>...</&>
Strings inside [%|l%]...[%END%] or [%|loc%]...[%END%] are extracted.
[%|l%]...[%END%]
[%|loc%]...[%END%]
Sentences between STARTxxx and ENDxxx are extracted individually.
STARTxxx
ENDxxx
Strings inside {{...}} are extracted.
XXX: Documentation needed. Patches welcome.
new
header, set_header lexicon, set_lexicon, msgstr, set_msgstr entries, set_entries, entry, add_entry clear
read_po write_po
extract extract_file
compile normalize_space
msgids, has_msgid, msgstr, set_msgstr msg_positions, msg_variables, msg_format, msg_out
_default_header _to_gettext _escape _format
xgettext.pl, Locale::Maketext, Locale::Maketext::Lexicon
Autrijus Tang <autrijus@autrijus.org>
Copyright 2003 by Autrijus Tang <autrijus@autrijus.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install Locale::Maketext::Lexicon, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Locale::Maketext::Lexicon
CPAN shell
perl -MCPAN -e shell install Locale::Maketext::Lexicon
For more information on module installation, please visit the detailed CPAN module installation guide.