In my iPhone app, I can successfully change language inside the app's Settings (just the user have to restart the app). I use the trick mentioned in this post: link. I made some modification. I store the selected language in NSUserDefaults, and in main.m:
int main(int argc, char *argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if ( [[NSUserDefaults standardUserDefaults] objectForKey:@"language"] == nil ) {
[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObject:@"hu"] forKey:@"AppleLanguages"];
} else {
[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObject:[[NSUserDefaults standardUserDefaults] objectForKey:@"language"]] forKey:@"AppleLanguages"];
}
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
The "default" Info.plist file is in english, I placed it in the root of the project. I made a hungarian translation of this, because of app name. This file is InfoPlist.strings, and I placed it in hu.lproj folder. In this file:
CFBundleDisplayName = "Sör";
If I change the language, after restart the app, everything is work fine (nib files, strings), except of app name. It doesn't change...
Can someone tell me what is the problem?