iPhone dev – forcing the user language
2010-03-11 01:39From my post on StackOverflow
You can force the language like so:
[[NSUserDefaults standardUserDefaults] setObject: [NSArray arrayWithObjects:@"en", nil] forKey:@"AppleLanguages"];
And undo this setting by:
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"AppleLanguages"];
Consider if you need to call [[NSUserDefaults standardUserDefaults] synchronize];
This change is persistant and only needs to be set once.
NB. you will normally have to restart the app for this to take affect.
I agree there is little need to allow the user to specify a language. However the one exception is being able to override the language and set it to the developer’s native language. If the user can speak the developer’s language (e.g. English for me) then they may wish to use the App in that language, if the translations are incorrect.
I reference this answer: http://stackoverflow.com/questions/1669645/how-to-force-nslocalizedstring-to-use-a-specific-language/1670524#1670524 (the answer doesn’t actually work for me, but following the ideas in the comments did. The undo stuff I worked out.

