gettext (was Re: autoconf)


Subject: gettext (was Re: autoconf)
From: Joaquin Cuenca (e98cuenc@yahoo.com)
Date: Tue Jul 25 2000 - 16:57:32 CDT


--- Tim Allen <rita_tim@tpg.com.au> wrote:
> 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.

*IT'S* easier. For instance, with gettext:

static char *str = N_("a sample string");
.
.
.
printf("And it works: %s\n", _(str));

and with the actual method you have to *code* (code
that may have bugs). For instance, your code (was your
code, isn't it?) to finish the i18n goto dialog box
(which introduces a new memleak).

>
> > 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

It's not a problem. Everybody is using it, and there
are not speed penalties.

> > 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

- in the gtk version, -- in the gnome version.

> 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 :).

And why reinvent the wheel?

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

Yeah, but I only want to expose clearly the
differences between the actual system and gettext.

I know that everybody is tired of this thread (in this
and in their past incarnations), and I won't be
surprised if I get hit by rocks when I walk down the
street for restarting this thread, but usually I don't
have the time to resume all the gettext advantages
(and now I have a bit of free time... sorry for these
that don't have the time and are bothered by this
thread).

I promis to not resurrect this thread anymore.

=====
Joaquin Cuenca Abela
e-mail: e98cuenc@yahoo.com

__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com/



This archive was generated by hypermail 2b25 : Tue Jul 25 2000 - 16:57:35 CDT