I have an app that requires 2 languages, English and French.
I have already set up the Localizable.strings files in their respective "en.lproj" and "fr.lproj" folders ... and when I change the iPad's language (in the native settings app), then launch my app, it does in fact load the correct text (i.e. either English copy or French copy).
I need to have a UISegmentedControl toggle between the 2 languages without having to restart the app.
How do I get the app to change the (current) language so that when I call a method that (re)sets all the UILabels' text and UIImageViews' images they read from the opposite .lproj folder's Localizable.strings file?!?
I know how to use UISegmentedControl, and that is not my question. I'm looking more for a line of code that sets the application's bundle language or locale or something (as I'm quite new to internationalization.localization).
-
Example of how I set the image for a UIImageView:
myUIImageView1.image = [UIImage imageNamed:NSLocalizedString(@"myUIImageView1", @"comment for the translator")];
Example of how I set the text of a UILabel:
myLabel1.text = NSLocalizedString(@"myLabel1", @"comment for the translator");