Problem with translations

229 views
Skip to first unread message

Andreas Kuhne

unread,
Aug 21, 2013, 8:57:51 AM8/21/13
to django...@googlegroups.com
Hi,

I am working on a website that is available in 10 different languages, and we have the translations working. If you want to see our website in french, you just add /fr to our url and it works fine.

However we are getting a lot of :

  File "middleware.py", line 83, in process_request
    translation.activate(request.locale_dict['language'])

  File "env/lib/python2.6/site-packages/django/utils/translation/__init__.py", line 90, in activate
    return _trans.activate(language)

  File "env/lib/python2.6/site-packages/django/utils/translation/trans_real.py", line 183, in activate
    _active.value = translation(language)

  File "env/lib/python2.6/site-packages/django/utils/translation/trans_real.py", line 173, in translation
    current_translation = _fetch(language, fallback=default_translation)

  File "env/lib/python2.6/site-packages/django/utils/translation/trans_real.py", line 141, in _fetch
    res._info = res._info.copy()

AttributeError: 'NoneType' object has no attribute '_info'

These errors mostly occur when the user requests an ajax enabled update. As far as I can tell this error is related to the fact that django tranlsations can't open the .mo files for the specific locale. What I don't understand is that this happens maybe once every 2 days, so it doesn't happen all the time. 

The only resources I have found on the subject are regarding to completely missing .mo translation files (which is not the case here). I am leaning towards an issue with apache not being able to open the file, because of restrictions on the number of open files allowed, but I'm not sure. Has anyone any ideas on how to correct this issue? I should also say that it has never happened on our development machines. 

Regards,

Andréas

Mauro Rocco

unread,
Aug 21, 2013, 9:28:05 AM8/21/13
to django...@googlegroups.com
Hi,
That's strange.
To me looks like the server from time to time can not access this files as you said.
What you use in production Apache/ModWSGI ?

Regards

Andreas Kuhne

unread,
Aug 21, 2013, 9:32:21 AM8/21/13
to django...@googlegroups.com
We are running nginx for static files and apache + mod_wsgi for the django website.

Regards,

Andréas

2013/8/21 Mauro Rocco <firean...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

Andreas Kuhne

unread,
Aug 26, 2013, 3:58:32 AM8/26/13
to django...@googlegroups.com
Has nobody heard of this issue before? It is rather disturbing and means that our site crashes from time to time for some users.

Regards,

Andréas

2013/8/21 Andreas Kuhne <andrea...@suitopia.com>

Doug

unread,
Sep 5, 2013, 9:01:57 PM9/5/13
to django...@googlegroups.com
I've found some other people with the same issue.  Looking at the source, the issue is directly related to IOError, so your assumption sounds correct, django can not access nor read the files.  I don't believe this is a django specific issue but server config issue.

I hope this helps.

Doug

unread,
Sep 6, 2013, 2:19:33 AM9/6/13
to django...@googlegroups.com
Follow-up: just for good measure could you tell me what you have in your settings for `LANGUAGE_CODE` and what languages you are trying to support?  If by some small chance you are trying to support a language not apart of this set, an issue could occur with threading.
Reply all
Reply to author
Forward
0 new messages