bug-gnubg
[Top][All Lists]
Advanced

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

[Bug-gnubg] Changing language for GUI


From: Holger
Subject: [Bug-gnubg] Changing language for GUI
Date: Mon, 25 Aug 2003 00:28:58 +0200

Hi all,

I've made quite some attempts to change the used language for the GTK+
version on Windows programmatically. Nothing seemed to help.

First the situation: If the locale folder hierarchy is set up properly
gnubg starts up on Windows with the language set in Windows preferences |
Country preferences (in German Systemsteuerung | Ländereinstellungen). If
the environment variable LANG is set, this overrides the Windows setting
and gnubg uses this language.

I haven't tried it with the CLI version, for this setlocale( LC_ALL,
"it_IT" ) might be enough. But for GTK+ it isn't.
Finally, in order to try whether it would work at all I've put the
following hack instead of
    setlocale (LC_ALL, "");
at the beginning of real_main:

    SetEnvironmentVariable( "LANG", "it_IT" );
#if HAVE_SETLOCALE
    setlocale( LC_ALL, "it_IT" );
#endif

As an aside, note that on Windows setenv is not available.

But even with this gnubg was still using German, which is my Windows setting.

On my way through the documentation I've found only one function for GTK+
related to locales.

  gtk_set_locale ()
  gchar*      gtk_set_locale                  (void);
  Sets the current locale according to the program environment. This is the
  same as calling the libc function setlocale(LC_ALL, "") but also takes care
  of the locale specific setup of the windowing system used by GDK.
  You should call this function before gtk_init to support
internationalization
  of your GTK+ applications.

Unfortunately, there is no gtk_set_locale that takes an argument and also
the hack above doesn't influence what it thinks is the current locale
setting. InitGTK and thus gtk_set_locale is called much later and should
have used Italian in the above example.

Does anybody have some ideas?

Regards,

        Holger




reply via email to

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