Re: autoconf (really Re: gettext)


Subject: Re: autoconf (really Re: gettext)
From: Tim Allen (rita_tim@tpg.com.au)
Date: Tue Jul 25 2000 - 06:30:45 CDT


On Sat, 22 Jul 2000, Joaquin Cuenca wrote:

I've had a poke around the gettext documentation and even had a desultory
go at translating the pot file for gnome-libs (yes, I did say I wasn't
going to do that so my family would keep talking to me...). After
experience translating AbiWord, I was impressed with how easy it is for
translators to use gettext. And the msgmerge tool makes it a lot easier
to do incremental updates.

> So the actual system is BAD to the non-english users.
>
> It's bad, too, for the programmers. I remember a
> comment from Martin saying that he was spended three
> hours to i18n his first dialog box. I had a similar
> experience (when you know what is required to i18n a
> dialog box, you *only* have to spend ~10 minutes).

I've done a bit of this and it didn't seem _too_ hard. The trickiest bit
comes in converting code that assumes you can statically initialise all
the text, which you can't (BTW, here is a hint to anyone writing new
dialogs: don't try to statically initialise text. If you do, then
someone will have to change your code). A bit of a pain, but
not too bad. However, it does sound like the gettext way is even easier.

> With gettext the time needed to i18n a dialog box is
> virtually 0 (just close your strings with _("string")
> ).

One thing that has always bothered me, is how efficient is this? Is it
actually doing something like a hashtable lookup for each string? Does it
only do the lookup once, or each time the string is referred to? Do the
strings get cached somewhere? I know I should wade through docs and source
to find the answers, but presumably someone here actually knows off the
top of their head, so forgive my laziness :).

> It's bad, too, for the translators. I've just
> finished the spanish translation of AbiWord and Dia.
> Dia had many many more messages than AbiWord (each
> graphical object has a description...), and Dia didn't
> have a previous semi-translated GUI.
>
> Well, it has taken approx. the same time in the two
> apps. The AbiWord messages are splitted in several
> files (we have the ap_Menu_LabelSet_xx-xx.h,
> ap_TB_LabelSet_xx-xx.h and the xx-xx.strings), there

I agree that having to track down three files to translate, and having to
run a debug build with -dumpstrings (or is it -dumpstring, or
--dumpstrings? I always have to look it up) to produce one of them, is
much less convenient that just having a single file to translate.

> are no facilities to merge an older translation with
> the new messages (I have to open the es version of
> string, the en version, and find the new strings in
> en).

Yes, this adds to the labour. One of these days I'll write a perl script
to help with this... unless we convert to gettext first :).

> So it's bad to non english users, to the hackers, and
> to the translators.
>
> However, it has a clear avantage over gettext.
> Currently, it works (with some glitches, but it
> works). So I prefer to spend my time in some more
> critical features, that actually don't work. But if
> somebody else make a working patch I think that it has
> to be committed (Do I convinced you, Eric? :)
>
> > Yeah, gettext would be more standard. I would vote
> > for it.
> >
> > Aaron Lehmann

> Joaquín Cuenca Abela

So gettext has my vote too. But like Joaquin, I don't have a patch to show
you either :-).

Tim

-- 
-----------------------------------------------------------
Tim Allen             http://www4.tpg.com.au/users/rita_tim/
tim@proximity.com.au  rita_tim@tpg.com.au



This archive was generated by hypermail 2b25 : Tue Jul 25 2000 - 06:20:10 CDT