wesnoth-dev
[Top][All Lists]
Advanced

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

[Wesnoth-dev] Gettext and setlocale


From: Guillaume Melquiond
Subject: [Wesnoth-dev] Gettext and setlocale
Date: Thu, 21 Apr 2005 09:27:39 +0200

Hi,

These last few days, I have been looking into why it was such a pain
to have a translated Wesnoth on Debian systems. First it requires to
manually compile the locales (Debian comes with a locale-free system,
contrarily to Red Hat for example). Second it requires to compile the
*correct* locales. For example, if you want to play Wesnoth (an UTF-8
game, as you know) in russian, you should not compile ru_RU.UTF-8, but
ru_RU.ISO-8859-5.

The only situation where it works fine is when your system is
configured for your language (through LC_MESSAGES and locale
compilation) and you launch Wesnoth in "Default System Language".

Actually, these locale problems are mostly Debian fault. Wesnoth is
only guilty of using gettext. Yet it's annoying and absolutely not
user-friendly.

Here is a solution I reached. I added a locale/ directory to my
Wesnoth installation (.../share/wesnoth/locale) and I filled it with
dummy locales:
localedef --force .../share/wesnoth/locale/it_IT < /usr/share/i18n/locales/i18n

Then I added a setenv("LOCPATH", ".../share/wesnoth/locale") statement
just before the setlocale one in language.cpp. And it works just fine,
I can now play Wesnoth in any language, even though I don't have the
locales.

It's a bit overkill, but it could be the solution. So now I'm
interested in knowing on which systems gettext relies on setlocale
(according to language.cpp, I would say every system except BeOS,
MacOSX, Windows, but I may be wrong). And on these systems, is
localedef present? does it work similarly? and is LOCPATH respected?
or does it have another name?

I would then add a locale generation step during post-installation so
that Wesnoth has its very own locale set and doesn't have to rely on
the system installation anymore.

Best regards,

Guillaume




reply via email to

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