Hello,
I want to be able that users can change the language inside the app. I set up my language files correctly. Now In my view I have 2 buttons. One for dutch and one for English. Here is the code behind those buttons.
This works fine when I restart the app. But I don't want that the user first should restart it.
Can anybody help me?
Kind regards
I want to be able that users can change the language inside the app. I set up my language files correctly. Now In my view I have 2 buttons. One for dutch and one for English. Here is the code behind those buttons.
Code:
- (IBAction)changeDutch:(id)sender {
[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"nl", nil] forKey:@"AppleLanguages"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
- (IBAction)changeEnglish:(id)sender {
[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"en", nil] forKey:@"AppleLanguages"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
This works fine when I restart the app. But I don't want that the user first should restart it.
Can anybody help me?
Kind regards