KeyError: u"Unknown language code 'en-us'."

510 views
Skip to first unread message

Geotribu

unread,
Jan 20, 2014, 7:52:37 AM1/20/14
to django...@googlegroups.com
Hi all,


I've developed a multi-language application with Django.
Everything works fine except I receive regularly this message by email:

8<--------------------------------------------------------------

Traceback (most recent call last):

  File "/home/users/avandecastee/osmq/lib/python2.6/site-packages/django/core/handlers/base.py", line 140, in get_response
    response = response.render()

  File "/home/users/avandecastee/osmq/lib/python2.6/site-packages/django/template/response.py", line 105, in render
    self.content = self.rendered_content
......


  File "/home/users/avandecastee/osmq/lib/python2.6/site-packages/django/utils/translation/__init__.py", line 150, in get_language_info
    raise KeyError("Unknown language code %r." % lang_code)

KeyError: u"Unknown language code 'en-us'."

-------------------------------------------------------------->8


Could you tell me what I must change to avoid this message ?


Thanks for your help

Arnaud

Jonathan Pentecost

unread,
Jan 20, 2014, 3:41:55 PM1/20/14
to django...@googlegroups.com
There is no language code "en-us" in django. `from django.conf.global_settings import LANGUAGES` to get a list of all languages.

Geotribu

unread,
Jan 21, 2014, 8:13:41 AM1/21/14
to django...@googlegroups.com
Hi Jonathan,

Thanks to yhou I've found what was wrong in my configuration file !

Thanks again and I've a good day.

A.
Reply all
Reply to author
Forward
0 new messages