iphone – 在运行iOS时,以编程方式动态更改语言

我已经堆叠和谷歌搜索了几个小时.我现在有点绝望了.
我想在应用程序中更改应用程序的语言,而不仅仅是使用默认语言.

从我的尝试开始,我就像所有人一样重新启动.意思是,苹果强制您手动重启应用程序.这意味着您必须退出应用程序然后再次启动它.

好吧,谷歌搜索后,我试图设置一个警报,然后强迫应用程序退出

exit(0);

我的坏,苹果似乎不喜欢这样,并阻止开发人员使用它…我想我没有指向正确的方向.

最后,尽管存在所有问题,我还是可以见面,我想讨论一下.

任何提示?

编辑,APPLE的相关信息

In general, you should not change the
iOS system language (via use of the
AppleLanguages pref key) from within
your application. This goes against
the basic iOS user model for switching
languages in the Settings app, and
also uses a preference key that is not
documented, meaning that at some point
in the future, the key name could
change, which would break your
application.

If you want to switch languages in
your application, you can do so via
manually loading resource files in
your bundle. You can use
NSBundle:pathForResource:ofType:inDirectory:forLocalization:
for this purpose, but keep in mind
that your application would be
responsible for all loading of
localized data.

Regarding the exit(0) question, Apple
DTS cannot comment on the app approval
process. You should contact
appreview@apple.com to get an answer
for this question.

好吧,到目前为止我必须选择.

这是一个相当古老的问题,但我只是在努力解决同样的问题,并找到了这个解决方案:

http://aggressive-mediocrity.blogspot.com/2010/03/custom-localization-system-for-your.html

这正是你所需要的(对于有同样问题的人可能会有所帮助:)

相关文章