diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-09-12 10:41:29 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-09-12 10:41:29 +0200 |
commit | 6e02162f73b1063c6cdd2d6d72b286c038d6cc64 (patch) | |
tree | fdd1f58807466c1e0e05a7b81b7953f16d001976 /src/web/views | |
parent | Updated translations. (diff) | |
download | newspipe-6e02162f73b1063c6cdd2d6d72b286c038d6cc64.tar.gz newspipe-6e02162f73b1063c6cdd2d6d72b286c038d6cc64.tar.bz2 newspipe-6e02162f73b1063c6cdd2d6d72b286c038d6cc64.zip |
lazy loading of the translation
Diffstat (limited to 'src/web/views')
-rw-r--r-- | src/web/views/session_mgmt.py | 8 |
1 files 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')) |