[FIX] Defaults user's context.lang to 'en_US'

bzr revid: fme@openerp.com-20121217100127-i7hr6klay251jo39
This commit is contained in:
Fabien Meghazi 2012-12-17 11:01:27 +01:00
parent fc4ad4f871
commit 78b92eace8
2 changed files with 2 additions and 2 deletions

View File

@ -103,7 +103,7 @@ class WebRequest(object):
lang = self.httprequest.cookies.get('lang')
if lang is None:
lang = self.httprequest.accept_languages.best
if lang is None:
if not lang:
lang = 'en_US'
# tranform 2 letters lang like 'en' into 5 letters like 'en_US'
lang = babel.core.LOCALE_ALIASES.get(lang, lang)

View File

@ -186,6 +186,6 @@ class OpenERPSession(object):
if lang in babel.core.LOCALE_ALIASES:
lang = babel.core.LOCALE_ALIASES[lang]
context['lang'] = lang
context['lang'] = lang or 'en_US'
# vim:et:ts=4:sw=4: