[Po4a-commits] po4a po4a,1.20,1.21 po4a-gettextize,1.25,1.26 po4a-normalize,1.19,1.20 po4a-translate,1.31,1.32 po4a-updatepo,1.28,1.29
Jordi Vilalta
po4a-devel@lists.alioth.debian.org
Sat, 05 Feb 2005 13:03:25 +0000
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv27110
Modified Files:
po4a po4a-gettextize po4a-normalize po4a-translate
po4a-updatepo
Log Message:
Adapted the main scripts to use the new common functions
Index: po4a-normalize
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-normalize,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- po4a-normalize 7 Jan 2005 22:50:51 -0000 1.19
+++ po4a-normalize 5 Feb 2005 13:03:22 -0000 1.20
@@ -90,6 +90,7 @@
use Locale::Po4a::Chooser;
use Locale::Po4a::TransTractor;
+use Locale::Po4a::Common;
use Getopt::Long qw(GetOptions);
@@ -102,14 +103,7 @@
textdomain('po4a');
sub show_version {
- print sprintf(gettext(
- "%s version %s.\n".
- "written by Martin Quinson and Denis Barbier.\n\n".
- "Copyright (C) 2002, 2003, 2004 Software of Public Interest, Inc.\n".
- "This is free software; see source code for copying\n".
- "conditions. There is NO warranty; not even for\n".
- "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
- ),"po4a-normalize",$VERSION)."\n";
+ Locale::Po4a::Common::show_version("po4a-normalize");
exit 0;
}
@@ -117,17 +111,17 @@
my ($mastchar);
Getopt::Long::Configure('no_auto_abbrev','no_ignore_case');
GetOptions(
- 'help|h' => \$help,
+ 'help|h' => \$help,
'help-format' => \$help_fmt,
- 'format|f=s' => \$type,
+ 'format|f=s' => \$type,
'master-charset|M=s' => \$mastchar,
- 'option|o=s' => \@options,
+ 'option|o=s' => \@options,
- 'verbose|v' => \$verbose,
- 'debug|d' => \$debug,
- 'version|V' => \&show_version
+ 'verbose|v' => \$verbose,
+ 'debug|d' => \$debug,
+ 'version|V' => \&show_version
) or pod2usage(1);
$help && pod2usage (0);
@@ -148,7 +142,7 @@
my $parser=Locale::Po4a::Chooser::new($type,%options);
my $filename = shift || pod2usage(1);
--e $filename || die sprintf(gettext("File %s does not exist."),$filename)."\n";
+-e $filename || die wrap_msg(gettext("File %s does not exist."), $filename);
$parser->read($filename);
$parser->{TT}{utf_mode} = 1;
Index: po4a-translate
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-translate,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- po4a-translate 7 Jan 2005 22:50:51 -0000 1.31
+++ po4a-translate 5 Feb 2005 13:03:22 -0000 1.32
@@ -154,6 +154,7 @@
use Locale::Po4a::Chooser;
use Locale::Po4a::TransTractor;
+use Locale::Po4a::Common;
use Pod::Usage qw(pod2usage);
use Getopt::Long qw(GetOptions);
@@ -165,14 +166,7 @@
textdomain("po4a");
sub show_version {
- print sprintf(gettext(
- "%s version %s.\n".
- "written by Martin Quinson and Denis Barbier.\n\n".
- "Copyright (C) 2002, 2003, 2004 Software of Public Interest, Inc.\n".
- "This is free software; see source code for copying\n".
- "conditions. There is NO warranty; not even for\n".
- "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
- ),"po4a-translate",$VERSION)."\n";
+ Locale::Po4a::Common::show_version("po4a-translate");
exit 0;
}
@@ -183,11 +177,11 @@
my ($master_filename,$po_filename);
my ($mastchar,$locchar,$addchar);
GetOptions(
- 'help|h' => \$help,
- 'help-format' => \$help_fmt,
+ 'help|h' => \$help,
+ 'help-format' => \$help_fmt,
'master|m=s' => \$master_filename,
- 'localized|l=s' => \$outfile,
+ 'localized|l=s' => \$outfile,
'po|p=s' => \$po_filename,
'addendum|a=s' => \@addfiles,
'format|f=s' => \$format,
@@ -196,14 +190,14 @@
'localized-charset|L=s' => \$locchar,
'addendum-charset|A=s' => \$addchar,
- 'option|o=s' => \@options,
-
+ 'option|o=s' => \@options,
+
'width|w=s' => \$width,
'verbose|v' => \@verbose,
'debug|d' => \$debug,
'keep|k=s' => \$threshold,
-
- 'version|V' => \&show_version
+
+ 'version|V' => \&show_version
) or pod2usage(1);
$help && pod2usage(0);
@@ -211,8 +205,8 @@
(defined($master_filename) && length($master_filename))||pod2usage(1);
(defined($po_filename) && length($po_filename)) ||pod2usage(1);
--e $master_filename || die sprintf(gettext("%s: file %s does not exist."),"po4a-translate",$master_filename)."\n";
--e $po_filename || die sprintf(gettext("%s: file %s does not exist."),"po4a-translate",$po_filename)."\n";
+-e $master_filename || die wrap_msg(gettext("File %s does not exist."), $master_filename);
+-e $po_filename || die wrap_msg(gettext("File %s does not exist."), $po_filename);
my (@pos,@masters);
push @pos,$po_filename;
@@ -243,21 +237,21 @@
my ($percent,$hit,$queries) = $doc->stats();
my $error=0;
-print STDERR sprintf(gettext("%s is %s%% translated (%s of %s strings)."),
- $master_filename,$percent,$hit,$queries)."\n"
- if (scalar @verbose) && ($percent>=$threshold);
+print STDERR wrap_msg(gettext("%s is %s%% translated (%s of %s strings)."),
+ $master_filename, $percent, $hit, $queries)
+ if (scalar @verbose) && ($percent>=$threshold);
if ($percent<$threshold) {
- print STDERR sprintf(gettext("Discard the translation of %s (only %s%% translated; need %s%%)."),
- $master_filename,$percent,$threshold)."\n";
+ print STDERR wrap_msg(gettext("Discard the translation of %s (only %s%% translated; need %s%%)."),
+ $master_filename, $percent, $threshold);
unlink($outfile) if (-e $outfile);
} else {
foreach my $add (@addfiles) {
unless ($doc->addendum($add)) {
unlink($outfile) if (-e $outfile);
- die sprintf(gettext("Discard the translation of %s (addendum %s does not apply)."),
- $master_filename,$add)."\n";
+ die wrap_msg(gettext("Discard the translation of %s (addendum %s does not apply)."),
+ $master_filename, $add);
}
}
$doc->write($outfile);
Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- po4a 7 Jan 2005 22:50:51 -0000 1.20
+++ po4a 5 Feb 2005 13:03:22 -0000 1.21
@@ -168,6 +168,7 @@
use Locale::Po4a::Chooser;
use Locale::Po4a::TransTractor;
+use Locale::Po4a::Common;
use Pod::Usage qw(pod2usage);
@@ -181,14 +182,7 @@
sub show_version {
- print sprintf(gettext(
- "%s version %s.\n".
- "written by Martin Quinson and Denis Barbier.\n\n".
- "Copyright (C) 2002, 2003, 2004 Software of Public Interest, Inc.\n".
- "This is free software; see source code for copying\n".
- "conditions. There is NO warranty; not even for\n".
- "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
- ), "po4a", $VERSION)."\n";
+ Locale::Po4a::Common::show_version("po4a");
exit 0;
}
@@ -200,18 +194,18 @@
my ($mastchar,$locchar,$addchar);
Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
GetOptions(
- 'help|h' => \$help,
-
+ 'help|h' => \$help,
+
'master-charset|M=s' => \$mastchar,
'localized-charset|L=s' => \$locchar,
'addendum-charset|A=s' => \$addchar,
- 'verbose|v' => \@verbose,
- 'debug|d' => \$debug,
- 'quiet|q' => \$quiet,
+ 'verbose|v' => \@verbose,
+ 'debug|d' => \$debug,
+ 'quiet|q' => \$quiet,
'split|s' => \$split,
'keep|k=s' => \$threshold,
- 'version|V' => \&show_version
+ 'version|V' => \&show_version
) or pod2usage(1);
# Argument check
@@ -234,13 +228,13 @@
my $config_file= shift(@ARGV) || pod2usage(1);
# Check file existence
--e $config_file || die sprintf(gettext("File %s does not exist."),$config_file)."\n";
+-e $config_file || die wrap_msg(gettext("File %s does not exist."), $config_file);
# Parse the config file
my ($pot_filename) = "";
my (%po_filename); # po_files: '$lang'=>'$path'
my (%document); # '$master'=> {'format'=>'$format'; '$lang'=>'$path'; 'add_$lang'=>('$path','$path') }
-open CONFIG,"$config_file" || die sprintf(gettext("Can't open %s: %s"),$config_file,$!)."\n";
+open CONFIG,"$config_file" || die wrap_msg(gettext("Can't open %s: %s"), $config_file, $!);
my ($line,$nb) = ("",0);
while (<CONFIG>) {
$nb++;
@@ -253,72 +247,63 @@
chomp($line);
next if ($line =~ s/\\$//);
next unless ($line =~ /\S/);
-
- die sprintf("%s:%d: ".gettext("Syntax error: %s")."\n",$config_file,$nb,$line)
+
+ die wrap_ref_mod("$config_file:$nb", "", gettext("Syntax error: %s"), $line)
unless ($line =~ m/^\[([^\]]*)\] (\S+) (.*)$/ || $line =~ m/^\[([^\]]*)\] (\S+)$/);
my ($cmd,$main,$args)=($1,$2,$3||"");
-
+
print "cmd=[$cmd]; main=$main; args=\"$args\"\n" if $debug;
-
+
if ($cmd eq "po4a_paths") {
- die sprintf("%s:%d: ".
- gettext("'po4a_path' redeclared").
- "\n",
- $config_file,$nb)
+ die wrap_ref_mod("$config_file:$nb", "",
+ gettext("'po4a_path' redeclared"))
if (length $pot_filename);
$pot_filename = $main;
foreach my $arg (split(/ /,$args)) {
- die sprintf("%s:%d: ".
- gettext("Unparsable argument '%s'.").
- "\n",
- $config_file,$nb,$arg)
+ die wrap_ref_mod("$config_file:$nb", "",
+ gettext("Unparsable argument '%s'."), $arg)
unless ($arg =~ /^([^:]*):(.*)/);
$po_filename{$1}=$2;
}
-
+
} elsif ($cmd =~ m/type: *(.*)/) {
- $document{$main}{'format'} = $1;
+ $document{$main}{'format'} = $1;
foreach my $arg (split(/ /,$args)) {
- die sprintf("%s:%d: ".
- gettext("Unparsable argument '%s' (%s).").
- "\n",
- $config_file,$nb,$arg,$line)
+ die wrap_ref_mod("$config_file:$nb", "",
+ gettext("Unparsable argument '%s' (%s)."), $arg, $line)
unless ($arg =~ /^([^:]*):(.*)/);
my ($lang,$trans)=($1,$2);
- die sprintf("%s:%d: ".
- gettext("The translated and master file are the same.")."\n",
- $config_file,$nb)
+ die wrap_ref_mod("$config_file:$nb", "",
+ gettext("The translated and master file are the same."))
if ($main eq $trans);
-
+
if ($lang =~ /add_/) {
push @{$document{$main}{$lang}},$trans;
} else {
- die sprintf("%s:%d: ".
- gettext("Translation of %s in %s redefined"),
- $config_file,$nb,$main,$lang)
+ die wrap_ref_mod("$config_file:$nb", "",
+ gettext("Translation of %s in %s redefined"), $main, $lang)
if (defined $document{$main}{$lang});
$document{$main}{$lang} = $trans;
}
}
} else {
- die sprintf("%s:%d: ".
- gettext("Unparsable command '%s'.")."\n",
- $config_file,$nb,$cmd);
+ die wrap_ref_mod("$config_file:$nb", "",
+ gettext("Unparsable command '%s'."), $cmd);
}
-
+
$line = "";
}
close CONFIG; # don't care about error here
-die gettext("po4a_paths not declared. Dunno where to find the pot and po files")."\n"
+die wrap_msg(gettext("po4a_paths not declared. Dunno where to find the pot and po files"))
unless (length $pot_filename);
# make a big pot
if (-e $pot_filename) {
- print sprintf(gettext("Updating %s:"),$pot_filename)
+ print wrap_msg(gettext("Updating %s:"), $pot_filename)
if $verbose;
} else {
- print sprintf(gettext("Creating %s:"),$pot_filename)
+ print wrap_msg(gettext("Creating %s:"), $pot_filename)
if $verbose;
}
@@ -328,7 +313,7 @@
# We ensure that the generated po will be in utf-8 if the input document
# isn't entirely in ascii
$doc->{TT}{utf_mode} = 1;
-
+
$doc->setpoout($potfile);
my @file_in_name;
push @file_in_name, $master;
@@ -338,14 +323,14 @@
}
$potfile->write($pot_filename);
-printf (gettext(" (%d entries)")."\n",$potfile->count_entries());
+print wrap_msg(gettext(" (%d entries)"), $potfile->count_entries());
# update all po files
my $lang;
foreach $lang (sort keys %po_filename) {
if (-e $po_filename{$lang}) {
- print STDERR sprintf(gettext("Updating %s: "),$po_filename{$lang})
- if ($verbose);
+ print STDERR wrap_msg(gettext("Updating %s:")." ", $po_filename{$lang})
+ if ($verbose);
if ($split) {
my ($pot_filename,$po_filename,$bigpo_filename);
(undef,$pot_filename)=File::Temp->tempfile("po4aXXXX",
@@ -353,16 +338,16 @@
SUFFIX => ".pot",
OPEN => 0,
UNLINK => 0)
- or die sprintf(gettext("Can't create a temporary pot file: %s"),$!)."\n";
+ or die wrap_msg(gettext("Can't create a temporary pot file: %s"), $!);
(undef,$po_filename)=File::Temp->tempfile("po4aXXXX",
DIR => "/tmp",
SUFFIX => ".po",
OPEN => 0,
UNLINK => 0)
- or die sprintf(gettext("Can't create a temporary po file: %s"),$!)."\n";
+ or die wrap_msg(gettext("Can't create a temporary po file: %s"), $!);
my ($poorig,$pores)=(Locale::Po4a::Po->new(),Locale::Po4a::Po->new());
$poorig->read($po_filename{$lang});
-
+
foreach my $master (sort keys %document) {
my $pot=Locale::Po4a::Po->new();
my $po=Locale::Po4a::Po->new();
@@ -373,28 +358,28 @@
$po=$poorig->select_file($master);
unlink($pot_filename) if -e $pot_filename;
unlink($po_filename) if -e $po_filename;
-
+
$pot->write($pot_filename);
$po->write($po_filename);
system ("msgmerge -U $po_filename $pot_filename")
- && die sprintf(gettext("Error while running msgmerge: %s"),$!)."\n";
+ && die wrap_msg(gettext("Error while running msgmerge: %s"), $!);
$pores->read($po_filename);
}
$pores->write($po_filename{$lang}.".new");
unlink($pot_filename) if -e $pot_filename;
unlink($po_filename) if -e $po_filename;
-
- } else {
+
+ } else {
system ("msgmerge -U ".$po_filename{$lang}." $pot_filename ".($verbose?"":">/dev/null 2>/dev/null"))
- && die sprintf(gettext("Error while running msgmerge: %s"),$!)."\n";
+ && die wrap_msg(gettext("Error while running msgmerge: %s"), $!);
system "msgfmt --statistics -v -o /dev/null ".$po_filename{$lang}
if $verbose;
}
} else {
- print STDERR sprintf(gettext("Creating %s:")."\n",$po_filename{$lang})
- if $verbose;
+ print STDERR wrap_msg(gettext("Creating %s:"), $po_filename{$lang})
+ if $verbose;
system ("cp",$pot_filename,$po_filename{$lang}) == 0 ||
- die sprintf(gettext("Error while copying the po file: %s"),$!)."\n";
+ die wrap_msg(gettext("Error while copying the po file: %s"), $!);
}
}
# update all translations
@@ -402,34 +387,34 @@
foreach $lang (sort keys %po_filename) {
DOC: foreach my $master (sort keys %document) {
next unless defined $document{$master}{$lang};
-
+
my $doc=Locale::Po4a::Chooser::new($document{$master}{'format'} ,%options);
-
+
my (@file_in_name,@po_in_name);
push @file_in_name, $master;
push @po_in_name, $po_filename{$lang};
-
+
$doc->process('file_in_name' => \@file_in_name,
'file_out_name' => $document{$master}{$lang},
'po_in_name' => \@po_in_name,
'file_in_charset' => $mastchar,
'file_out_charset' => $locchar,
'addendum_charset' => $addchar);
-
+
my ($percent,$hit,$queries) = $doc->stats();
-
+
if ($percent<$threshold) {
- print STDERR sprintf(gettext("Discard %s (only %s%% translated; need %s%%)."),
- $document{$master}{$lang},$percent,$threshold)."\n";
+ print STDERR wrap_msg(gettext("Discard %s (only %s%% translated; need %s%%)."),
+ $document{$master}{$lang}, $percent, $threshold);
unlink($document{$master}{$lang}) if (-e $document{$master}{$lang});
next DOC;
}
-
+
if (defined ($document{$master}{"add_$lang"})) {
foreach my $add (@{$document{$master}{"add_$lang"}}) {
if ( !$doc->addendum($add) ) {
- die sprintf(gettext("Addendum %s does NOT apply to %s (translation discarded)."),
- $add,$document{$master}{$lang})."\n";
+ die wrap_msg(gettext("Addendum %s does NOT apply to %s (translation discarded)."),
+ $add, $document{$master}{$lang});
unlink($document{$master}{$lang}) if (-e $document{$master}{$lang});
next DOC;
}
@@ -437,11 +422,11 @@
}
if ($verbose) {
if ($percent == 100) {
- print STDERR sprintf(gettext("%s is %s%% translated (%s strings)."),
- $document{$master}{$lang},$percent,$queries)."\n";
+ print STDERR wrap_msg(gettext("%s is %s%% translated (%s strings)."),
+ $document{$master}{$lang}, $percent, $queries);
} else {
- print STDERR sprintf(gettext("%s is %s%% translated (%s of %s strings)."),
- $document{$master}{$lang},$percent,$hit,$queries)."\n";
+ print STDERR wrap_msg(gettext("%s is %s%% translated (%s of %s strings)."),
+ $document{$master}{$lang}, $percent, $hit, $queries);
}
}
Index: po4a-updatepo
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-updatepo,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- po4a-updatepo 7 Jan 2005 22:50:51 -0000 1.28
+++ po4a-updatepo 5 Feb 2005 13:03:22 -0000 1.29
@@ -118,6 +118,7 @@
use Locale::Po4a::Chooser;
use Locale::Po4a::TransTractor;
+use Locale::Po4a::Common;
use Pod::Usage qw(pod2usage);
@@ -130,14 +131,7 @@
textdomain('po4a');
sub show_version {
- print sprintf(gettext(
- "%s version %s.\n".
- "written by Martin Quinson and Denis Barbier.\n\n".
- "Copyright (C) 2002, 2003, 2004 Software of Public Interest, Inc.\n".
- "This is free software; see source code for copying\n".
- "conditions. There is NO warranty; not even for\n".
- "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
- ),"po4a-updatepo",$VERSION)."\n";
+ Locale::Po4a::Common::show_version("po4a-updatepo");
exit 0;
}
@@ -150,21 +144,21 @@
my ($help,$help_fmt,$verbose,$debug,$format,@options);
my $mastchar;
GetOptions('help|h' => \$help,
- 'help-format' => \$help_fmt,
-
+ 'help-format' => \$help_fmt,
+
'master|m=s' => \@masterfiles,
'po|p=s' => \@pofiles,
'format|f=s' => \$format,
- 'master-charset|M=s' => \$mastchar,
+ 'master-charset|M=s' => \$mastchar,
- 'option|o=s' => \@options,
+ 'option|o=s' => \@options,
'verbose|v' => \$verbose,
'debug|d' => \$debug,
'version|V' => \&show_version)
or pod2usage(1);
-
+
$help && pod2usage (0);
$help_fmt && Locale::Po4a::Chooser::list(0);
pod2usage (1) if scalar @masterfiles < 1 || scalar @pofiles < 1;
@@ -184,9 +178,9 @@
# parser
my ($doc)=Locale::Po4a::Chooser::new($format,%options);
-map { -e $_ || die sprintf(gettext("File %s does not exist."),$_)."\n" } @masterfiles;
-map { die(gettext("po4a-updatepo can't take the input po from stdin."))."\n"
- if $_ eq '-' && !-e '-'} @pofiles;
+map { -e $_ || die wrap_msg(gettext("File %s does not exist."), $_) } @masterfiles;
+map { die wrap_msg(gettext("po4a-updatepo can't take the input po from stdin."))
+ if $_ eq '-' && !-e '-'} @pofiles;
my ($pot_filename);
(undef,$pot_filename)=File::Temp->tempfile("po4a-updatepoXXXX",
@@ -194,10 +188,10 @@
SUFFIX => ".pot",
OPEN => 0,
UNLINK => 0)
- or die sprintf(gettext("Can't create a temporary pot file: %s"),$!)."\n";
+ or die wrap_msg(gettext("Can't create a temporary pot file: %s"), $!);
-print STDERR gettext("Parse input files... ") if $verbose;
+print STDERR wrap_msg(gettext("Parse input files... ")) if $verbose;
$doc->{TT}{utf_mode} = 1;
@@ -207,22 +201,22 @@
'debug' => $debug,
'verbose' => $verbose);
-print STDERR gettext("done.")."\n" if $verbose;
+print STDERR wrap_msg(gettext("done.")) if $verbose;
while (my $po_filename=shift @pofiles) {
if (-e $po_filename) {
- print STDERR sprintf(gettext("Updating %s:"),$po_filename)
- if $verbose;
+ print STDERR wrap_msg(gettext("Updating %s:"), $po_filename)
+ if $verbose;
system ("msgmerge","-U",$po_filename,$pot_filename) == 0 ||
- die sprintf(gettext("Error while running msgmerge: %s"),$!)."\n";
- system "msgfmt --statistics -v -o /dev/null $po_filename"
+ die wrap_msg(gettext("Error while running msgmerge: %s"), $!);
+ system "msgfmt --statistics -v -o /dev/null $po_filename"
if $verbose;
} else {
- print STDERR sprintf(gettext("Creating %s:"),$po_filename)
- if $verbose;
+ print STDERR wrap_msg(gettext("Creating %s:"), $po_filename)
+ if $verbose;
system ("cp",$pot_filename,$po_filename) == 0 ||
- die sprintf(gettext("Error while copying the po file: %s"),$!)."\n";
+ die wrap_msg(gettext("Error while copying the po file: %s"), $!);
}
}
Index: po4a-gettextize
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-gettextize,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- po4a-gettextize 7 Jan 2005 22:50:51 -0000 1.25
+++ po4a-gettextize 5 Feb 2005 13:03:22 -0000 1.26
@@ -139,6 +139,7 @@
use Locale::Po4a::Chooser;
use Locale::Po4a::TransTractor;
+use Locale::Po4a::Common;
use Pod::Usage qw(pod2usage);
@@ -150,14 +151,7 @@
sub show_version {
- print sprintf(gettext(
- "%s version %s.\n".
- "written by Martin Quinson and Denis Barbier.\n\n".
- "Copyright (C) 2002, 2003, 2004 Software of Public Interest, Inc.\n".
- "This is free software; see source code for copying\n".
- "conditions. There is NO warranty; not even for\n".
- "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
- ), "po4a-gettextize", $VERSION)."\n";
+ Locale::Po4a::Common::show_version("po4a-gettextize");
exit 0;
}
@@ -166,22 +160,22 @@
my ($mastchar,$locchar);
Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
GetOptions(
- 'help|h' => \$help,
+ 'help|h' => \$help,
'help-format' => \$help_fmt,
- 'master|m=s' => \$masterfile,
+ 'master|m=s' => \$masterfile,
'localized|l=s' => \$locfile,
- 'po|p=s' => \$pofile,
- 'format|f=s' => \$type,
+ 'po|p=s' => \$pofile,
+ 'format|f=s' => \$type,
'master-charset|M=s' => \$mastchar,
'localized-charset|L=s' => \$locchar,
- 'option|o=s' => \@options,
+ 'option|o=s' => \@options,
- 'verbose|v' => \$verbose,
- 'debug|d' => \$debug,
- 'version|V' => \&show_version
+ 'verbose|v' => \$verbose,
+ 'debug|d' => \$debug,
+ 'version|V' => \&show_version
) or pod2usage(1);
# Argument check
@@ -202,9 +196,9 @@
}
}
# Check file existence
--e $masterfile || die sprintf(gettext("File %s does not exist."),$masterfile)."\n";
+-e $masterfile || die wrap_msg(gettext("File %s does not exist."), $masterfile);
if (defined $locfile && length($locfile)) {
- -e $locfile || die sprintf(gettext("File %s does not exist."),$locfile)."\n";
+ -e $locfile || die wrap_msg(gettext("File %s does not exist."), $locfile);
}
# Declare the TransTractor parsers
@@ -235,5 +229,5 @@
$mergedpo->write($pofile);
}
-
+
__END__