Ios: How to Change App Language Programmatically Without Restarting the App

Change iOS app language without rebooting the device

You can't change the language of the device in your application but you can change it just for your application by changing the AppleLanguages property in NSUserDefaults. Please note however I believe this still requires restarting the app itself but doesn't require a device restart.

[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"nl", @"en", nil] forKey:@"AppleLanguages"];

Here's another similar question that also maybe able to help you

How to change app language programmatically WITHOUT restarting my app?

You can't do that (without jailbreaking). You should code your app in a way, that you can start over when some significant information changes, without restarting the app. For instance you could pop all the view controllers and deallocate them and then let the user reload them using the correct language.

Note however, that normally you shouldn't do anything like that. Localization is solved in a quite elegant way on iOS. You just localize the .strings (and optionally .nib and image files) and the system takes care for the rest for you. When the user changes the language in the Settings app, you app will be terminated by the system. The next time the user starts the app, it will load the correct language.



Related Topics



Leave a reply



Submit