Avoid building a /en URL in language switcher
This commit is contained in:
parent
02e4948002
commit
4a10c5b946
2
conf.py
2
conf.py
@ -332,7 +332,7 @@ def localize(app, pagename, templatename, context, doctree):
|
|||||||
current_lang = app.config.language or 'en'
|
current_lang = app.config.language or 'en'
|
||||||
context['language'] = current_lang.upper()
|
context['language'] = current_lang.upper()
|
||||||
context['languages'] = [
|
context['languages'] = [
|
||||||
(la.upper(), _build_url(app.config.canonical_root, la, pagename))
|
(la.upper(), _build_url(app.config.canonical_root, (la != 'en' and la or ''), pagename))
|
||||||
for la in app.config.languages.split(',')
|
for la in app.config.languages.split(',')
|
||||||
if la != current_lang
|
if la != current_lang
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user