From 6e02162f73b1063c6cdd2d6d72b286c038d6cc64 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Mon, 12 Sep 2016 10:41:29 +0200 Subject: lazy loading of the translation --- src/web/views/session_mgmt.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/web/views/session_mgmt.py b/src/web/views/session_mgmt.py index d2371305..4982c549 100644 --- a/src/web/views/session_mgmt.py +++ b/src/web/views/session_mgmt.py @@ -6,7 +6,7 @@ from werkzeug import generate_password_hash from werkzeug.exceptions import NotFound from flask import (render_template, flash, session, request, url_for, redirect, current_app) -from flask_babel import gettext +from flask_babel import gettext, lazy_gettext from flask_login import LoginManager, logout_user, \ login_required, current_user from flask_principal import (Principal, AnonymousIdentity, UserNeed, @@ -25,8 +25,8 @@ Principal(current_app) login_manager = LoginManager() login_manager.init_app(current_app) login_manager.login_view = 'login' -login_manager.login_message = gettext("Please log in to access this page.") -login_manager.login_message_category = "info" +login_manager.login_message = lazy_gettext('Please log in to access this page.') +login_manager.login_message_category = 'info' logger = logging.getLogger(__name__) @@ -87,7 +87,7 @@ def logout(): @current_app.route('/signup', methods=['GET', 'POST']) def signup(): if not conf.SELF_REGISTRATION: - flash(gettext("Self-registration is disabled."), 'warning') + flash(gettext('Self-registration is disabled.'), 'warning') return redirect(url_for('home')) if current_user.is_authenticated: return redirect(url_for('home')) -- cgit