[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
This commit is contained in:
committed by
Nicolas Martinelli
parent
b5c660d8c0
commit
9b6ca49b58
@@ -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
|
||||
#----------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user