开发者

User-controlled NSLocalizedString interface changes

I am working on an app that has strings files for all the UI text. 开发者_如何学CDepending on their language in the iPad international settings, they will start up with their chosen language on all the UI elements.

I want to add the ability for the user to change this within the app, so they could choose from the supported languages and the app would update the UI to the new choice. This way we could set up a kiosk where tourists can select their own language without assistance.

I'm not sure whether I should use NSLocalizedString:withTable: and pull the strings files into en.strings, zh.strings (instead of en.lproj/Localizable.strings) but that seems like a lot of unnecessary work.

Is there a way to use NSLocale to set the user language for the app and still use the NSLocalizedString() call?


There was an excellent answer to exactly this question in another thread:

Tutorial and example code for changing localization strings during app use

Seriously, go and upvote this guy. It is a shining example of the best SO has to offer!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜