• 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: Determining current language
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining current language


  • Subject: Re: Determining current language
  • From: Douglas Davidson <email@hidden>
  • Date: Mon, 26 Sep 2005 13:36:37 -0700


On Sep 26, 2005, at 1:18 PM, Dario Mèndez Musicò wrote:

I'm developing an application which needs to load a specific data file for each language, so I'm looking for a way to determine which language is the app actually running...


The easy way to do this is to make these data files localizable resources in your bundle. Then you just use -[NSBundle pathForResource:ofType:] to locate the right one.


If for some reason you can't put these files in your bundle, you can put them in some other bundle, and do the same thing.

If for some reason you can't put them in any bundle, then the right thing to do is to determine which localization each one corresponds to (preferably using two-letter codes, e.g. "en", "it", etc.) and use +[NSBundle preferredLocalizationsFromArray:] to pick the right localization from the list.

Douglas Davidson
  _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Determining current language (From: Dario Mèndez Musicò <email@hidden>)

  • Prev by Date: [ANN] Big Nerd Ranch Europe
  • Next by Date: Re: localization Q
  • Previous by thread: Determining current language
  • Next by thread: [ANN] Big Nerd Ranch Europe
  • Index(es):
    • Date
    • Thread