aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--messages.pot111
-rw-r--r--pyaggr3g470r/forms.py33
-rw-r--r--pyaggr3g470r/templates/article.html14
-rw-r--r--pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mobin3834 -> 5482 bytes
-rw-r--r--pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po113
-rw-r--r--pyaggr3g470r/views.py6
6 files changed, 248 insertions, 29 deletions
diff --git a/messages.pot b/messages.pot
index 65fbf06c..15786415 100644
--- a/messages.pot
+++ b/messages.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2014-05-01 11:36+0200\n"
+"POT-Creation-Date: 2014-05-01 12:47+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,6 +17,82 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
+#: pyaggr3g470r/forms.py:40
+msgid "Please enter your email address."
+msgstr ""
+
+#: pyaggr3g470r/forms.py:41 pyaggr3g470r/forms.py:79
+msgid "Password"
+msgstr ""
+
+#: pyaggr3g470r/forms.py:41
+msgid "Please enter a password."
+msgstr ""
+
+#: pyaggr3g470r/forms.py:42
+msgid "Log In"
+msgstr ""
+
+#: pyaggr3g470r/forms.py:55
+msgid "Invalid email or password"
+msgstr ""
+
+#: pyaggr3g470r/forms.py:60
+msgid "Title"
+msgstr ""
+
+#: pyaggr3g470r/forms.py:60
+msgid "Please enter a title."
+msgstr ""
+
+#: pyaggr3g470r/forms.py:61
+msgid "Feed link"
+msgstr ""
+
+#: pyaggr3g470r/forms.py:61
+msgid "Please enter a link for the feed."
+msgstr ""
+
+#: pyaggr3g470r/forms.py:62
+msgid "Site link"
+msgstr ""
+
+#: pyaggr3g470r/forms.py:63
+msgid "Email notification"
+msgstr ""
+
+#: pyaggr3g470r/forms.py:64
+msgid "Check for updates"
+msgstr ""
+
+#: pyaggr3g470r/forms.py:65 pyaggr3g470r/forms.py:80
+msgid "Save"
+msgstr ""
+
+#: pyaggr3g470r/forms.py:76
+msgid "First name"
+msgstr ""
+
+#: pyaggr3g470r/forms.py:76
+msgid "Please enter your first name."
+msgstr ""
+
+#: pyaggr3g470r/forms.py:77
+msgid "Last name"
+msgstr ""
+
+#: pyaggr3g470r/forms.py:77
+msgid "Please enter your last name."
+msgstr ""
+
+#: pyaggr3g470r/forms.py:78
+msgid "Email"
+msgstr ""
+
+#: pyaggr3g470r/forms.py:78
+msgid "Please enter your email."
+msgstr ""
+
#: pyaggr3g470r/views.py:93
msgid "Authentication required."
msgstr ""
@@ -111,6 +187,14 @@ msgstr ""
msgid "already in the database."
msgstr ""
+#: pyaggr3g470r/views.py:573
+msgid "Edit the feed"
+msgstr ""
+
+#: pyaggr3g470r/views.py:577
+msgid "Add a feed"
+msgstr ""
+
#: pyaggr3g470r/views.py:590 pyaggr3g470r/views.py:703
msgid "successfully deleted."
msgstr ""
@@ -124,10 +208,35 @@ msgstr ""
msgid "This user does not exist."
msgstr ""
+#: pyaggr3g470r/templates/article.html:10
+msgid "from"
+msgstr ""
+
+#: pyaggr3g470r/templates/article.html:11
+msgid "Delete this article"
+msgstr ""
+
+#: pyaggr3g470r/templates/article.html:13
+msgid "One of your favorites"
+msgstr ""
+
+#: pyaggr3g470r/templates/article.html:15
+msgid "Click if you like this article"
+msgstr ""
+
#: pyaggr3g470r/templates/article.html:25
msgid "Next post:"
msgstr ""
+#: pyaggr3g470r/templates/article.html:28
+msgid "Previous post:"
+msgstr ""
+
+#: pyaggr3g470r/templates/article.html:34
+#: pyaggr3g470r/templates/article.html:37
+msgid "Share on"
+msgstr ""
+
#: pyaggr3g470r/templates/home.html:5
msgid "You are not subscribed to any feed."
msgstr ""
diff --git a/pyaggr3g470r/forms.py b/pyaggr3g470r/forms.py
index 7439c34b..a1e24bd7 100644
--- a/pyaggr3g470r/forms.py
+++ b/pyaggr3g470r/forms.py
@@ -26,8 +26,9 @@ __revision__ = "$Date: 2013/13/05 $"
__copyright__ = "Copyright (c) Cedric Bonhomme"
__license__ = "GPLv3"
-from flask.ext.wtf import Form
from flask import flash
+from flask.ext.wtf import Form
+from flask.ext.babel import gettext
from wtforms import TextField, TextAreaField, PasswordField, BooleanField, SubmitField, validators
from pyaggr3g470r.models import User
@@ -36,9 +37,9 @@ class SigninForm(Form):
"""
Sign in form.
"""
- email = TextField("Email", [validators.Required("Please enter your email address."), validators.Email("Please enter your email address.")])
- password = PasswordField('Password', [validators.Required("Please enter a password.")])
- submit = SubmitField("Log In")
+ 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"))
def __init__(self, *args, **kwargs):
Form.__init__(self, *args, **kwargs)
@@ -51,17 +52,17 @@ class SigninForm(Form):
if user and user.check_password(self.password.data):
return True
else:
- flash('Invalid email or password', 'danger')
+ flash(gettext('Invalid email or password'), 'danger')
#self.email.errors.append("Invalid email or password")
return False
class AddFeedForm(Form):
- title = TextField("Title", [validators.Required("Please enter a title.")])
- link = TextField("Feed link", [validators.Required("Please enter a link for the feed.")])
- site_link = TextField("Site link")
- email_notification = BooleanField("Email notification", default=False)
- enabled = BooleanField("Check for updates", default=True)
- submit = SubmitField("Save")
+ 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"))
def __init__(self, *args, **kwargs):
Form.__init__(self, *args, **kwargs)
@@ -72,11 +73,11 @@ class AddFeedForm(Form):
return True
class ProfileForm(Form):
- firstname = TextField("First name", [validators.Required("Please enter your first name.")])
- lastname = TextField("Last name", [validators.Required("Please enter your last name.")])
- email = TextField("Email", [validators.Required("Please enter your email.")])
- password = PasswordField("Password")
- submit = SubmitField("Save")
+ 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"))
def __init__(self, *args, **kwargs):
Form.__init__(self, *args, **kwargs)
diff --git a/pyaggr3g470r/templates/article.html b/pyaggr3g470r/templates/article.html
index f7790d6a..81d5d2e4 100644
--- a/pyaggr3g470r/templates/article.html
+++ b/pyaggr3g470r/templates/article.html
@@ -7,12 +7,12 @@
<div class="container">
<div class="jumbotron">
<h2><a href="{{ article.link }}">{{ article.title|safe }}</a></h2>
- <h3>from <a href="/feed/{{ article.source.id }}">{{ article.source.title }}</a></h3>
- <a href="/delete/{{ article.id }}"><i class="glyphicon glyphicon-remove" title="Delete this article"></i></a>
+ <h3>{{ _('from') }} <a href="/feed/{{ article.source.id }}">{{ article.source.title }}</a></h3>
+ <a href="/delete/{{ article.id }}"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this article') }}"></i></a>
{% if article.like %}
- <a href="/like/{{ article.id }}"><i class="glyphicon glyphicon-star" title="One of your favorites"></i></a>
+ <a href="/like/{{ article.id }}"><i class="glyphicon glyphicon-star" title="{{ _('One of your favorites') }}"></i></a>
{% else %}
- <a href="/like/{{ article.id }}"><i class="glyphicon glyphicon-star-empty" title="Click if you like this article"></i></a>
+ <a href="/like/{{ article.id }}"><i class="glyphicon glyphicon-star-empty" title="{{ _('Click if you like this article') }}"></i></a>
{% endif %}
<h6>{{ article.date }}</h6>
</div>
@@ -25,16 +25,16 @@
{{ _('Next post:') }} <a href="/article/{{ next_article.id }}">{{ next_article.title }}</a>
</div>
<div class="col-md-6 text-right">
- Previous post: <a href="/article/{{ previous_article.id }}">{{ previous_article.title }}</a>
+ {{ _('Previous post:') }} <a href="/article/{{ previous_article.id }}">{{ previous_article.title }}</a>
</div>
</div>
</div>
<div class="jumbotron">
<a href="https://api.pinboard.in/v1/posts/add?url={{ article.link }}&description={{ article.title }}" rel="noreferrer" target="_blank">
- <img src="/static/img/pinboard.png" title="Share on Pinboard" />
+ <img src="/static/img/pinboard.png" title="{{ _('Share on') }} Pinboard" />
</a>
<a href="http://reddit.com/submit?url={{ article.link }}&title={{ article.title }}" rel="noreferrer" target="_blank">
- <img src="/static/img/reddit.png" title="Share on reddit" />
+ <img src="/static/img/reddit.png" title="{{ _('Share on') }} reddit" />
</a>
<g:plusone size="standard" count="true" href="{{ article.link }}"></g:plusone>
</div>
diff --git a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo
index e685bafd..e5282935 100644
--- a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo
+++ b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po
index a9e50dd0..230bbe27 100644
--- a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po
+++ b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2014-05-01 11:36+0200\n"
-"PO-Revision-Date: 2014-05-01 11:36+0100\n"
+"POT-Creation-Date: 2014-05-01 12:47+0200\n"
+"PO-Revision-Date: 2014-05-01 12:48+0100\n"
"Last-Translator: Cédric Bonhomme <cedric@cedricbonhomme.org>\n"
"Language-Team: fr <LL@li.org>\n"
"Language: fr\n"
@@ -19,6 +19,82 @@ msgstr ""
"Generated-By: Babel 1.3\n"
"X-Generator: Poedit 1.5.4\n"
+#: pyaggr3g470r/forms.py:40
+msgid "Please enter your email address."
+msgstr "S'il vous plaît, entrez votre adresse email."
+
+#: pyaggr3g470r/forms.py:41 pyaggr3g470r/forms.py:79
+msgid "Password"
+msgstr "Mot de passe"
+
+#: pyaggr3g470r/forms.py:41
+msgid "Please enter a password."
+msgstr "S'il vous plaît entrer un mot de passe."
+
+#: pyaggr3g470r/forms.py:42
+msgid "Log In"
+msgstr "Connexion"
+
+#: pyaggr3g470r/forms.py:55
+msgid "Invalid email or password"
+msgstr "E-mail ou mot de passe invalide"
+
+#: pyaggr3g470r/forms.py:60
+msgid "Title"
+msgstr "Titre"
+
+#: pyaggr3g470r/forms.py:60
+msgid "Please enter a title."
+msgstr "S'il vous plaît, entrez un titre."
+
+#: pyaggr3g470r/forms.py:61
+msgid "Feed link"
+msgstr "Lien du flux"
+
+#: pyaggr3g470r/forms.py:61
+msgid "Please enter a link for the feed."
+msgstr "S'il vous plaît, entrez un lien pour le flux."
+
+#: pyaggr3g470r/forms.py:62
+msgid "Site link"
+msgstr "Lien du site"
+
+#: pyaggr3g470r/forms.py:63
+msgid "Email notification"
+msgstr "Notification par email"
+
+#: pyaggr3g470r/forms.py:64
+msgid "Check for updates"
+msgstr "Vérifier les mises à jour"
+
+#: pyaggr3g470r/forms.py:65 pyaggr3g470r/forms.py:80
+msgid "Save"
+msgstr "Sauver"
+
+#: pyaggr3g470r/forms.py:76
+msgid "First name"
+msgstr "Prénom"
+
+#: pyaggr3g470r/forms.py:76
+msgid "Please enter your first name."
+msgstr "S'il vous plaît, entrez votre prénom."
+
+#: pyaggr3g470r/forms.py:77
+msgid "Last name"
+msgstr "Nom de famille"
+
+#: pyaggr3g470r/forms.py:77
+msgid "Please enter your last name."
+msgstr "S'il vous plaît, entrez votre nom de famille."
+
+#: pyaggr3g470r/forms.py:78
+msgid "Email"
+msgstr "Email"
+
+#: pyaggr3g470r/forms.py:78
+msgid "Please enter your email."
+msgstr "S'il vous plaît, entrez votre email."
+
#: pyaggr3g470r/views.py:93
msgid "Authentication required."
msgstr "Authentification requise."
@@ -113,6 +189,14 @@ msgstr "créé avec succès."
msgid "already in the database."
msgstr "déjà dans la base de données."
+#: pyaggr3g470r/views.py:573
+msgid "Edit the feed"
+msgstr "Éditez ce flux"
+
+#: pyaggr3g470r/views.py:577
+msgid "Add a feed"
+msgstr "Ajoutez un flux"
+
#: pyaggr3g470r/views.py:590 pyaggr3g470r/views.py:703
msgid "successfully deleted."
msgstr "supprimé avec succès."
@@ -126,10 +210,35 @@ msgstr "Utilisateur"
msgid "This user does not exist."
msgstr "Cet utilisateur n'existe pas."
+#: pyaggr3g470r/templates/article.html:10
+msgid "from"
+msgstr "de"
+
+#: pyaggr3g470r/templates/article.html:11
+msgid "Delete this article"
+msgstr "Supprimer cet article"
+
+#: pyaggr3g470r/templates/article.html:13
+msgid "One of your favorites"
+msgstr "Un de vos favoris"
+
+#: pyaggr3g470r/templates/article.html:15
+msgid "Click if you like this article"
+msgstr "Cliquez si vous aimez cet article"
+
#: pyaggr3g470r/templates/article.html:25
msgid "Next post:"
msgstr "Billet suivant:"
+#: pyaggr3g470r/templates/article.html:28
+msgid "Previous post:"
+msgstr "Billet précédent:"
+
+#: pyaggr3g470r/templates/article.html:34
+#: pyaggr3g470r/templates/article.html:37
+msgid "Share on"
+msgstr "Partager sur"
+
#: pyaggr3g470r/templates/home.html:5
msgid "You are not subscribed to any feed."
msgstr "Vous êtes abonné à aucun flux."
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index 88bb45f7..f9a44228 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -119,7 +119,7 @@ def get_locale():
Called before each request to give us a chance to choose
the language to use when producing its response.
"""
- return "fr"#request.accept_languages.best_match(conf.LANGUAGES.keys())
+ return request.accept_languages.best_match(conf.LANGUAGES.keys())
#
@@ -570,11 +570,11 @@ def edit_feed(feed_id=None):
if request.method == 'GET':
if feed_id is not None:
form = AddFeedForm(obj=feed)
- return render_template('edit_feed.html', action="Edit the feed", form=form, feed=feed, \
+ return render_template('edit_feed.html', action=gettext("Edit the feed"), form=form, feed=feed, \
not_on_heroku = not conf.ON_HEROKU)
# Return an empty form in order to create a new feed
- return render_template('edit_feed.html', action="Add a feed", form=form, \
+ return render_template('edit_feed.html', action=gettext("Add a feed"), form=form, \
not_on_heroku = not conf.ON_HEROKU)
@app.route('/delete_feed/<feed_id>', methods=['GET'])
bgstack15