is there any build-in possibility to get the current selected system langauage at runtime?
I want to pre-select the language of my app at first start to the system language (English, German, …).
There is no.
Mark recently closed the issue https://github.com/blitz-research/monkey2/issues/136
don’t know why.
Perhaps there would be a new need for a module be created called “Localization”.
I have spent a few minutes creating a module to let you get the raw system locale (you will have to interpret it with custom rules in your program).
Basically it depends on this: http://www.cplusplus.com/reference/clocale/setlocale/
But of course the module will have to properly designed and planned so it contains various useful features and a reasonable API. We can throw a bunch of high level ideas and then use them as a placeholder for implementation.
Local language := GetLanguage()
thanks for sharing.
I have to change the module.json this way to get the module availabe in Ted module manager:
"about":"Localization module for Language / Currency / Formatting / Alignment / ETC/Calendar",
"support":"WIP - NOT READY YET",
The return value are fine on my Windows machine but my tests on an Android 7 device failed. Android returns unfortunately ‘C.UTF-8’.
Anyway thanks a lot for your effort!
Hmm, it’s bad that it does not work.
It seems that for android we would have to interface with Java SDK.
You must be logged in to reply to this topic.
Monkey2 is an easy to use, cross platform, games oriented programming language from Blitz Research.