Re: gtk_set_locale

On Tue, 26 Nov 2002 11:16:47 +0900
ymnk@jcraft.com (Atsuhiko Yamanaka) wrote:


AY> Hi,

AY> To enable XIM for GTK-Amaya, 'ENABLE_MUTKIKEY' must be setted
AY> to 'yes'.  This problem has come from the fact that 
AY> 'gtk_set_locale' is not called by the default.
AY> I think almost all gtk-based programs, which care for I18N,
AY> have called 'gtk_set_locale' by the default.
AY> Is it a bad idea to call 'gtk_set_locale' by the default?

AY> FYI, the current GTK-Amaya calls 'gtk_set_locale' in 
AY> 'thotlib/dialogue/dialogapi.c' by checking the variable
AY> 'ENABLE_MUTKIKEY'.

AY> I mean that how about commenting out following two lines?
AY> /*
AY> ptr = TtaGetEnvString("ENABLE_MUKTIKEY");
AY> if (ptr && !strcasecmp (ptr, "yes"))
AY> */
AY> gtk_set_locale ();

I think it's much better to rewrite this piece of code like so:

ptr = TtaGetEnvString("DISABLE_MUKTIKEY");
if (ptr && !strcasecmp (ptr, "yes"))
	setlocale(LC_ALL,"POSIX")
else
	gtk_set_locale ();


where setlocale() it's a function from <locale.h>.
This call conforming to POSIX.1
........................................................................
IRC: irc.openprojects.net #asplinux                      Grigory Bakunov
EMAIL: black@asplinux.ru                           ASPLinux Support Team
ICQ: 51369901                                     http://www.asplinux.ru
-----BEGIN GEEK CODE BLOCK-----
GCS/MU d-(--) s:- a- C+++>++$ UBLAVSX+++$ P+ L++++$ E++$ W++ N+>- o? K?
w-- O- M V-(--) PS+ PE+ !Y PGP+>++++ t+ 5++ X+++ R+++ tv+>-- b+++ ?DI D+
G++ e>++$ h- r++ y+ z++(+++)
------END GEEK CODE BLOCK------

Received on Tuesday, 26 November 2002 02:37:40 UTC