[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: 8b40d49658
Part-of: odoo/documentation#8152
This commit is contained in:
parent
6689684b0c
commit
a33955ec82
2
conf.py
2
conf.py
@ -446,7 +446,7 @@ def _generate_alternate_urls(app, pagename, templatename, context, doctree):
|
|||||||
"""
|
"""
|
||||||
_current_lang = app.config.language or 'en'
|
_current_lang = app.config.language or 'en'
|
||||||
# Replace the context value by its upper-cased value ("FR" instead of "fr")
|
# 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
|
context['language_code'] = _current_lang
|
||||||
|
|
||||||
# If the list of languages is not set, assume that the project has no alternate language
|
# If the list of languages is not set, assume that the project has no alternate language
|
||||||
|
Loading…
Reference in New Issue
Block a user