Locale::Maketext::Extract is a Perl module used to extract translatable strings from source.
SYNOPSIS
my $Ext = Locale::Maketext::Extract->new;
$Ext->read_po('messages.po');
$Ext->extract_file($_) for ;
# Set $entries_are_in_gettext_format if the .pl files above use
# loc('%1') instead of loc('[_1]')
$Ext->compile($entries_are_in_gettext_format);
$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:
Perl source files
Valid localization function names are: translate, maketext, gettext, loc, x, _ and __.
HTML::Mason
Strings inside ... and ... are extracted.
Template Toolkit
Strings inside [%|l%]...[%END%] or [%|loc%]...[%END%] are extracted.
Text::Template
Sentences between STARTxxx and ENDxxx are extracted individually.
Generic Template
Strings inside {{...}} are extracted.
Product's homepage
Requirements:
· Perl