• 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: mmalc crawford <email@hidden>
  • Date: Thu, 1 Nov 2007 10:41:01 -0700


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];


mmalc

_______________________________________________

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: Stéphane Sudre <email@hidden>
References: 
 >Localized country name from iso country code (From: Ruotger Skupin <email@hidden>)
 >Re: Localized country name from iso country code (From: Stephane Sudre <email@hidden>)

  • Prev by Date: Re: When should one call unbind:? (in a GC application)
  • Next by Date: Re: Xcode 3.0 delay
  • 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