adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-devel] I18n stuff committed


From: Kai Sterker
Subject: [Adonthell-devel] I18n stuff committed
Date: Sat, 16 Mar 2002 17:49:51 +0100

Okay, the first attempt at i18n is in the road_to_0-4 branch. Here's the
list of additions and changes:

There are two new directories at the toplevel: po/ and intl/. 

The first one is meant to contain the catalog files. Of course, the
engine won't need this, but the gettext configure macros are not happy
without it. And who knows, maybe we want to translate the engine's error
messages one day ;).

The second contains libintl. This is everything we need to use gettext,
so on systems without GNU gettext, libintl will be build and linked to
Adonthell. I haven't tested if that really works, maybe some changes to
configure.in or some Makefiles has to be made.

Apropos configure.in: as the AM_GNU_GETTEXT macro checks for a lot of
header files and adds a large amount of defines to the gcc command line,
I've enable support for the config.h file. Now all the defines go into
config.h, so if you'll need to include this in files where you want to
check for a certain flag.


So much for the basic changes. Here is the really interesting stuff:

The basic preview mode of dlgedit is working. There are still two flaws
at the moment, though: If you discover problems in the translation,
correct them in the catalog and want to reload it, you're out of luck.
Guess the problem is that gettext thinks that the catalog is already
loaded and refuses to load it again.

I also found that some characters don't display properly, like the
German 'ä', 'ö' or 'ü'. Maybe the problem is that I'm using a fantasy
locale at the moment. I'll correct that of course.

To give you the opportunity to try it out, I have attached 3 files.
'witch.adlg' is the beginning of a dialogue meant for v0.4. 'witch.pot'
is the catalog template that can be created by running 'pygettext.py
witch.py'. (witch.py is of course the compiled dialogue). The
pygettext.py can be found in the Tools/i18n/ directory of the source
Python distribution, or downloaded from the Python CVS. Finally,
witch_de.mo is the German translation of the dialogue.

You can create your own translation by filling in the 'msgstr' of the
template with the translated text, then saving it as <filename>.po and
finally running msgfmt (or msgfmt.py) with the .po file as argument.
That results in a binary catalog you can preview in dlgedit again.

Sounds complicated? Maybe I just didn't explain it very well ;). I will
write some documentation on this whole topic one of these days, as I
read plenty about the whole translation process during the last few
days.


One last thing: I really hope I haven't forgotten to add something to
the CVS. Please tell me if something appears to be missing. (And be sure
to update with the -d option to get the new directories.)

Any further thoughts, comments and flames welcome!

Kai

Attachment: witch.adlg
Description: Binary data

Attachment: witch.pot
Description: Binary data

Attachment: witch_de.mo
Description: Binary data


reply via email to

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