Re: Localized country name from iso country code
Re: Localized country name from iso country code
- Subject: Re: Localized country name from iso country code
- From: Stéphane Sudre <email@hidden>
- Date: Thu, 1 Nov 2007 20:11:39 +0100
On jeudi, novembre 1, 2007, at 06:41 PM, mmalc crawford wrote:
On Nov 1, 2007, at 5:59 AM, Stephane Sudre wrote:
is there an easy way to get a localized country name from an ISO
country code (with or without NSLocale)?
Yes, there is.
Look in
/System/Library/PrivateFrameworks/IntlPreferences.framework/Resources
In each .lproj language folder, you should find the
LocalizedLanguage.strings file.
The format may look strange but you can open the file as a
NSDictionary.
The
/System/Library/PrivateFrameworks/IntlPreferences.framework/
ResourcesLanguage.strings file could also be of some interest.
Don't do this.
Use NSLocale -- displayNameForKey:value:
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
Classes/NSLocale_Class/Reference/Reference.html#//apple_ref/occ/instm/
NSLocale/displayNameForKey:value:>
myLocale = [NSLocale currentLocale];
NSString *countryCode = @"GB";
NSString *loalisedCountryName = [myLocale
displayNameForKey:NSLocaleCountryCode value:countryCode];
Well, if you're running on 10.4, sure. But if you're not?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden