• 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: Currently used locale
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Currently used locale


  • Subject: Re: Currently used locale
  • From: Douglas Davidson <email@hidden>
  • Date: Mon, 31 Oct 2005 10:48:26 -0800


On Oct 29, 2005, at 1:51 AM, Stefan Fisk wrote:

I'm writing an external script with locale support that needs to use the same locale as the application that is calling it, because the output of the script will be used in the interface. My only problem is that I can't find any good way to get the applications currently used locale. The closest I get is [[NSBundle mainBundle] preferredLocalizations], but since that returns an array i don't know which one to choose.


The reason why this returns an array is that in some cases NSBundle will take localized resources from more than one localization. For example, if the user prefers en_US and the bundle contains both en_US and en, then NSBundle will take localized resources preferentially from en_US but will fall back to en if necessary. In that case the returned array would be (en_US, en). If you want the single most preferred localization, use the first element of this array.


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: 
 >Currently used locale (From: Stefan Fisk <email@hidden>)

  • Prev by Date: Re: Binding a dictionary to a table view
  • Next by Date: Re: Beyond NSSpellChecker?
  • Previous by thread: Currently used locale
  • Next by thread: Custom tooltips
  • Index(es):
    • Date
    • Thread