In a case when you want a App in a language/region/format other than selected iPhone settings value. Example a App with it's own internal language settings.
I know how to change the language, but what about the region/format?
To easily override the selected language in settings you can run this code in main
[[NSUserDefaults standardUserDefaults]
setObject:[NSArray arrayWithObject:@"sv"]
forKey:@"AppleLanguages"];
To view the change in effect, let us output current settings with below code
NSString *locale = [[NSLocale currentLocale] localeIdentifier];
NSLog(@"current locale: %@", locale);
NSArray* preferredLangs = [NSLocale preferredLanguages];
NSLog(@"preferredLangs: %@", preferredLangs);
With the output coming as
current locale: en_US
preferredLangs: ( sv )
But I want to change this locale to sv_SE
How can i in the same way override the locale(Region/Format) in the iPhone Settings?