I'm using InAppSettingsKit in my iPad app, including localized Strings for English, German and Japanese. Everything works just fine, but I would like to be able to switch languages in-app, and this does not seem to be supported by InAppSettingsKit. Here's my showSettings method:

// show the inapp settings view
-(void) showSettings
{
  IASKAppSettingsViewController *settingsViewController = [[IASKAppSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
  settingsViewController.delegate = self;
  settingsViewController.showDoneButton = YES;

  UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:settingsViewController];

  [self presentModalViewController:navController animated:NO];
}

so the settings VC is recreated every time, but appears to re-use the language selection from the initial app start.

The user's language selection is written both to my private "language" setting in [NSUserDefaults standardUserDefaults] as well as the "AppleLanguages" array.

Where/how is the old language information cached?

有帮助吗?

解决方案

This is the standard behavior of iOS and usually you shouldn't aim to change it. You could probably change it using the AppleLanguages key (or some other key) in NSUserDefaults but AFAIK the current language is always static after app launch.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top