diff options
Diffstat (limited to 'src/jwebmail/webmail.py')
-rw-r--r-- | src/jwebmail/webmail.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/jwebmail/webmail.py b/src/jwebmail/webmail.py index 26dfe20..5ddc5d6 100644 --- a/src/jwebmail/webmail.py +++ b/src/jwebmail/webmail.py @@ -10,7 +10,7 @@ from flask import ( request, url_for, ) -from flask_babel import gettext, lazy_gettext +from flask_babel import get_locale, 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 from flask_wtf import FlaskForm @@ -66,8 +66,9 @@ 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) + return redirect( + nxt or url_for("displayheaders", lang_code=get_locale().language), 303 + ) else: warn = gettext("login failed!") elif request.method == "POST": |