diff --git a/src/capport/api/lang.py b/src/capport/api/lang.py index 5b9b033..e3c1911 100644 --- a/src/capport/api/lang.py +++ b/src/capport/api/lang.py @@ -1,9 +1,10 @@ from __future__ import annotations +import os.path import re import typing + import quart -import os.path from .app import app @@ -53,7 +54,8 @@ def detect_language(): if 'setlang' in r.args: lang = r.args.get('setlang').strip().lower() if lang and _VALID_LANGUAGE_NAMES.match(lang): - s['lang'] = lang + if s.get('lang') != lang: + s['lang'] = lang g.langs = [lang] return else: