Wiadomość napisana w dniu 2009-12-22, o godz. 12:39, przez Jarek Zgoda:

> Wiadomość napisana w dniu 2009-12-22, o godz. 09:29, przez Baurzhan
> Ismagulov:
>
>>> Maybe what I did can help you: in case you want to put the day name
>>> in
>>> the template you can put a proper date for each day and just put  
>>> into
>>> the template for each day:
>>> {{ day|date: "l" }}
>>> day is a datetime.date object.
>>> that should give the proper day name according to the locale you set
>>> in settings.py.
>>
>> How can I get this to work for two languages on the same page?
>
>
> Unfortunately you cann't get 2 different locales to work at the same
> time. I'd propose to use Babel (http://babel.edgewall.org/) which has
> nice Django integration (http://babel.edgewall.org/wiki/BabelDjango).
> You can format dates, times and currencies in different formats and
> specify locales in formatting functions.


I forgot one thing: while BabelDjango provides some templatetags, they  
all use single locale. You have to wrap actual Babel functions (eg.  
babel.dates.format_date()) in your own templatetags.

-- 
Artificial intelligence stands no chance against natural stupidity

Jarek Zgoda, R&D, Redefine
jarek.zg...@redefine.pl

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to