Page 1 of 1

locales - windows - OS settings

Posted: Tue Aug 16, 2005 6:41 am
by pschaich
Hi there,

my problem: I would like to use the windows operating system locale settings in order to format numbers.

The reason:

Different users may use different "customized" settings for their locales in the OS settings - e.g changed the decimal separator in my originally "german locale" from "comma" to "point".


Using the usual wxLocale is not an option, because it does not reflect the local setting.

So the question: Is it possible to access the users windows OS locale setting an use it in number formatting?

Thanks

Re: locales - windows - OS settings

Posted: Tue Aug 16, 2005 7:47 am
by Ryan Norton
pschaich wrote:So the question: Is it possible to access the users windows OS locale setting an use it in number formatting?
On windows I believe it does use the native windows locale. You could try setting it explicitly though.

Posted: Tue Aug 16, 2005 1:51 pm
by KevinHock
Have you used wxLocale::Init(wxLANGUAGE_DEFAULT); ? This will use the user's system default language and should properly format strings, numbers, etc.

Posted: Tue Aug 16, 2005 5:14 pm
by pschaich
Thanks. That worked. Sometimes things are easier than they appear.
Especially with wxwidgets...

Posted: Tue Aug 16, 2005 5:15 pm
by pschaich
Sorry for the wrong accepting...

Can someone correct this?

Peter

Posted: Tue Aug 16, 2005 9:02 pm
by Ryan Norton
unaccepted.... technically I answered the question - but Kevin told you how to solve your problem. So go ahead and choose the answer you want :).