my $verbose = 0;
my $pref = 0;
my $all = 0;
+my @files;
GetOptions(
'v|verbose' => \$verbose,
'p' => \$pref,
+ 'f:s' => \@files,
'a|all' => \$all,
);
my ($cmd, $lang) = @ARGV;
$cmd = lc $cmd;
if ( $cmd =~ /create|install|update/ ) {
- my $installer = LangInstaller->new( $lang, $pref );
+ my $installer = LangInstaller->new( $lang, $pref, $verbose );
if ( $cmd !~ /create/ && $lang && not $lang ~~ $installer->{langs} ) {
print "Unsupported language: $lang\n";
exit;
usage() if $cmd eq 'create';
for my $lang ( @{$installer->{langs}} ) {
$installer->set_lang( $lang );
- $installer->$cmd();
+ $installer->$cmd(\@files);
}
}
else {
- $installer->$cmd();
+ $installer->$cmd(\@files);
}
}
else {
translate create fr-FR
translate update fr-FR
translate install fr-FR
+ translate install fr-FR -f search -f memberentry
translate -p install fr-FR
translate install
=head1 USAGE
+Use the -v or --verbose parameter to make translator more verbose.
+
=over
=item translate create F<lang>
available languages are updated. With -p option, only preferences .po file is
updated.
-=item translate [-p] install F<lang>
+=item translate [-p|-f] install F<lang>
-Use .po files to translate the english version of templayes and preferences files
+Use .po files to translate the english version of templates and preferences files
and copy those files in the appropriate directory. Without F<lang>, all
available languages are installed. With -p option, only preferences .po file is
updated.
+With -f parameter (repeatable) you can specify specific files to translate. For
+example, -f search will translate all templates containing 'search'.
+
=back
=cut