• 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: Accessing international month name other than the default locale
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing international month name other than the default locale


  • Subject: Re: Accessing international month name other than the default locale
  • From: Michael <email@hidden>
  • Date: Tue, 20 Sep 2005 21:32:27 +0200

Von: email@hidden
Betreff: Re: Accessing international month name other than the default locale
Datum: 20. September 2005 19:32:34 MESZ
An: email@hidden


Hi Frederick,

Am 20.09.2005 um 15:03 schrieb Frederick Cheung:


On 9/20/05, Frederick Cheung <email@hidden> wrote:


On 9/20/05, Michael <email@hidden> wrote:


Hello,

how do I access the localized full month names for locales other than
the users default locale? Examine


defaults read NSGlobalDomain

reveals only one set of month names. Where are the other names, for
example: French, German and Hindu?




I believe NSLocale gives you the information you require.



Oops, mail got sent before i finished it. That should have read "Once
you stick it in a NSDateFormatter and use something like
-monthSymbols"


You are right, the solution seams to be like this:

NSString* localeIdentifier = @"en"; // for example
NSLocale* locale = [[[NSLocale alloc] initWithLocaleIdentifier:localeIdentifier] autorelease];
NSDateFormatter* dateFormater = [[[NSDateFormatter alloc] init] autorelease];
[dateFormater setFormatterBehavior:NSDateFormatterBehavior10_4];
[dateFormater setLocale:locale];
NSArray* months = [dateFormater monthSymbols];
...


Thank you very much,
Michael

_______________________________________________
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


  • Prev by Date: Display RTF & RTFD file in NSTextView
  • Next by Date: Re: Display RTF & RTFD file in NSTextView
  • Previous by thread: Re: Accessing international month name other than the default locale
  • Next by thread: Work with zerolink enabled; crashes due to signal 5 (SIGTRAP) without
  • Index(es):
    • Date
    • Thread