• 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: Are the Mac international resources available publicly?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Are the Mac international resources available publicly?


  • Subject: Re: Are the Mac international resources available publicly?
  • From: Michael Dautermann <email@hidden>
  • Date: Wed, 13 Apr 2011 21:36:20 -0400

On Apr 13, 2011, at 4:30 PM, Motti Shneor wrote:

> Hi.
>
> In our program, we need to let the user choose a country code from a list, just like you choose input source from the language menu.
>
> I was wondering whether these well designed and pretty-complete lists of countries regions and their flags and country-codes (phone) are available to the developer via some API, or well-defined image names?
>
> I tried to play with NSLocale, but could not get any further than a list of countries.
>
> Any hint will make me very happy!


Hello Motti,

I've written code that enumerates through Text Input Source properties (e.g. the CFArray returned by the TISCreateInputSourceList function) and for each TISInputSourceRef, comes up with the localized name (kTISPropertyLocalizedName) and those pretty flag icons (kTISPropertyIconImageURL).

That said, I really recommend against doing this.  It sounds like what you're doing has nothing to do with input source stuff.  Better to write your own custom data structure (e.g. an array of NSDictionary objects) where you have in each entry a localized name, country codes and flag icons that you either copy / borrow from the raw TIS files or, even better, use your own flag icons in a proper OS X friendly format (Text Input Source icons are "classic" Mac OS 9 format, IIRC -- I'm using them in my code as an IconRef).

I hope my opinion helps you out!

michael


_______________________________________________

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

References: 
 >Are the Mac international resources available publicly? (From: Motti Shneor <email@hidden>)

  • Prev by Date: [MEET] CocoaHeads-NYC tomorrow (Thursday) night
  • Next by Date: Re: Preventing View Update in NSTableView
  • Previous by thread: Are the Mac international resources available publicly?
  • Next by thread: Cocoaheads Lake Forest meeting TONIGHT, 7pm, El Toro library
  • Index(es):
    • Date
    • Thread