[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#8153 X-original-commit:2ed5e2a
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
parent
9f44073469
commit
8e647c342a
4
conf.py
4
conf.py
@ -235,6 +235,8 @@ languages_names = {
|
|||||||
'it': 'IT',
|
'it': 'IT',
|
||||||
'nl': 'NL',
|
'nl': 'NL',
|
||||||
'pt_BR': 'PT',
|
'pt_BR': 'PT',
|
||||||
|
'ro': 'RO',
|
||||||
|
'sv': 'SV',
|
||||||
'uk': 'UA',
|
'uk': 'UA',
|
||||||
'zh_CN': 'ZH (CN)',
|
'zh_CN': 'ZH (CN)',
|
||||||
'zh_TW': 'ZH (TW)'
|
'zh_TW': 'ZH (TW)'
|
||||||
@ -445,7 +447,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