[Po4a-devel]Add an option to tweak po references

Martin Quinson martin.quinson@loria.fr
Tue, 28 Jun 2005 21:50:20 +0200


--R3G7APHDIzY6R/pk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jun 28, 2005 at 07:44:23PM +0200, Francois Gouget wrote:
>=20
> Currently the po references contain the file and line number:
> #: ../wine-user-en-sgml/wine-user.sgml:82=20
> ../wine-user-en-sgml/glossary.sgml:171
>=20
> What this means is that if someone adds a line near the beginning of=20
> wine-user.sgml we will get thousands of lines of diff the next time=20
> po4a-updatepo is run.
>=20
> I know po tools can probably hide this issue from users (though that=20
> doesn't help me since I use xemacs) but this is still going to be a=20
> problem when comparing two CVS version of the po file. This is also a=20
> big nuisance when trying to merge CVS branches. Look at the output of=20
> the following command to see what I mean:
>=20
> cvs diff -r1.4 -r1.5 po/pod/fr.po
>=20
> Also I feel that references that include the line number are less useful=
=20
> when translating documentation than when translating the strings used in=
=20
> a program. The strings in a program are often pretty short, sometimes a=
=20
> single word like 'Close' and searching for such strings is difficult due=
=20
> to false positives. Thus for programs the line number information is=20
> quite useful. But, when translating the documentation, each msgid is a=20
> paragraph which usually contains at least a full sentence. So it's easy=
=20
> to find the relevant place in the source SGML file by searching for a=20
> sequence of two or three words.

I always play with -I^#: but I agree that this may be suboptimal, and with
your point in general.

> So I propose to add a 'porefs' option to po4a-updatepo which would allow=
=20
> the user to control the addition of references. It would have three=20
> possible values:
>=20
>  * none
>    No references are added
>=20
>  * noline
>    References are added but all line numbers are set to '1'. I'm=20
> keeping  a line number for compatibility with po tools let the user open=
=20
> the relevant file by double clicking on the reference.
>=20
>  * full
>    This would be the default and work just as it does today.
>=20
>=20
> Now, the logical place to implement this is the Po.pm module but it was=
=20
> not possible to pass options to it. So I added a -O option which passes=
=20
> options to the Po.pm module (via TransTractor,pm) instead of the format=
=20
> module.

I don't really like it. Users shouldn't really care about whether the option
is for this part of the code or that one. Couldn't we seed the option set of
each modules from the transtractor code or such?

> Let me know if this sounds ok or if another approach should be used.

I was about commiting this as is, and I then thought that I'll never have
the courage to do it right if I don't do so right now.

Mixing module options and "general" ones (ie, for Po.pm or so) would also
allow to add this feature to all binaries, not only updatepo. The price to
pay should only be to come up with a common way to handle options accross
modules and binaries (unless I missed something). That sounds doable.
=20

I'll try to give it a spin tomorow.
Mt.

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

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

iD8DBQFCwan8IiC/MeFF8zQRAv8MAJ9JdCVa1d16P032zz//VlNmfnzuzgCeOR5j
jQ9Bg5MULMlI36nlr9X37WM=
=BSyH
-----END PGP SIGNATURE-----

--R3G7APHDIzY6R/pk--