0

How can I make the localization independent on the OS settings? For example, if the device language is en-US, But I want the user to be able to set the app to work using Hebrew localization.
In my case – I have an app that in emergency cases the user (in Israel) need to call a number (101).
I made localization to hebrew & english for that app, & when the user is switching to english lang' the dial number & pic' is changing to 911, But what if a user in Israel wants to use english lang' on his iphone? he doesn't need 911, he needs 101.
I thought maybe to create tableview with all the numbers rather than a specific number but the access to the numbers list will not be quick and easy for dialing because of the multiple numbers.
Is it possible to make localization by location or any other way for doing that?

I appreciate the help.

Matthias Bauch
  • 89,811
  • 20
  • 225
  • 247
Maor Zohar
  • 592
  • 5
  • 17

1 Answers1

0

query NSLocale for the NSLocaleCountryCode. The values from [NSLocale currentLocale] do not depend on the language setting, they depend on the region settings.

These are the values for my currentLocale. Language is set to english and region is set to germany.

NSLocaleIdentifier   : de_DE
NSLocaleLanguageCode : de
NSLocaleCountryCode  : DE

preferredLanguages are: 

en,
fr,
de,
ja,
[...]

more fanciness: use geolocation to figure out the actual location of the device. It's possible that your users travel outside of their country ;-)

Matthias Bauch
  • 89,811
  • 20
  • 225
  • 247