• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Localized country name from iso country code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Localized country name from iso country code
      • From: mmalc crawford <email@hidden>
References: 
 >Re: Localized country name from iso country code (From: mmalc crawford <email@hidden>)

  • Prev by Date: Re: Leopard: Multiple Sheets Per Window Bug
  • Next by Date: Re: NSBitmapImageRep byte/color component ordering
  • Previous by thread: Re: Localized country name from iso country code
  • Next by thread: Re: Localized country name from iso country code
  • Index(es):
    • Date
    • Thread