[Po4a-devel]Two small issues with Po.pm

Martin Quinson martin.quinson@imag.fr
Fri, 26 Nov 2004 05:45:15 +0100


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

On Thu, Nov 25, 2004 at 12:27:46AM +0100, Nicolas Fran=E7ois wrote:
>=20
> The Po unescape function replace ([^\\])\\n by $1\n
> I think it should instead replace "even number of \ followed by \n"
> thus s/([^\\](\\\\)*)\\n/$1\n/g;
> (I'm joining Po.pm.escape.patch)
>=20
> If you think it is the right way to fix this issue, then I will also
> change other similar regular expressions in this module (there are many
> others).

Yes, I think so. At least, I cannot think of any better solution. Simply,
make sure to add some comments around the regexp since it becomes quite
hairly.

> The second issue is one of the problems detected by the WDIFF category of
> the testsuite (some text is present in the original, but not in the
> translation, or the contrary).
>=20
> If a man page contains something like that (in a wrapped paragraph):
> \fP
> foo
> then the font stack may "delay" the font modifier, and po4a generates the
> following paragraph: "\nfoo". The result of gettext with this msgid is
> always a null string.

This is a good ol' bug of testing the string instead of testing the
existance of the string. The little brother of testing the string instead of
testing its length. Your fix is exactly what we need, thanks a lot.

> I will fix the Man module so that the empty line will be pushed without
> translation, but the Po module may need the second patch.

Yeah, kill that beast, please.

> Both patches work, but I'm not sure of my perl and I would prefer you have
> a look at them.

Well, not much to say about one liner patches. They look good. As I said,
they just miss some comments.=20

Thank you very much,
Mt.

--8GpibOaaTibBMecb
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)

iD8DBQFBprTbIiC/MeFF8zQRArwtAJ4+yqpc4dlZ1WBOiVMrOUbhxqlzsACgjEcE
HjVE7NswXIjM8kmLAM5D3tg=
=7qis
-----END PGP SIGNATURE-----

--8GpibOaaTibBMecb--