[FIX] conf: don't use None in language switcher
In a lang is not present in languages_names, the menu was displaying None X-original-commit:8b40d49
add Swedish closes odoo/documentation#8159 X-original-commit:8e647c342a
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
parent
33712a339f
commit
36ab5e74c3
4
conf.py
4
conf.py
@ -235,6 +235,8 @@ languages_names = {
|
||||
'it': 'IT',
|
||||
'nl': 'NL',
|
||||
'pt_BR': 'PT',
|
||||
'ro': 'RO',
|
||||
'sv': 'SV',
|
||||
'uk': 'UA',
|
||||
'zh_CN': 'ZH (CN)',
|
||||
'zh_TW': 'ZH (TW)'
|
||||
@ -445,7 +447,7 @@ def _generate_alternate_urls(app, pagename, templatename, context, doctree):
|
||||
"""
|
||||
_current_lang = app.config.language or 'en'
|
||||
# Replace the context value by its upper-cased value ("FR" instead of "fr")
|
||||
context['language'] = languages_names.get(_current_lang)
|
||||
context['language'] = languages_names.get(_current_lang, _current_lang.upper())
|
||||
context['language_code'] = _current_lang
|
||||
|
||||
# If the list of languages is not set, assume that the project has no alternate language
|
||||
|
Loading…
Reference in New Issue
Block a user