On Tue, Aug 17, 2004 at 10:38:53PM +0000, Jordi Vilalta wrote:
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv13365/lib/Locale/Po4a
Modified Files:
TransTractor.pm
Log Message:
Say the reference to the first line with non-ascii encoding on error if it
couldn't determine the document encoding
Thanks. Is is safe to make the same change at line 954, where this error
message also appear?
I reworded a bit the message. I prefer to say "at $ref" than "in
$ref". I'm
not sure which one is the best, but anyway.
Moreover, I think we may want to go for a gcc-like notation when possible. Ie:
FILE:LINE: error message.
Actually, the user probably don't really care whether the error comes from
the core of po4a, or this or that module. Not speaking that he knows which
module it is, most of the time, since he provided the -f flag...
Another good point about that is that emacs undertand this notation and jump
to the error point. I'm often pissed of by perl, which hides the error point
right in the middle of the phrase, and I know realize I did the same for
po4a :-/
If you agree with me, I'm not sure whether we want to change this right away
(and fuzzy 95% of the strings again), or later.
Bye, Mt.
Index: TransTractor.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TransTractor.pm,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- TransTractor.pm 16 Aug 2004 23:40:23 -0000 1.41
+++ TransTractor.pm 17 Aug 2004 22:38:51 -0000 1.42
@@ -378,6 +378,8 @@
if (!ref($decoder) or $decoder !~ /Encode::XS=/) {
# We have detected a non-ascii line
$self->{TT}{ascii_input} = 0;
+ # Save the reference for future error message
+ $self->{TT}{non_ascii_ref} ||= $ref;
}
}
}
@@ -809,7 +811,7 @@
} else {
# FYI, the document charset have to be determined *before* we see the first
# string to recode.
- die "po4a: ".dgettext("po4a","Couldn't determine the
input document's character set. Please specify it on the command
line.")."\n"
+ die "po4a: ".sprintf(dgettext("po4a","Couldn't
determine the input document's character set. Please specify it on the command line.
First non-ascii character appears in
%s"),$self->{TT}{non_ascii_ref})."\n"
}
}
_______________________________________________
Po4a-commits mailing list
Po4a-commits(a)lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/po4a-commits
--
Dans un pays d'extrême droite, On se torche avec les doigts,
Y'a plus de journaux pour ça.
-- Frères misère