Fwd: Interface Builder Date Localization
Fwd: Interface Builder Date Localization
- Subject: Fwd: Interface Builder Date Localization
- From: "Marcus S. Zarra" <email@hidden>
- Date: Tue, 18 Apr 2006 17:21:34 -0600
So there is no way to use a 10.4 localized date directly in IB?
Mmalc and others seem to confirm that. Since the dates I am
displaying are static I am create a string getter for them which does
the localization and formatting in the entity and foregoing setting
up the formatters directly in IB. Naturally this causes a nice
ripple through-out the project so if there is a way to do it cleanly
in IB, I am all ears.
Marcus S. Zarra
Zarra Studios LLC
http://www.zarrastudios.com
On 18 Apr 2006, at 16:00, Chris Kane wrote:
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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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