Re: Interface Builder Date Localization
Re: Interface Builder Date Localization
- Subject: Re: Interface Builder Date Localization
- From: Chris Kane <email@hidden>
- Date: Tue, 18 Apr 2006 15:00:26 -0700
On Apr 18, 2006, at 11:05 AM, Eric Long wrote:
This is not the case; date formatters using 10.4 behaviour localise
dates appropriately according to the user's preferences:
<http://developer.apple.com/documentation/Cocoa/Conceptual/
DataFormatting/index.html>
I may be in error, but I had a discussion with Deborah Goldsmith
about this
topic not long ago that led to believe otherwise.
While it is true that you can get a date in one of the pre-defined
styles
(short, medium, long, full) that is localized, if you want to use a
custom
format string you have to deal with localization yourself.
This is true for component ordering and syntax conventions: if you
just want the month name and the year, for example, there is no easy
way to find out what order they would generally appear in, or what
form of the month name should be used (in some locales), or what
punctuation might appear around the components. But if you decide you
always want the full month name and the year, in that order, and user-
display accuracy isn't important, then NSDateFormatter can be set up
with a custom format string and will generate date strings with
localized month names for you.
On the other hand, I have trouble coming up with a compelling example
where using the localized month name, but it's OK to not be "properly
localized", is more compelling than just using the month number and
year [in a specific calendar].
On Apr 18, 2006, at 11:30 AM, mmalcom crawford wrote:
In this case, would it be possible to use values from user defaults
directly -- see for example <http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/TypesAndConstants/FoundationConstants.html#//apple_ref/doc/c_ref/NSMonthNameArray
>?
Oh, I wouldn't poke at the month name array. That's "old school" and
may go away in a future release. If you just want a month name, you
can still use an NSDateFormatter to get that (-monthSymbols). Either
way it also has the likely problems of being used for "half-baked
localization" (as described above).
Chris Kane
Cocoa Frameworks, Apple
_______________________________________________
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