Created
June 23, 2011 15:37
-
-
Save ddb/1042781 to your computer and use it in GitHub Desktop.
If you need regional language localization, this change to main.m will enable iOS to pick the correct regionally localized resources.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(int argc, char *argv[]) { | |
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | |
NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0]; | |
NSString *locale = [[NSLocale currentLocale] objectForKey: NSLocaleCountryCode]; | |
NSString *dashed = [NSString stringWithFormat:@"%@-%@", language, locale]; | |
NSString *underlined = [NSString stringWithFormat:@"%@_%@", language, locale]; | |
[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:dashed, underlined, language, nil] | |
forKey:@"AppleLanguages"]; | |
int retVal = UIApplicationMain(argc, argv, nil, nil); | |
[pool release]; | |
return retVal; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment