Hi!
Let's suppose I would like to know the current preferred language. I'm using
the following code:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSArray *languages = [defaults objectForKey:@"AppleLanguages"];
NSLog(@"Languages: %@", languages);
NSLog(@"Preferred Loc: %@", [NSBundle
preferredLocalizationsFromArray:languages]);
or
NSLog(@"Pref. Lang.: %@", [NSLocale preferredLanguages]);
NSLog(@"Preferred Loc: %@", [NSBundle
preferredLocalizationsFromArray:[NSLocale preferredLanguages]]);
or
NSLog(@"myBundle Loc: %@", [myBundle localizations]);
NSLog(@"Preferred Loc (myBundle): %@", [NSBundle
preferredLocalizationsFromArray:[myBundle localizations]]);
Output:
Languages: (
de,
en,
fr,
nl,
da,
ru
)
Preferred Loc: (
en
)
Pref. Lang.: (
de,
en,
fr,
nl,
da,
ru
)
Preferred Loc: (
en
)
myBundle Loc: (
de,
English,
German
)
Preferred Loc (myBundle): (
English
)
IMHO that's wrong. The preferred localization/language should be "de" in any
case.
Any ideas?
Thanks!
--
ANE
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]