iOS Locale - Language Settings

Hi there,

Happy New Year :wink:

I need to display data based on the iOS language settings.
I tried Xojo.Core.Locale.Current.Identifier but it always returns “en_US” in the simulator.

I tried:

  • changing the language in the build shared settings (set it to French)
  • changing the iPhone language (Settings/General/Language & Locale/iPhone Language)
    setting language to “Franais”
    setting Region to “Belgique”

Dim loc As xojo.Core.Locale loc = xojo.core.Locale.Current
Run the app and loc is ALWAYS
identifier = en_US
DecimalSeparator = .
GroupingSeparator = ,
CurrencySymbol = $

Can you tell me how to test the app in different languages ?

Remark: I have the same problem with the dynamic constants which are always in English whatever build shared settings or iOS Language.

Thanks for helping !

The simulator language setting is buggy. Try in a real device. Chances are it will work.

Thanks Michel.

It’s strange anyway that when setting the iPhone language to French in the simulator all settings labels, button/label captions (in Calendar, Pictures, Maps, …) are correctly translated which means, I guess, that the language and locale settings are changed to French.

I’ll try on my real iPhone and let you know.

[quote=158555:@Olivier Colard]Thanks Michel.

It’s strange anyway that when setting the iPhone language to French in the simulator all settings labels, button/label captions (in Calendar, Pictures, Maps, …) are correctly translated which means, I guess, that the language and locale settings are changed to French.

I’ll try on my real iPhone and let you know.[/quote]

When setting the language to Français in the simulator, the keyboard remains US. That tells me the language implementation is kind of sloppy. There are many other differences between the simulator and the built app, one of them being that the simulator uses x86 code, while the built app is for an ARM processor. There are already several examples of declares and native classes that work fine in the simulator, but not in the built app.

It’s a known bug with the iOS Simulator: http://stackoverflow.com/questions/24588105/changing-language-on-ios-8-1-simulator-does-not-work

Thanks Jason.
It seems to be there since version 6, I’m using 8.1.

I didn’t upgrade my Xojo license yet, will do it next week, and will test on a real device.

Just to confirm what Michel and Jason said, it an iOS simulator bug.
Xojo.Core.Locale.Current.Identifier returns the correct info when running on real device.

Thanks !