QLocale and std::setlocale()
-
In my application startup I trace the current setting of setlocale() and on my system this typically reports "System locale is: English_United Kingdom.utf8".
However if I run the application using the Windows Japanese locale (using Locale Remulator x64), then QLocale correctly reports ja_JP as the value of QLocale::system().name() though setlocale() still thinks it is "English_United Kingdom.utf8"
So what does QLocale use to determine the real language?
Why am i bothered. If I manually set the language to Japanese (by loading a japanese language file rather than setting the system locale first using Locale Remulator), then when I invoke the help viewer for .chm files, they display incorrectly because the locale needs to be set to ja_JP.Shift-JIS for that to work right.
If my technique for setting the language is wrong and I should instead be using QLocale, please advise how I can use to change the language on the fly.
I hope this makes sense.
-
Hi,
I think this article about translation in Qt can help you understand the voodoo behind language selection.