Complete.Org: Mailing Lists: Archives: freeciv-dev: November 1998:
[Freeciv-Dev] gettext support
Home

[Freeciv-Dev] gettext support

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] gettext support
From: Per Mathisen <permath@xxxxxxxxxxx>
Date: Fri, 13 Nov 1998 18:04:56 +0100 (MET)

I have written the beginnings of gettext support for freeciv. Currently
this is baked into my own rewrite of configure.in (as seen below), but I
can rather easily make a patch to the cvs configure.in. The problem is
that once I begin marking strings as translatable, this patch will become
a nightmare to maintain.

Could this be put into the roadmap somewhere? I would prefer 1.7.3 myself;
though the changes required are extensive they are not very deep and
should not create many new bugs. But then, it is my patch so I am
probably not being objective about it ;)

Oh, and what do people in general think about the new configure.in below?
Is it the way to go or just a waste of time?

The patch also contains the config.h changes since gettext without
using config.h is ... undesirable. For now only one string is marked for
translation (the one quoted below, from civclient.c).

If applying this patch, you must run the gettextize program _first_, then
afterwards run autoheader, automake and autoconf (in that order, probably)
to regenerate some files. I needed to do it this way to avoid making the
patch ~150kb, sorry.

(If you run RedHat, you may need to upgrade gettext to the 5.2 version to 
get the gettextize program.)

Ok, for those who don't know how gettext works, it is pretty simple. You
enclose strings that should be translated with, for example, _(), so that
we get
        flog(LOG_DEBUG, _("server shutdown"));
instead of just
        flog(LOG_DEBUG, "server shutdown");
That is all that needs to be changed in the C code. Afterwards, you run
xgettext on the sources, and create a master .po file ("freeciv.pot"),
which can be copied and edited to create support for new languages. These
files are used by make to pre-process the .c files during compile,
replacing the english strings with localized ones.

Comments? Flames? Cookies?

Yours,
Per

Attachment: mega-patch
Description: Text document


[Prev in Thread] Current Thread [Next in Thread]