Hey all,
I cant seem to get my (non-model-)forms datefield localized.
Here's my first attempt:
some_date = fields.DateField(widget=widgets.DateInput(format=ugettext
('%d.%m.%Y')))
That's working fine, until the user switches his sessions language.
Then, the date is still shown in the format(ie. '%d.%m.%Y') and not
the correctly localized one(ie. '%Y-%m-%d').
Now, if I change to ugettext_lazy() like this:
some_date = fields.DateField(widget=widgets.DateInput
(format=ugettext_lazy('%d.%m.%Y')))
I get a TemplateSyntaxError 'strftime() argument 1 must be string or
read-only buffer, not __proxy__'
I'm pretty stuck - it's my first i18n project. Could somebody help me
out, please?
Cheers & thx for any pointer!
Carsten
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---