Luke
Luke

Reputation: 2572

User-controlled NSLocalizedString interface changes

I am working on an app that has strings files for all the UI text. Depending 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?

Upvotes: 0

Views: 1037

Answers (1)

Luke
Luke

Reputation: 2572

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!

Upvotes: 1

Related Questions