locales - windows - OS settings Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
pschaich
Experienced Solver
Experienced Solver
Posts: 68
Joined: Wed Mar 09, 2005 4:19 pm
Location: Germany

locales - windows - OS settings

Post 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
User avatar
Ryan Norton
wxWorld Domination!
wxWorld Domination!
Posts: 1319
Joined: Mon Aug 30, 2004 6:01 pm

Re: locales - windows - OS settings

Post 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.
[Mostly retired moderator, still check in to clean up some stuff]
KevinHock
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 236
Joined: Sat Sep 04, 2004 1:49 pm
Location: Ohio, USA
Contact:

Post 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.
pschaich
Experienced Solver
Experienced Solver
Posts: 68
Joined: Wed Mar 09, 2005 4:19 pm
Location: Germany

Post by pschaich »

Thanks. That worked. Sometimes things are easier than they appear.
Especially with wxwidgets...
pschaich
Experienced Solver
Experienced Solver
Posts: 68
Joined: Wed Mar 09, 2005 4:19 pm
Location: Germany

Post by pschaich »

Sorry for the wrong accepting...

Can someone correct this?

Peter
User avatar
Ryan Norton
wxWorld Domination!
wxWorld Domination!
Posts: 1319
Joined: Mon Aug 30, 2004 6:01 pm

Post 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 :).
[Mostly retired moderator, still check in to clean up some stuff]
Post Reply