[Po4a-devel]Re: [Po4a-commits] po4a/lib/Locale/Po4a TransTractor.pm,1.41,1.42

Martin Quinson mquinson@ens-lyon.fr
Tue, 17 Aug 2004 16:12:49 -0700


--hoZxPH4CaxYzWscb
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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
>=20
> Modified Files:
> 	TransTractor.pm=20
> 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
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 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=3D/) {
>  	        # We have detected a non-ascii line
>  		$self->{TT}{ascii_input} =3D 0;
> +		# Save the reference for future error message
> +		$self->{TT}{non_ascii_ref} ||=3D $ref;
>  	    }
>  	}
>      }
> @@ -809,7 +811,7 @@
>  	} else {
>  	    # FYI, the document charset have to be determined *before* we see t=
he 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"
>  	}
>      }
> =20
>=20
>=20
> _______________________________________________
> Po4a-commits mailing list
> Po4a-commits@lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/po4a-commits

--=20
Dans un pays d'extr=EAme droite, On se torche avec les doigts,=20
Y'a plus de journaux pour =E7a.
   -- Fr=E8res mis=E8re

--hoZxPH4CaxYzWscb
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBIpDwSJAMsfOxudIRAvkiAJ0feYsZ6D0Y+DjF680+MBCBi3KYyACfWwMd
cd8FUfwRbAZNDRE2R4nTZmw=
=xgbE
-----END PGP SIGNATURE-----

--hoZxPH4CaxYzWscb--