11 Mar 2010, 1:39am

leave a comment

iPhone dev – forcing the user language

From 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.

*name

*e-mail

web site

leave a comment


 

free winrar download

free winrar download

winrar download free

winrar download free

windows 7 key generator

windows 7 key generator

windows 7 activation crack

windows7 activation crack

free winzip

free winzip

free winrar

free winrar

winzip free download

winzip free download

winrar free download

winrar free download

windows 7 crack

windows 7 crack

winzip free download full version

winzip free download full version

winzip activation code

winzip activation code

windows 7 product key

windows 7 product key
\n