Wiadomość napisana w dniu 2009-05-29, o godz. 03:42, przez luper rouch:

>>> I tried to put locale.setlocale(locale.LC_TIME, 'fr_FR.UTF-8') in  
>>> the
>>> settings file and it works well on the development server. The  
>>> problem
>>> is under mod_python dates are printed in the selected locale for a
>>> while (~2 minutes), then for some strange reason I get English dates
>>> again.
>>>
>>> Maybe there is a mod_python setting to permanently set the locale ?
>>
>> It is likely because you have some other application also being  
>> hosted
>> under the same Apache, be it a Python web application, or even a PHP
>> application, which is changing the locale settings.
>>
> Oh thanks, now I understand why Django uses its own date formating
> functions. I think I will replace all my .strftime() with
> django.utils.dateformat.format(), I don't like the idea to require
> unusual server configuration for my app.


OR use Babel (http://babel.edgewall.org/) which does not require  
setting locale process-wide. Some Django integration is also available  
(templatetags, middleware).

-- 
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-users@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