Localize iphone without changing iphone settings

I did localization by changing the language of the iPhone through localisableString and to another xib, which works only with the NSLocale method, but the requirement of the application is to localize it by changing the language in the application settings view, regardless of the language of the iPhone ..

+5
source share
1 answer

It sounds like a silly requirement, but in any case: you can change the language of your application by setting an array with the order of the preferred languages ​​for the user key @ "AppleLanguages" by default, for example:

//Set language to German:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:[NSArray arrayWithObject:@"de"]
                                      forKey:@"AppleLanguages"];

, , , .

+2

All Articles