Detect Os language?

BlitzMax Forums/BlitzMax Programming/Detect Os language?

orgos(Posted 2009) [#1]
Hello again.

Exist some function to detect OS language (english, spanish etc..) in multiplatform way?


Winni(Posted 2009) [#2]
Probably not, and I also don't know how to do it, except for that something tells me that you have to use some OS-specific APIs for that.

But here's a thought you should keep in mind when you're implementing it: It's not the operating system language that matters for the user. It's the "display language" that's important.

For example, I run a German version Vista Ultimate, BUT my "display language" is set to English, meaning that I expect all applications to use English language interfaces. Most of them behave accordingly. But then comes SUN's Control Panel for Java 6 - and it speaks German, although the installer itself spoke English.

Now on a Mac everything is a bit different. The OS and its applications are multi-lingual by design, and the actual display language is a per-user setting (as it is supposed to be in Vista, only that most programmers don't know it yet).

But, well, if it turns out to be difficult to request the OS language, just add a "switch language" feature to your app and let the user decide in what language he wants to use the program?


Brucey(Posted 2009) [#3]
Seems it's possible, since this function believes it can retrieve the language :
wxLocale.GetSystemLanguage:Int()

But I've never tried it, so... :-)


orgos(Posted 2009) [#4]
Thanks Winni, so the best solution is to show to user the select language menu.

Brucey, I supose that function you say is using some module?


Retimer(Posted 2009) [#5]
wxmax module wrapper. Check his wxMax link, and maybe google 'wxwidgets'.

It's a pretty amazing framework.