G H
2006-07-12 11:51:46 UTC
Hello,
I'm using wxWidgets 2.6.3 under Windows 2000. I'm coding a program
that contains localised strings (I'm using wxLocale), but that also
writes configuration files on the disk. I would like to have dots
instead of commas, as decimal separators in these con, whatever locale
is currently set.
The 1st solution would be to create another wxLocale object before
writing the file on the disk, and then, after writing, to create
another wxLocale object with the previous locale. I find it a little
clumsy, as I have to add again the .po catalog. Also, it would make
the wxLocale object more "global", instead of being just in one place
of my program.
The 2nd solution would be to directly use setlocale to save the
currently used locale and to set the C (=standard) locale before
writing, and re-putting the previous locale (returned by the call to
setlocale) after writing the file. I've tried this, but the locale
returned by the first call to setlocale is always the locale of my
system, and is not dependent of the locale I used to create the
wxLocale object (which depends on a config file). Why is it that ?
Using wxSetlocale doesn't change anything.
If I can't find a way to make the 2nd solution work, I'll go for the
first but I'd like to know if someone knows how to solve that.
thanks!
guillaume
I'm using wxWidgets 2.6.3 under Windows 2000. I'm coding a program
that contains localised strings (I'm using wxLocale), but that also
writes configuration files on the disk. I would like to have dots
instead of commas, as decimal separators in these con, whatever locale
is currently set.
The 1st solution would be to create another wxLocale object before
writing the file on the disk, and then, after writing, to create
another wxLocale object with the previous locale. I find it a little
clumsy, as I have to add again the .po catalog. Also, it would make
the wxLocale object more "global", instead of being just in one place
of my program.
The 2nd solution would be to directly use setlocale to save the
currently used locale and to set the C (=standard) locale before
writing, and re-putting the previous locale (returned by the call to
setlocale) after writing the file. I've tried this, but the locale
returned by the first call to setlocale is always the locale of my
system, and is not dependent of the locale I used to create the
wxLocale object (which depends on a config file). Why is it that ?
Using wxSetlocale doesn't change anything.
If I can't find a way to make the 2nd solution work, I'll go for the
first but I'd like to know if someone knows how to solve that.
thanks!
guillaume