On Mar 12, 2008, at 5:31 PM, Henning Hraban Ramm wrote:

> I'm struggling with a dDateTextBox in my German environment:
> - at first the date gets displayed in German format (dd.mm.yyyy),
> e.g. 31.12.2008 (that's clearly locale dependent, same as
> datetime.datetime.strftime(locale.nl_langinfo(locale.D_FMT)))
> - the hotkey popup is always in English (ok, I could set ToolTipText
> myself, but for what do we have locales?)

        That particular string is localized, but unless you have a  
translation, it displays in the default English. According to the  
translation site, German is the farthest along, but still only about  
1/3 done.

https://translations.launchpad.net/dabo/trunk/+pots/dabo

> - if I press a hotkey or leave the box, the displayed date gets
> switched to mm.dd.yyyy (12.31.2008)

        That sounds like a bug. A quick look at the code shows that we still  
have some US-format defaults being used for pattern recognition in  
date parsing. These were necessary a while ago, but completely wrong  
with the current date-handling code. I will try to look into it, but  
I'm on the road now (leaving for PyCon in the morning!), and may not  
get to it right away.

> - if I press another key, e.g. +, it tries to take the displayed date
> as dd.mm. and generates an error ("Invalid date specified")
> - after that the hotkeys won't work any more

        Yeah, that follows from the last point. The value has been ruined by  
then.

> I couldn't find a hook for the date display format - I'd prefer ISO
> yyyy-mm-dd, because you can feed that directly to MySQL or the like,
> but any reliable format would do for the moment.


        We abandoned direct formatting of dates in textboxes a while ago:  
there were simply too many ways to mess it up. Now we do not mess with  
the display at all; we simply use what Python gives us, which will be  
dependent on how your machine is set up.

> Perhaps it would make sense to base dDateTextBox on
> wx.DatePickerCtrl? (Didn't try yet if it would fit my needs.)

        That's another option that wasn't available when we created  
dDateTextBox. I don't know if it would be more flexible as far as  
formatting is concerned, as I really haven't used it that much.

-- Ed Leafe





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]

Reply via email to