bug-gnubg
[Top][All Lists]
Advanced

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

Re: [Bug-gnubg] Changing language for GUI


From: Joern Thyssen
Subject: Re: [Bug-gnubg] Changing language for GUI
Date: Mon, 25 Aug 2003 20:06:03 +0000
User-agent: Mutt/1.4.1i

On Mon, Aug 25, 2003 at 12:28:58AM +0200, Holger wrote
> 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.

The comments in GTK+ 2 manual may sched some light on this:

        Initializes internationalization support for GTK+. gtk_init()
        automatically does this, so there is typically no point in
        calling this function.

        If you are calling this function because you changed the locale
        after GTK+ is was initialized, then calling this function may
        help a bit.  (Note, however, that changing the locale after GTK+
        is initialized may produce inconsistent results and is not
        really supported.)

        In detail - sets the current locale according to the program
        environment. This is the same as calling the C library function
        setlocale (LC_ALL, "") but also takes care of the locale
        specific setup of the windowing system used by GDK.

Paragraph number two is especially interesting. It looks like we can
forget about runtime changes of the locale.

Jørn

Attachment: pgpntABGqIXnM.pgp
Description: PGP signature


reply via email to

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