0

我在我的 iPad 应用程序中使用 InAppSettingsKit,包括英语、德语和日语的本地化字符串。一切正常,但我希望能够在应用程序内切换语言,这似乎不受 InAppSettingsKit 的支持。这是我的 showSettings 方法:

// 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];
}

因此每次都会重新创建设置 VC,但似乎会重新使用初始应用程序启动时的语言选择。

用户的语言选择同时写入我的私人“语言”设置[NSUserDefaults standardUserDefaults]以及“AppleLanguages”数组中。

旧语言信息在哪里/如何缓存?

4

1 回答 1

1

这是 iOS 的标准行为,通常你不应该改变它。您可能可以使用 NSUserDefaults 中的 AppleLanguages 键(或其他键)更改它,但 AFAIK 当前语言在应用程序启动后始终是静态的。

于 2012-12-31T13:35:21.100 回答