Force lang session
This commit is contained in:
parent
01ca13305c
commit
3a1137561d
|
@ -12,6 +12,9 @@ LANGUAGES = {
|
||||||
|
|
||||||
@babel.localeselector
|
@babel.localeselector
|
||||||
def get_locale():
|
def get_locale():
|
||||||
|
# force session lang to be set
|
||||||
|
session["lang"] = session.get("lang", "en")
|
||||||
|
|
||||||
if request.args.get("lang"):
|
if request.args.get("lang"):
|
||||||
session["lang"] = request.args.get("lang") if request.args.get("lang") in LANGUAGES.keys() else "en"
|
session["lang"] = request.args.get("lang") if request.args.get("lang") in LANGUAGES.keys() else "en"
|
||||||
return session.get("lang", "en")
|
return session.get("lang", "en")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user