1

We want to have application specific locale regardless of device locale in iOS app. We want to let the user select their desired locale for the app in app login/settings screen. Once user selects any locale the app data will be updated automatically with the locale regardless of device locale.

We found by setting the AppleLanguages in NSUserDefaults can update the current locale for the app:

[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:selectedLanguage, nil] forKey:@"AppleLanguages"];
[[NSUserDefaults standardUserDefaults] synchronize];

However, This becomes effective once we kill & restart the app.

Another way I found is changing the resource folder as per the locale. I found two issues with this approach:

  1. In the whole app we have to replace the code related to NSLocalizedString with the code to fetch strings using [NSBundle localizedStringForKey]
  2. Keyboard will be shown as per the device locale.

Is there any approach by using it we can allow the app specific locale selection?

Dennis
  • 2,119
  • 20
  • 29
patel kavit
  • 484
  • 1
  • 6
  • 22
  • Please let me know how an app which provides options to select the language for the app handles localisation. – patel kavit Apr 15 '15 at 14:57
  • Have you tried the solution here: http://stackoverflow.com/questions/3235671/how-to-change-the-preferred-language-of-an-iphone-app-in-ios-4 – Michael Teper Apr 22 '15 at 17:44

0 Answers0