Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change app language programmatically [duplicate]

I'm developing an iOs application with latest SDK and XCode 4.2.

I need to add a menu where user can changes only app language (I don't want to change device language).

I also want to use NSLocalizedString.

How can I do this?

like image 974
VansFannel Avatar asked Feb 09 '12 09:02

VansFannel


1 Answers

Try this:

// switching to polish locale
[[NSUserDefaults standardUserDefaults] setObject:@[@"pl"] forKey:@"AppleLanguages"];
[[NSUserDefaults standardUserDefaults] synchronize];
like image 164
Tomasz Wojtkowiak Avatar answered Sep 20 '22 00:09

Tomasz Wojtkowiak