summaryrefslogtreecommitdiff
path: root/src/jwebmail/webmail.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/jwebmail/webmail.py')
-rw-r--r--src/jwebmail/webmail.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/jwebmail/webmail.py b/src/jwebmail/webmail.py
index ed4bd1d..26dfe20 100644
--- a/src/jwebmail/webmail.py
+++ b/src/jwebmail/webmail.py
@@ -1,6 +1,15 @@
from urllib.parse import urlparse
-from flask import abort, current_app, flash, redirect, render_template, request, url_for
+from flask import (
+ abort,
+ current_app,
+ flash,
+ g,
+ redirect,
+ render_template,
+ request,
+ url_for,
+)
from flask_babel import gettext, lazy_gettext
from flask_login import current_user, login_user, logout_user
from flask_paginate import Pagination, get_page_parameter, get_per_page_parameter
@@ -57,6 +66,7 @@ def login():
if urlparse(nxt).netloc:
abort(401)
+ g.setdefault("lang_code", current_app.config["BABEL_DEFAULT_LOCALE"])
return redirect(nxt or url_for("displayheaders"), 303)
else:
warn = gettext("login failed!")