Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv30993/lib/Locale/Po4a
Modified Files:
Chooser.pm KernelHelp.pm Man.pm Po.pm Sgml.pm TransTractor.pm
Log Message:
Remove trailing newlines from gettext messages, they are error
prone for translators.
Index: TransTractor.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TransTractor.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- TransTractor.pm 28 Apr 2004 09:43:17 -0000 1.11
+++ TransTractor.pm 30 Apr 2004 22:47:58 -0000 1.12
@@ -334,11 +334,11 @@
sub read() {
my $self=shift;
my $filename=shift
- or croak(dgettext("po4a","Can't read from file without having a
filename\n"));
+ or croak(dgettext("po4a","Can't read from file without having a
filename")."\n");
my $linenum=1;
open INPUT,"<$filename"
- or croak (sprintf(dgettext("po4a","Can't read from %s:
%s\n"),$filename,$!));
+ or croak (sprintf(dgettext("po4a","Can't read from %s:
%s"),$filename,$!)."\n");
while (defined (my $textline = <INPUT>)) {
$linenum++;
my $ref="$filename:$linenum";
@@ -346,7 +346,7 @@
push @{$self->{TT}{doc_in}}, @entry;
}
close INPUT
- or croak (sprintf(dgettext("po4a","Can't close %s after reading:
%s\n"),$filename,$!));
+ or croak (sprintf(dgettext("po4a","Can't close %s after reading:
%s"),$filename,$!)."\n");
}
@@ -359,21 +359,21 @@
sub write {
my $self=shift;
my $filename=shift
- or croak (dgettext("po4a","Can't write to a file without
filename\n"));
+ or croak (dgettext("po4a","Can't write to a file without
filename")."\n");
my $fh;
if ($filename eq '-') {
$fh=\*STDOUT;
} else {
open $fh,">$filename"
- || croak (sprintf((dgettext("po4a","can't write to %s:
%s\n"),$filename,$!)));
+ || croak (sprintf((dgettext("po4a","can't write to %s:
%s"),$filename,$!))."\n");
}
map { print $fh $_ } $self->docheader();
map { print $fh $_ } @{$self->{TT}{doc_out}};
if ($filename ne '-') {
- close $fh || croak (sprintf(dgettext("po4a","Can't close %s after
writing: %s\n"),$filename,$!));
+ close $fh || croak (sprintf(dgettext("po4a","Can't close %s after
writing: %s"),$filename,$!)."\n");
}
}
@@ -448,25 +448,25 @@
(1,"","","","","");
unless (open (INS, "<$filename")) {
- warn sprintf(dgettext("po4a","Can't read from %s:
%s\n"),$filename,$!);
+ warn sprintf(dgettext("po4a","Can't read from %s:
%s"),$filename,$!)."\n";
goto END_PARSE_ADDFILE;
}
unless (defined ($header=<INS>) && $header) {
- warn sprintf(dgettext("po4a","Can't read Po4a header from
%s.\n"),
- $filename);
+ warn sprintf(dgettext("po4a","Can't read Po4a header from
%s."),
+ $filename)."\n";
goto END_PARSE_ADDFILE;
}
unless ($header =~ s/PO4A-HEADER://i) {
- warn sprintf(dgettext("po4a","First line of %s does not look like a Po4a
header.\n"),
- $filename);
+ warn sprintf(dgettext("po4a","First line of %s does not look like a Po4a
header."),
+ $filename)."\n";
goto END_PARSE_ADDFILE;
}
foreach my $part (split(/;/,$header)) {
unless ($part =~ m/^([^=]*)=(.*)$/) {
- warn sprintf(dgettext("po4a","Syntax error in Po4a header of %s, near
\"%s\"\n"),
- $filename,$part);
+ warn sprintf(dgettext("po4a","Syntax error in Po4a header of %s, near
\"%s\""),
+ $filename,$part)."\n";
goto END_PARSE_ADDFILE;
}
my ($key,$value)=($1,$2);
@@ -481,30 +481,30 @@
$boundary=$value;
$bmode='before';
} else {
- warn sprintf(dgettext("po4a","Invalid argument in the Po4a header of
%s: %s\n"),
- $filename,$key);
+ warn sprintf(dgettext("po4a","Invalid argument in the Po4a header of
%s: %s"),
+ $filename,$key)."\n";
goto END_PARSE_ADDFILE;
}
}
unless (length($mode)) {
- warn sprintf(dgettext("po4a","The Po4a header of %s does not define the
mode.\n"),
- $filename);
+ warn sprintf(dgettext("po4a","The Po4a header of %s does not define the
mode."),
+ $filename)."\n";
goto END_PARSE_ADDFILE;
}
unless ($mode eq "before" || $mode eq "after") {
- warn sprintf(dgettext("po4a","Mode invalid in the Po4a header of %s:
should be 'before' or 'after' not %s.\n"),
- $filename,$mode);
+ warn sprintf(dgettext("po4a","Mode invalid in the Po4a header of %s:
should be 'before' or 'after' not %s."),
+ $filename,$mode)."\n";
goto END_PARSE_ADDFILE;
}
unless (length($position)) {
- warn sprintf(dgettext("po4a","The Po4a header of %s does not define the
position.\n"),
- $filename);
+ warn sprintf(dgettext("po4a","The Po4a header of %s does not define the
position."),
+ $filename)."\n";
goto END_PARSE_ADDFILE;
}
unless ($mode eq "before" || length($boundary)) {
- warn dgettext("po4a","No ending boundary given in the Po4a header,
but mode=after.\n");
+ warn dgettext("po4a","No ending boundary given in the Po4a header,
but mode=after.")."\n";
goto END_PARSE_ADDFILE;
}
@@ -528,7 +528,7 @@
my ($self,$filename) = @_;
warn(dgettext("po4a",
- "Can't insert addendum when not given the filename\n"))
+ "Can't insert addendum when not given the filename")."\n")
unless $filename;
my ($errcode,$mode,$position,$boundary,$bmode,$lang,$content)=
@@ -538,21 +538,21 @@
my $found = scalar grep { /$position/ } @{$self->{TT}{doc_out}};
if ($found == 0) {
warn sprintf(dgettext("po4a",
- "No candidate position for the addendum %s.\n"),
- $filename);
+ "No candidate position for the addendum %s."),
+ $filename)."\n";
return 0;
}
if ($found > 1) {
warn sprintf(dgettext("po4a",
- "More than one cadidate position found for the addendum %s.\n"),
- $filename);
+ "More than one cadidate position found for the addendum %s."),
+ $filename)."\n";
return 0;
}
if ($mode eq "before") {
if ($self->verbose()) {
- map { printf STDERR (dgettext("po4a","Adding the addendum %s before
the line:\n%s\n"),
- $filename,$_) if (/$position/);
+ map { printf STDERR (dgettext("po4a","Adding the addendum %s before
the line:\n%s"),
+ $filename,$_),"\n" if (/$position/);
} @{$self->{TT}{doc_out}};
}
@{$self->{TT}{doc_out}} = map { /$position/ ? ($content,$_) : $_
@@ -562,26 +562,33 @@
while (my $line=shift @{$self->{TT}{doc_out}}) {
push @newres,$line;
if ($line =~ m/$position/) {
- printf STDERR (dgettext("po4a","Adding the addendum %s after the section
begining with the line:\n%s\n"),
- $filename,mychomp($line)) if ($self->verbose());
+ printf STDERR (dgettext("po4a",
+ "Adding the addendum %s after the section begining with the line:\n%s"),
+ $filename,mychomp($line)),"\n" if ($self->verbose());
while ($line=shift @{$self->{TT}{doc_out}}) {
last if ($line=~/$boundary/);
push @newres,$line;
}
if (defined $line) {
if ($bmode eq 'before') {
- printf STDERR (dgettext("po4a","Next section begins with:\n%s\nAddendum
added before this line.\n"),
- mychomp($line)) if ($self->verbose());
+ printf STDERR (dgettext("po4a",
+ "Next section begins with:\n".
+ "%s\n".
+ "Addendum added before this line."),
+ mychomp($line))."\n" if ($self->verbose());
push @newres,$content;
push @newres,$line;
} else {
- printf STDERR (dgettext("po4a","This section ends with:\n%s\nAddendum
added after this line.\n"),
- mychomp($line)) if ($self->verbose());
+ printf STDERR (dgettext("po4a",
+ "This section ends with:\n".
+ "%s\n".
+ "Addendum added after this line."),
+ mychomp($line))."\n" if ($self->verbose());
push @newres,$line;
push @newres,$content;
}
} else {
- printf STDERR (dgettext("po4a","Can't find the end of the
section in the file. Addendum added at the end of the file.\n"))
+ printf STDERR (dgettext("po4a","Can't find the end of the
section in the file. Addendum added at the end of the file."))."\n"
if ($self->verbose());
push @newres,$content;
}
Index: Sgml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Sgml.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- Sgml.pm 28 Apr 2004 09:51:41 -0000 1.17
+++ Sgml.pm 30 Apr 2004 22:47:58 -0000 1.18
@@ -159,7 +159,10 @@
eval qq{use SGMLS};
if ($@) {
- die gettext("po4a::sgml: The needed module SGMLS.pm was not found and needs to
be\npo4a::sgml: installed. It can be found on the CPAN, in package\npo4a::sgml:
libsgmls-perl on debian, etc.\n");
+ die gettext(
+ "po4a::sgml: The needed module SGMLS.pm was not found and needs to be\n".
+ "po4a::sgml: installed. It can be found on the CPAN, in package\n".
+ "po4a::sgml: libsgmls-perl on debian, etc.")."\n";
}
use File::Temp;
@@ -189,7 +192,7 @@
foreach my $opt (keys %options) {
if ($options{$opt}) {
- die sprintf(gettext ("po4a::sgml: Unknown option: %s\n"), $opt) unless
exists $self->{options}{$opt};
+ die sprintf(gettext ("po4a::sgml: Unknown option: %s"),
$opt)."\n" unless exists $self->{options}{$opt};
$self->{options}{$opt} = $options{$opt};
}
}
@@ -222,12 +225,12 @@
# don't translate entries composed of one entity
if (($string =~ /^&[^;]*;$/) || ($options{'wrap'} && $string =~
/^\s*&[^;]*;\s*$/)){
- warn sprintf gettext ("po4a::sgml: msgid skipped to help translators (contains only
an entity)\n"), $string;
+ warn sprintf(gettext("po4a::sgml: msgid skipped to help translators (contains only
an entity)"), $string)."\n";
return $string;
}
# don't translate entries composed of tags only
if ($string =~ /^(((<[^>]*>)|\s)*)$/) {
- warn sprintf gettext ("po4a::sgml: msgid skipped to help translators (contains only
tags)\n"), $string;
+ warn sprintf(gettext("po4a::sgml: msgid skipped to help translators (contains only
tags)"), $string)."\n";
return $string;
}
@@ -270,15 +273,18 @@
# - protect optional inclusion marker (ie, "<![ %str [" and
"]]>")
# - protect entities from expansion (ie "&release;")
open (IN,"<$filename")
- || die sprintf(gettext("Can't open %s: %s\n"),$filename,$!);
+ || die sprintf(gettext("Can't open %s: %s"),$filename,$!)."\n";
my $origfile="";
while (<IN>) {
$origfile .= $_;
}
- close IN || die sprintf(gettext("po4a::sgml: can't close %s:
%s\n"),$filename,$!);
+ close IN || die sprintf(gettext("po4a::sgml: can't close %s:
%s"),$filename,$!)."\n";
# Detect the XML pre-prolog
if ($origfile =~ s/^(\s*<\?xml[^?]*\?>)//) {
- warn sprintf(gettext("po4a::sgml: Trying to handle a XML document as a SGML
one.\npo4a::sgml: Feel lucky if it works, help us implementing a proper XML\npo4a::sgml:
backend if it does not.\n"),$filename);
+ warn sprintf(gettext(
+ "po4a::sgml: Trying to handle a XML document as a SGML one.\n".
+ "po4a::sgml: Feel lucky if it works, help us implementing a proper XML\n".
+ "po4a::sgml: backend if it does not."),$filename)."\n";
$xmlprolog=$1;
}
# Get the prolog
@@ -288,7 +294,12 @@
my $pos = 0; # where in the document (in chars) while detecting prolog boundaries
unless ($prolog =~ s/^(.*<!DOCTYPE).*$/$1/is) {
- die sprintf(gettext("po4a::sgml: This file is not a master SGML document (no
DOCTYPE).\npo4a::sgml: It may be a file to be included by another one, in which
case\npo4a::sgml: it should not be passed to po4a directly. Text from
included\npo4a::sgml: files is extracted/translated when handling the master
file\npo4a::sgml: including them.\n"), $filename);
+ die sprintf(gettext(
+ "po4a::sgml: This file is not a master SGML document (no DOCTYPE).\n".
+ "po4a::sgml: It may be a file to be included by another one, in which
case\n".
+ "po4a::sgml: it should not be passed to po4a directly. Text from
included\n".
+ "po4a::sgml: files is extracted/translated when handling the master file\n".
+ "po4a::sgml: including them."), $filename)."\n";
}
$pos += length($prolog);
$lvl=1;
@@ -382,11 +393,13 @@
} else {
if ($self->{options}{'force'}) {
- warn gettext("po4a::sgml: DTD of this file is unknown, but proceeding as
requested.\n");
+ warn gettext("po4a::sgml: DTD of this file is unknown, but proceeding as
requested.")."\n";
$self->set_tags_kind();
} else {
- die sprintf(gettext("po4a::sgml: DTD of this file is unknown. (supported:
debiandoc, docbook).\nThe prolog follows:\n%s\n"),
- $filename,$prolog);
+ die sprintf(gettext(
+ "po4a::sgml: DTD of this file is unknown. (supported: debiandoc,
docbook).\n".
+ "The prolog follows:\n%s"),
+ $filename,$prolog)."\n";
}
}
@@ -413,7 +426,7 @@
# Change the entities to their content
foreach my $key (keys %entincl) {
open IN,"<".$entincl{$key}{'filename'} ||
- die sprintf(gettext("Can't open %s: %s\n"),$entincl{$key},$!);
+ die sprintf(gettext("Can't open %s:
%s"),$entincl{$key},$!)."\n";
local $/ = undef;
$entincl{$key}{'content'} = <IN>;
close IN;
@@ -464,12 +477,12 @@
DIR => "/tmp",
UNLINK => 0);
print $tmpfh $origfile;
- close $tmpfh || die sprintf(gettext("Can't close tempfile: %s\n"),$!);
+ close $tmpfh || die sprintf(gettext("Can't close tempfile:
%s"),$!)."\n";
my $cmd="cat $tmpfile|nsgmls -l -E 0 2>/dev/null|";
print STDERR "CMD=$cmd\n" if ($debug{'generic'});
- open (IN,$cmd) || die sprintf(gettext("Can't run nsgmls: %s\n"),$!);
+ open (IN,$cmd) || die sprintf(gettext("Can't run nsgmls:
%s"),$!)."\n";
# The kind of tags
my (%translate,%empty,%verbatim,%indent,%exist);
@@ -542,8 +555,8 @@
my $type;
if ($event->type eq 'start_element') {
- die sprintf(gettext("po4a::Sgml: %s: Unknown tag %s\n"),
- $refs[$parse->line],$event->data->name)
+ die sprintf(gettext("po4a::Sgml: %s: Unknown tag %s"),
+ $refs[$parse->line],$event->data->name)."\n"
unless $exist{$event->data->name};
$lastchar = ">";
@@ -607,8 +620,8 @@
push @open,$tag;
} elsif ($indent{$event->data->name()}) {
die sprintf(gettext(
- "Closing tag for a translation container missing before %s, at %s\n"
- ),$tag,$ref)
+ "Closing tag for a translation container missing before %s, at %s"
+ ),$tag,$ref)."\n"
if (scalar @open);
}
@@ -654,8 +667,8 @@
}
} elsif ($indent{$event->data->name()}) {
die sprintf(gettext(
- "Closing tag for a translation container missing before %s, at
%s\n"
- ),$tag,$ref)
+ "Closing tag for a translation container missing before %s, at %s"
+ ),$tag,$ref)."\n"
if (scalar @open);
}
@@ -708,8 +721,8 @@
}
else {
- die sprintf(gettext("%s:%d: Unknown SGML event type: %s\n"),
- $refs[$parse->line],$event->type);
+ die sprintf(gettext("%s:%d: Unknown SGML event type: %s"),
+ $refs[$parse->line],$event->type)."\n";
}
}
Index: KernelHelp.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/KernelHelp.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- KernelHelp.pm 28 Apr 2004 08:51:38 -0000 1.4
+++ KernelHelp.pm 30 Apr 2004 22:47:58 -0000 1.5
@@ -103,7 +103,7 @@
$status=0;
}
} else {
- die sprintf(gettext("%s: Syntax error\n",$ref));
+ die sprintf(gettext("%s: Syntax error",$ref))."\n";
}
# Reinit the loop
Index: Po.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Po.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- Po.pm 28 Apr 2004 21:36:31 -0000 1.11
+++ Po.pm 30 Apr 2004 22:47:58 -0000 1.12
@@ -140,10 +140,10 @@
sub read{
my $self=shift;
my $filename=shift
- || croak (dgettext("po4a","po4a::po: Please provide a non-nul
filename\n"));
+ || croak (dgettext("po4a","po4a::po: Please provide a non-nul
filename")."\n");
open INPUT,"<$filename"
- || croak (sprintf(dgettext("po4a","Can't read from %s:
%s\n"),$filename,$!));
+ || croak (sprintf(dgettext("po4a","Can't read from %s:
%s"),$filename,$!)."\n");
## Read paragraphs line-by-line
my $pofile="";
@@ -151,7 +151,7 @@
while (defined ($textline = <INPUT>)) {
$pofile .= $textline;
}
- close INPUT || croak (sprintf(dgettext("po4a","Can't close %s
after reading: %s\n"),$filename,$!));
+ close INPUT || croak (sprintf(dgettext("po4a","Can't close %s
after reading: %s"),$filename,$!)."\n");
my $linenum=0;
@@ -181,8 +181,8 @@
} elsif ($line =~ /^(".*")/) { # continuation of a line
$buffer .= "\n$1";
} else {
- warn sprintf(dgettext("po4a","Strange line at line %s:
-->%s<--\n"),
- $linenum,$line);
+ warn sprintf(dgettext("po4a","Strange line at line %s:
-->%s<--"),
+ $linenum,$line)."\n";
}
}
$msgstr=$buffer;
@@ -206,14 +206,14 @@
sub write{
my $self=shift;
my $filename=shift
- or croak (dgettext("po4a","Can't write to a file without
filename\n"));
+ or croak (dgettext("po4a","Can't write to a file without
filename")."\n");
my $fh;
if ($filename eq '-') {
$fh=\*STDOUT;
} else {
open $fh,">$filename"
- || croak (sprintf((dgettext("po4a","can't write to %s:
%s\n"),$filename,$!)));
+ || croak (sprintf((dgettext("po4a","Can't write to %s:
%s"),$filename,$!))."\n");
}
print $fh
"".format_comment(unescape_text($self->{header_comment}),"")
@@ -272,11 +272,16 @@
my $pores=Locale::Po4a::Po->new();
if ($poorig->count_entries() > $potrans->count_entries()) {
- warn sprintf(dgettext("po4a","po4a gettextize: Original have more strings
that the translation (%d>%d).\npo4a gettextize: Please fix it by editing the translated
version to add a dummy entry.\n"),
- $poorig->count_entries() , $potrans->count_entries());
+ warn sprintf(dgettext("po4a",
+ "po4a gettextize: Original have more strings that the translation
(%d>%d).\n".
+ "po4a gettextize: Please fix it by editing the translated version to add a dummy
entry."),
+ $poorig->count_entries() , $potrans->count_entries())."\n";
} elsif ($poorig->count_entries() < $potrans->count_entries()) {
- warn sprintf(dgettext("po4a","po4a gettextize: Original have less strings
that the translation (%d<%d).\npo4a gettextize: Please fix it by removing the extra
entry from the\npo4a gettextize: translated file. You may need an addendum, cf
po4a(7).\n"),
- $poorig->count_entries() , $potrans->count_entries());
+ warn sprintf(dgettext("po4a",
+ "po4a gettextize: Original have less strings that the translation
(%d<%d).\n".
+ "po4a gettextize: Please fix it by removing the extra entry from the\n".
+ "po4a gettextize: translated file. You may need an addendum, cf po4a(7)."),
+ $poorig->count_entries() , $potrans->count_entries())."\n";
}
for (my ($o,$t)=(0,0) ;
@@ -296,18 +301,23 @@
#
# Make sure the type of both string exist
#
- die sprintf("Internal error in gettextization: type of original string number %s
isn't provided\n",$o)
+ die sprintf("Internal error in gettextization: type of original string number %s
isn't provided\n",$o)."\n"
if ($typeorig eq '');
- die sprintf("Internal error in gettextization: type of translated string number %s
isn't provided\n",$o)
+ die sprintf("Internal error in gettextization: type of translated string number %s
isn't provided\n",$o)."\n"
if ($typetrans eq '');
#
# Make sure both type are the same
#
if ($typeorig ne $potrans->{po}{$trans}{'type'}){
- die sprintf(dgettext("po4a","po4a gettextization: Structure disparity
between original and translated files:\n msgid (at %s) is of type '%s' while\n
msgstr (at %s) is of type '%s'.\nOriginal text: %s\nTranslated text:%s\n"),
- $reforig,$typeorig,$reftrans,$typetrans,$orig,$trans);
+ die sprintf(dgettext("po4a",
+ "po4a gettextization: Structure disparity between original and translated
files:\n".
+ "msgid (at %s) is of type '%s' while\n".
+ "msgstr (at %s) is of type '%s'.\n".
+ "Original text: %s\n".
+ "Translated text: %s"),
+ $reforig,$typeorig,$reftrans,$typetrans,$orig,$trans)."\n";
}
#
@@ -579,7 +589,14 @@
format_comment(". ",$reference).
quote_text($msgstr));
- warn sprintf(dgettext("po4a","Translations don't match
for:\n%s\n-->First translation: \n%s\n Second translation: \n%s\n Old translation
discarded.\n"),$txt,$first,$second);
+ warn sprintf(dgettext("po4a",
+ "Translations don't match for:\n".
+ "%s\n".
+ "-->First translation:\n".
+ "%s\n".
+ " Second translation:\n".
+ "%s\n".
+ " Old translation discarded."),$txt,$first,$second)."\n";
}
}
$self->{po}{$msgid}{'reference'} =
(defined($self->{po}{$msgid}{'reference'}) ?
Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- Man.pm 30 Apr 2004 22:47:04 -0000 1.14
+++ Man.pm 30 Apr 2004 22:47:58 -0000 1.15
@@ -286,7 +286,12 @@
sub this_macro_needs_args {
my ($macroname,$ref,$args)=@_;
unless (length($args)) {
- die sprintf(gettext("po4a::man: %s: macro %s called without arguments.\nEven if
placing the macro arguments on the next line is authorized\nby man(7), handling this would
make the po4a parser too complicate.\nPlease simply put the macro args on the same
line.\n"),$ref,$macroname);
+ die sprintf(gettext(
+ "po4a::man: %s: macro %s called without arguments.\n".
+ "po4a::man: Even if placing the macro arguments on the next line is
authorized\n".
+ "po4a::man: by man(7), handling this would make the po4a parser too
complicate.\n".
+ "po4a::man: Please simply put the macro args on the same line."
+ ),$ref,$macroname)."\n";
}
}
@@ -305,8 +310,12 @@
$str =~ s/\\fR(.*?)\\f[RP]/$1/sg;
if ($str =~ /\\f[RSBI]/) {
die sprintf(gettext(
-"po4a::man: %s: Nested font modifiers, ie, something like:\npo4a::man: \\fB bold
text \\fI italic text \\fR back to roman\npo4a::man: This is not supported, modify the
original page to something like:\npo4a::man: \\fB bold text \\fR back to roman \\fI
italic text \\fR back to roman\npo4a::man: Here is the faulty line:\n %s\n"
- ),$ref,$origstr);
+ "po4a::man: %s: Nested font modifiers, ie, something like:\n".
+ "po4a::man: \\fB bold text \\fI italic text \\fR back to roman\n".
+ "po4a::man: This is not supported, modify the original page to something
like:\n".
+ "po4a::man: \\fB bold text \\fR back to roman \\fI italic text \\fR back to
roman\n".
+ "po4a::man: Here is the faulty line:\n".
+ " %s"),$ref,$origstr)."\n";
}
# The next commented loop should take care of badly nested font modifiers,
@@ -366,7 +375,7 @@
$done .= $first if ($lvl > 0);
$rest=substr($rest,1);
}
- die sprintf(gettext("po4a::man: %s: Unbalanced '<' and '>' in
'%s'\n"),$ref||$self->{ref},$transstr)
+ die sprintf(gettext("po4a::man: %s: Unbalanced '<' and '>' in
'%s'"),$ref||$self->{ref},$transstr)."\n"
if ($lvl > 0);
$done .= "\\fR$rest";
$str=$done;
@@ -454,13 +463,13 @@
}
$self->{ref}="$ref";
# print STDERR "LINE=$line<<\n";
- die sprintf(gettext("po4a::man: %s: Escape sequence \\c encountered. This is not
handled yet.\n")
- ,$ref)
+ die sprintf(gettext("po4a::man: %s: Escape sequence \\c encountered. This is not
handled yet.")
+ ,$ref)."\n"
if ($line =~ /\\c/);
if ($line =~ /^\./) {
- die sprintf(gettext("po4a::man: Unparsable line %s\n"),$line)
+ die sprintf(gettext("po4a::man: Unparsable line:
%s"),$line)."\n"
unless ($line =~ /^\.+\\*?(\\\")(.*)/ ||
$line =~ /^\.([BI])(\W.*)/ ||
$line =~ /^\.(\S*)(.*)/);
@@ -494,9 +503,12 @@
print STDERR "End of an escaped sequence\n"
if ($debug{'splitargs'});
unless(length($elem)){
- die sprintf(gettext(
-"po4a::man: %s: Escaped space at the end of macro arg. With high\npo4a::man:
probability, it won't do the trick with po4a (because of\npo4a::man: wrapping). You
may want to remove it and use the .nf/.fi groff\npo4a::man: macro to control the
wrapping.\n"),
- $ref);
+ die sprintf(gettext(
+ "po4a::man: %s: Escaped space at the end of macro arg. With high\n".
+ "po4a::man: probability, it won't do the trick with po4a (because
of\n".
+ "po4a::man: wrapping). You may want to remove it and use the .nf/.fi
groff\n".
+ "po4a::man: macro to control the wrapping."),
+ $ref)."\n";
}
push @args,$buffer;
$buffer = "";
@@ -579,25 +591,37 @@
if ($macro eq '\"' ||
$macro eq '"') {
if ($line =~ /Pod::Man/) {
- warn gettext("This file was generated with Pod::Man. Translate the pod file
with the pod module of po4a.\n");
+ warn gettext("This file was generated with Pod::Man. Translate the pod file
with the pod module of po4a.")."\n";
exit 0;
} elsif ($line =~ /generated by help2man/) {
- warn gettext("This file was generated with help2man. Translate the source file
with the regular gettext.\n");
+ warn gettext("This file was generated with help2man. Translate the source file
with the regular gettext.")."\n";
} elsif ($line =~ /with docbook-to-man/) {
- warn gettext("This file was generated with docbook-to-man. Translate the
source file with the sgml module of po4a.\n");
+ warn gettext("This file was generated with docbook-to-man. Translate the
source file with the sgml module of po4a.")."\n";
exit 0;
} elsif ($line =~ /generated by docbook2man/) {
- warn gettext("This file was generated with docbook2man. Translate the source
file with the sgml module of po4a.\n");
+ warn gettext("This file was generated with docbook2man. Translate the source
file with the sgml module of po4a.")."\n";
exit 0;
} elsif ($line =~ /created with latex2man/) {
- warn sprintf(gettext("This file was generated with %s.\nYou should translate
the source file, but continuing anyway.\n"),"latex2man");
+ warn sprintf(gettext(
+ "This file was generated with %s.\n".
+ "You should translate the source file, but continuing anyway."
+ ),"latex2man")."\n";
} elsif ($line =~ /Generated by db2man.xsl/) {
- warn sprintf(gettext("This file was generated with %s.\nYou should translate
the source file, but continuing anyway.\n"),"db2man.xsl");
+ warn sprintf(gettext(
+ "This file was generated with %s.\n".
+ "You should translate the source file, but continuing anyway."
+ ),"db2man.xsl")."\n";
} elsif ($line =~ /generated automatically by mtex2man/) {
- warn sprintf(gettext("This file was generated with %s.\nYou should translate
the source file, but continuing anyway.\n"),"mtex2man");
+ warn sprintf(gettext(
+ "This file was generated with %s.\n".
+ "You should translate the source file, but continuing anyway."
+ ),"mtex2man")."\n";
} elsif ($line =~ /THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT./ ||
$line =~ /DO NOT EDIT/i || $line =~ /generated/i) {
- warn sprintf(gettext("This file contains the line '%s'.\nYou should
translate the source file, but continuing anyway.\n"),"$line");
+ warn sprintf(gettext(
+ "This file contains the line '%s'.\n".
+ "You should translate the source file, but continuing anyway."
+ ),"$line")."\n";
}
}
@@ -626,7 +650,9 @@
# Special case:
# .Dd => Indicates that this is a mdoc page
if ($macro eq 'Dd') {
- die gettext("po4a::man: This page seems to be a mdoc(7) formated one.\npo4a::man:
This is not supported (yet).\n");
+ die gettext(
+ "po4a::man: This page seems to be a mdoc(7) formated one.\n".
+ "po4a::man: This is not supported (yet).")."\n";
}
unshift @args,$self;
@@ -638,7 +664,9 @@
} else {
$self->pushline($line."\n");
die sprintf(gettext(
- "po4a::man: Unknown macro '%s'. Remove it from the
document,\npo4a::man: or provide a patch to
<po4a-devel\(a)lists.alioth.debian.org>.\n"),$line);
+ "po4a::man: Unknown macro '%s'. Remove it from the document,\n".
+ "po4a::man: or provide a patch to
<po4a-devel\(a)lists.alioth.debian.org>."
+ ),$line)."\n";
}
} elsif ($line =~ /^( +)([^.].*)/) {
@@ -856,7 +884,9 @@
$macro{'ad'}=\&untranslated;
# .de macro Define or redefine macro until .. is encountered.
$macro{'de'}=sub {
- die gettext("po4a::man: This page defines a new macro with '.de'. Since
po4a is not a\npo4a::man: real groff parser, this is not supported.\n");
+ die gettext(
+ "po4a::man: This page defines a new macro with '.de'. Since po4a is not
a\n".
+ "po4a::man: real groff parser, this is not supported.")."\n";
};
# .ds stringvar anything
# Set stringvar to anything.
@@ -878,7 +908,9 @@
# .ie cond anything If cond then anything else goto .el.
# .if cond anything If cond then anything; otherwise do nothing.
$macro{'ie'}=$macro{'if'}=sub {
- die sprintf(gettext("po4a::man: This page uses conditionals with '%s'.
Since po4a is not a real\npo4a::man: groff parser, this is not
supported.\n",$_[1]));
+ die sprintf(gettext(
+ "po4a::man: This page uses conditionals with '%s'. Since po4a is not a
real\n".
+ "po4a::man: groff parser, this is not supported.",$_[1]))."\n";
};
# .in N Change indent according to N (default scaling indicator m).
$macro{'in'}=\&untranslated;
Index: Chooser.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Chooser.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Chooser.pm 28 Apr 2004 08:48:31 -0000 1.8
+++ Chooser.pm 30 Apr 2004 22:47:58 -0000 1.9
@@ -35,8 +35,8 @@
if (! UNIVERSAL::can("Locale::Po4a::$modname", 'new')) {
eval qq{use Locale::Po4a::$modname};
if ($@) {
- warn sprintf(gettext("Unknown format type: %s.\n"), $module);
- warn "Module loading error: $@\n" if $options{'verbose'};
+ warn sprintf(gettext("Unknown format type: %s."),
$module)."\n";
+ warn sprintf(gettext("Module loading error: %s"), $(a))."\n" if
$options{'verbose'};
list(1);
}
}
@@ -49,7 +49,7 @@
# " - html: HTML documents (EXPERIMENTAL).\n".
" - man: Good old manual page format.\n".
" - pod: Perl Online Documentation format.\n".
- " - sgml: either debiandoc or docbook DTD.\n");
+ " - sgml: either debiandoc or docbook DTD.")."\n";
exit shift;
}
##############################################################################