Localizer::Scanner::Perl - Scanner for file which is written by perl
use Localizer::Dictionary; use Localizer::Scanner::Perl; my $result = Localizer::Dictionary->new(); my $scanner = Localizer::Scanner::Perl->new(); $scanner->scan_file($result, 'path/to/perl.pl');
Localizer::Scanner::Perl()
Constructor. It makes scanner instance.
$scanner->scan_file($result, $filename)
Scan file which is written by perl. $result is the instance of Localizer::Dictionary to store results. $filename is file name of the target to scan.
$result
$filename
For example, if target file is follows;
print q{_("123")}; print q{l("foo")}; print q{loc("bar")};
Scanner uses _('foobar'), l('foobar') and loc('foobar') as msgid (in this case, 'foobar' will be msgid).
_('foobar')
l('foobar')
loc('foobar')
msgid
$result will be like a following;
{ '123' => { 'position' => [ [ 'path/to/perl.pl', 1 ] ] }, 'foo' => { 'position' => [ [ 'path/to/perl.pl', 2 ] ] }, 'bar' => { 'position' => [ [ 'path/to/perl.pl', 3 ] ] } }
$scanner->scan($result, $filename, $data)
This method is almost the same as scan_file(). This method does not load file contents, it uses $data as file contents instead.
scan_file()
$data
Locale::Maketext::Extract::Plugin::Perl
Copyright (C) Tokuhiro Matsuno.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Localizer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Localizer
CPAN shell
perl -MCPAN -e shell install Localizer
For more information on module installation, please visit the detailed CPAN module installation guide.