Locale.getDefault().getLanguage();
for spanish it returns "es"
When I did language testing I had to not only change language in settings but also change region or it would show up as en_US
--
You received this message because you are subscribed to the Google Groups "RoboVM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robovm+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
This line of code
new NSLocale();
throws an Exception
Exception in thread "main" java.lang.RuntimeException: Objective-C initialization method returned nil
at org.robovm.objc.ObjCObject.initObject(ObjCObject.java)
at org.robovm.apple.foundation.NSObject.<init>(NSObject.java)
at org.robovm.apple.foundation.NSLocale.<init>(NSLocale.java)
at com.forilab.voodoo.VoodooIOS.getSystemLanguage(VoodooIOS.java)
at com.forilab.voodoo.utils.LanguagesManager.<init>(LanguagesManager.java)
at com.forilab.voodoo.utils.LanguagesManager.getInstance(LanguagesManager.java)
at com.forilab.voodoo.screens.SettingsScreen.<init>(SettingsScreen.java)
at com.forilab.voodoo.VoodooGame.init(VoodooGame.java)
at com.forilab.voodoo.screens.SplashScreen.render(SplashScreen.java)
at com.badlogic.gdx.Game.render(Game.java)
at com.badlogic.gdx.backends.iosrobovm.IOSGraphics.draw(IOSGraphics.java)
at com.badlogic.gdx.backends.iosrobovm.IOSGraphics$1.draw(IOSGraphics.java)
at org.robovm.apple.uikit.UIView.$cb$drawRect$(UIView.java)
at org.robovm.apple.glkit.GLKView.$m$super$display(Native Method)
at org.robovm.apple.glkit.GLKView.display(GLKView.java)
at org.robovm.apple.glkit.GLKView.$cb$display(GLKView.java)
at org.robovm.apple.uikit.UIApplication.main(Native Method)
at org.robovm.apple.uikit.UIApplication.main(UIApplication.java)
at com.forilab.voodoo.VoodooIOS.main(VoodooIOS.java)
--
Unfortunately, I still have the problems
NSLocale.getSystemLocale().toLocale() constantly throws an Exception
java.lang.IllegalArgumentException: Failed to convert NSLocale <__NSCFLocale: 0x10649eb0> to Java Locale
NSLocale.getCurrentLocale().toLocale().toString() returns "en_GB" even if I set device language to Russian like this
--
NSLocale.getSystemLocale().getLocaleIdentifier() = ""
NSUserDefaults.standardUserDefaults().arrayForKey$("AppleLanguages").getFirst().toString();
returns"ru" for Russian, "en" for English, "fr" for French, etc