>And those date hierarchy filters were displayed like they should be
>displayed. I mean translated. This was because date formatter uses
>strftime, which uses locale settings.

Yeah, but that only works with a single locale - many apps need
per-request locales, that's the reason why date formatting should
better use the Django datetime formatters.

>So it seems to me that Django's own datetime formatters could be
>replaced with Python's own locale module
>(http://www.python.org/doc/lib/module-locale.html), which would be good
>thing for internationalizating Django.

Actually the other way around would be much better: replace the
strftime usage by Django formatting :-)

The locale module is quite a pain in servers, because it's just one
global setting - but if you need a language switch per request, locale
won't work, because you would switch the locale for all running code at
that time - and if your server is multithreaded, you will switch the
locale of the other threads and therefore other requests.

If you find strftime usage in the code, please open a ticket (target
"internationalization") with the filename where this happens, so that
those places can be changed to the correct way. There are several ways
to do (mostly) correct date and time formatting and translating in
Django.

bye, Georg

Reply via email to