aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/forms.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-05-01 17:29:58 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-05-01 17:29:58 +0200
commit6a1631476cfd5b46b1c778fff680ea2bc554baaa (patch)
treec33476826be8efee600c5cd33e866201e776cc9c /pyaggr3g470r/forms.py
parentUpdated translation. (diff)
downloadnewspipe-6a1631476cfd5b46b1c778fff680ea2bc554baaa.tar.gz
newspipe-6a1631476cfd5b46b1c778fff680ea2bc554baaa.tar.bz2
newspipe-6a1631476cfd5b46b1c778fff680ea2bc554baaa.zip
Internationalization to french in progress.
Diffstat (limited to 'pyaggr3g470r/forms.py')
-rw-r--r--pyaggr3g470r/forms.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/pyaggr3g470r/forms.py b/pyaggr3g470r/forms.py
index a1e24bd7..7f9ab88b 100644
--- a/pyaggr3g470r/forms.py
+++ b/pyaggr3g470r/forms.py
@@ -28,7 +28,7 @@ __license__ = "GPLv3"
from flask import flash
from flask.ext.wtf import Form
-from flask.ext.babel import gettext
+from flask.ext.babel import lazy_gettext
from wtforms import TextField, TextAreaField, PasswordField, BooleanField, SubmitField, validators
from pyaggr3g470r.models import User
@@ -37,9 +37,9 @@ class SigninForm(Form):
"""
Sign in form.
"""
- email = TextField("Email", [validators.Required(gettext("Please enter your email address."))])
- password = PasswordField(gettext('Password'), [validators.Required(gettext("Please enter a password."))])
- submit = SubmitField(gettext("Log In"))
+ email = TextField("Email", [validators.Required(lazy_gettext("Please enter your email address."))])
+ password = PasswordField(lazy_gettext('Password'), [validators.Required(lazy_gettext("Please enter a password."))])
+ submit = SubmitField(lazy_gettext("Log In"))
def __init__(self, *args, **kwargs):
Form.__init__(self, *args, **kwargs)
@@ -52,17 +52,17 @@ class SigninForm(Form):
if user and user.check_password(self.password.data):
return True
else:
- flash(gettext('Invalid email or password'), 'danger')
+ flash(lazy_gettext('Invalid email or password'), 'danger')
#self.email.errors.append("Invalid email or password")
return False
class AddFeedForm(Form):
- title = TextField(gettext("Title"), [validators.Required(gettext("Please enter a title."))])
- link = TextField(gettext("Feed link"), [validators.Required(gettext("Please enter a link for the feed."))])
- site_link = TextField(gettext("Site link"))
- email_notification = BooleanField(gettext("Email notification"), default=False)
- enabled = BooleanField(gettext("Check for updates"), default=True)
- submit = SubmitField(gettext("Save"))
+ title = TextField(lazy_gettext("Title"), [validators.Required(lazy_gettext("Please enter a title."))])
+ link = TextField(lazy_gettext("Feed link"), [validators.Required(lazy_gettext("Please enter a link for the feed."))])
+ site_link = TextField(lazy_gettext("Site link"))
+ email_notification = BooleanField(lazy_gettext("Email notification"), default=False)
+ enabled = BooleanField(lazy_gettext("Check for updates"), default=True)
+ submit = SubmitField(lazy_gettext("Save"))
def __init__(self, *args, **kwargs):
Form.__init__(self, *args, **kwargs)
@@ -73,11 +73,11 @@ class AddFeedForm(Form):
return True
class ProfileForm(Form):
- firstname = TextField(gettext("First name"), [validators.Required(gettext("Please enter your first name."))])
- lastname = TextField(gettext("Last name"), [validators.Required(gettext("Please enter your last name."))])
- email = TextField(gettext("Email"), [validators.Required(gettext("Please enter your email."))])
- password = PasswordField(gettext("Password"))
- submit = SubmitField(gettext("Save"))
+ firstname = TextField(lazy_gettext("First name"), [validators.Required(lazy_gettext("Please enter your first name."))])
+ lastname = TextField(lazy_gettext("Last name"), [validators.Required(lazy_gettext("Please enter your last name."))])
+ email = TextField(lazy_gettext("Email"), [validators.Required(lazy_gettext("Please enter your email."))])
+ password = PasswordField(lazy_gettext("Password"))
+ submit = SubmitField(lazy_gettext("Save"))
def __init__(self, *args, **kwargs):
Form.__init__(self, *args, **kwargs)
bgstack15