diff options
| author | Christophe Simonis <chs@openerp.com> | 2012-11-12 19:10:33 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@openerp.com> | 2012-11-12 19:10:33 +0100 |
| commit | fa16b8910efd576746fbcdece9eaa0bfbe9499b0 (patch) | |
| tree | 60ba51666e1a795b119d05b6da78e2247f48bff0 /addons/web/controllers | |
| parent | 40734fc4c469be2f58a664a93377ecf6c22386e6 (diff) | |
[ADD] req.lang property to get preferred lang for the current request
bzr revid: chs@openerp.com-20121112181033-b17zj2io47me04kk
Diffstat (limited to 'addons/web/controllers')
| -rw-r--r-- | addons/web/controllers/main.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 42731c5aa3c..ffabe97661b 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -691,12 +691,10 @@ class WebClient(openerpweb.Controller): until we have established a valid session. This is meant only for translating the login page and db management chrome, using the browser's language. """ - lang = req.httprequest.accept_languages.best or 'en' # For performance reasons we only load a single translation, so for # sub-languages (that should only be partially translated) we load the # main language PO instead - that should be enough for the login screen. - if '-' in lang: # RFC2616 uses '-' separators for sublanguages - lang = lang.split('-')[0] + lang = req.lang.split('_')[0] translations_per_module = {} for addon_name in mods: |
