Fix double language codes

This commit is contained in:
Oleg Lavrovsky 2017-05-03 16:30:02 +02:00
parent 4d8032ce13
commit 7fe6a4c8bb

View file

@ -8,7 +8,7 @@ register = template.Library()
@register.inclusion_tag('tags/language.html', takes_context=True)
def language_switcher(context):
url = context['page'].url.split('/')
if len(url) > 2 and len(url[1]) == 2:
if len(url) > 2 and len(url[1]) >= 2:
url[1] = '$lang$'
url = '/'.join(url)
return {