diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2018-04-04 16:19:25 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim-odoo@users.noreply.github.com> | 2018-04-05 11:01:11 +0200 |
| commit | 9b6ca49b582e63c6be446f164d318115f47b29d5 (patch) | |
| tree | ea0652b7ee20801949d6ea398ada4158ed90b179 /odoo/http.py | |
| parent | b5c660d8c059e7b93c64b9dd9bc96eeb6ee5cadf (diff) | |
[FIX] http: Bokmål language code
- Install Website
- Load the 'Norwegian Bokmål' translation, and choose to translate the
website
- Logout
When accessing the website, the language displayed is not consistent to
the browser language.
1. `no` shows homepage in `nb_NO` (Firefox only) => expected since
Bokmål is the main language in Norway
2. `nb` shows homepage in `en_US` => unexpected
3. `nn` shows homepage in `en_US` => expected since 'Norwegian Nynorsk'
is not a language available (this will be the topic of another PR)
The issues comes from Babel's side, since `nb` is not in the
`LOCALE_ALIASES` while `no` is. We monkey-patch the value to avoid this
while Babel is corrected.
opw-1827258
Diffstat (limited to 'odoo/http.py')
| -rw-r--r-- | odoo/http.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/odoo/http.py b/odoo/http.py index 15ef0bfd6bb..83505d2c36b 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -58,6 +58,9 @@ rpc_response = logging.getLogger(__name__ + '.rpc.response') # 1 week cache for statics as advised by Google Page Speed STATIC_CACHE = 60 * 60 * 24 * 7 +# To remove when corrected in Babel +babel.core.LOCALE_ALIASES['nb'] = 'nb_NO' + #---------------------------------------------------------- # RequestHandler #---------------------------------------------------------- |
