Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

geelenstef

macrumors newbie
Original poster
Dec 11, 2012
1
0
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.

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
 
The language support in Cocoa works by restarting the app. There's not a supported way to change the language dynamically while the app is running.

I think this topic has been discussed on the Apple iOS forum.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.