Dmitry Vasiliev wrote:
Gary Poster wrote:
However, I'm not sure the new widget behavior is great for non-default
locales either. Certainly being able to display dates in a
locale-specific way is nice, but the input seems to be problematic.
If you specify an ACCEPT-LANGUAGE of "en-US", for instance, you need
to fill in "Dec 2, 2002 12:30:00 PM", if I remember correctly. Fully
spelling out "December" does not work. Leaving off the seconds
doesn't work. Any other format will not work. I didn't check, but
assume other languages result in similar restrictions in input.
Yes, the input is a bit problematic in russian too, especially for
"long" and "full" display styles. Unfortunately I didn't get any reply
on my pre-checkin message
(http://mail.zope.org/pipermail/zope3-dev/2006-June/019585.html) so I
guessed no one was interested in the problem.
The data in en.xml could be usable to get a more robust approach, and
it could even be done without change to zope.i18n for dates. But
AFAICT, for datetimes some help would need to be implemented in the
i18n.locale module (since the order of dates and times is specified in
the XML); and for datetimes and times I think we'd want to make
specifying seconds, and maybe even minutes, optional. This is
probably doable, but it seems like it might be painful to code and test.
I agree the i18n datetime parsing should be made a bit relaxed. I even
think the only important thing in this context is the order of the
fields, so we can ignore spaces (or even ignore some other delimitters?)
and maybe ignore other non-field characters (for example in the russian
"long" format you always need to write year as "year 2006" instead of
the simple "2006").
I'm very much against "relaxed" date/time format checking. I tend to
give my user the exact format that is expected and fail otherwise. All
the guessing in the past led to bad bad errors because the field order
the user entered was syntactically compatible but had a semantically
02/05/2005 and 02.05.2005 are two different things.
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development
Zope3-dev mailing list