=?koi8-r?Q?Re[2]=3A_Force_english_locale_on_Win32?=



Thank you for yours help, guys.

The solution proposed by Sylvain worked for me:

Glib::setenv("LANGUAGE", m_locale, true);
Glib::setenv("LANG", m_locale, true);
Glib::setenv("LC_ALL", m_locale, true);
Glib::setenv("LC_MESSAGES", m_locale, true);
where std::string m_locale is the locale.

Thanks again!

-----Original Message-----
From: Daniel Elstner <daniel kitta googlemail com>
To: klaus triendl <klaus triendl eu>
Date: Mon, 08 Jun 2009 05:08:29 +0200
Subject: Re: Force english locale on Win32

> Am Sonntag, den 07.06.2009, 22:41 +0200 schrieb klaus triendl:
> 
> > > putenv("LANG=en_US.UTF8");
> > > putenv("LANGUAGE=en_US"); 
> > > putenv("LC_ALL=en_US");
> > > setlocale(LC_ALL, "C");
> 
> Try calling setlocale() after initializing Gtk::Main.  Just in case the
> locale disabling argument isn't honored.
> 
> > > But gtkmm still print russian text on the standard dialog buttons etcetera.
> > > Please help to force english locale to gtkmm. 
> 
> Also, it might be that you have to use non-standard Win32 API to affect
> some locale settings.  I don't know though.
> 
> > Just an idea, not tested though: try setting the c++ locale.
> > std::locale::global(std::locale("C"));
> 
> I think this is also available directly in the API:
> 
>     std::locale::global(std::locale::classic());
> 
> > The c++ locale works independently from the c-runtime locale for 
> > iostreams, I don't know whether it affects gtkmm.
> 
> It affects ustring::format() and compose().
> 
> --Daniel
> 
> 



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