only set session (cookie) lang on changes
This commit is contained in:
parent
7420b4107e
commit
f8a3676555
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user