Change ios app language

I set the parameters of my application in the iPhone settings panel. I want to switch between languages ​​regardless of the language of the iPhone system. Is it possible? I use this tip: How to get NSLocalizedString to use a specific language

But it only translates the string inside the application, but my nib files are the same. How to reload my feathers?

+4
source share
1 answer

The key must override the NSUserDefaults language key before UIApplicationMain() is called in your main() function in main.m. Try something like this in your main() function:

 // use whatever language/locale id you want to override [[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"de_DE", nil] forKey:@"AppleLanguages"]; [[NSUserDefaults standardUserDefaults] synchronize]; int retVal = UIApplicationMain(argc, argv, nil, nil); 
+20
source

All Articles