From 6a1631476cfd5b46b1c778fff680ea2bc554baaa Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 1 May 2014 17:29:58 +0200 Subject: Internationalization to french in progress. --- messages.pot | 187 +++++++++++++++++--- pyaggr3g470r/forms.py | 32 ++-- pyaggr3g470r/templates/favorites.html | 10 +- pyaggr3g470r/templates/feed.html | 16 +- pyaggr3g470r/templates/feeds.html | 22 +-- pyaggr3g470r/templates/inactives.html | 6 +- pyaggr3g470r/templates/layout.html | 28 +-- pyaggr3g470r/templates/unread.html | 14 +- .../translations/fr/LC_MESSAGES/messages.mo | Bin 5482 -> 7154 bytes .../translations/fr/LC_MESSAGES/messages.po | 195 ++++++++++++++++++--- 10 files changed, 404 insertions(+), 106 deletions(-) diff --git a/messages.pot b/messages.pot index 15786415..cf576855 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 12:47+0200\n" +"POT-Creation-Date: 2014-05-01 17:26+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -37,7 +37,7 @@ msgstr "" msgid "Invalid email or password" msgstr "" -#: pyaggr3g470r/forms.py:60 +#: pyaggr3g470r/forms.py:60 pyaggr3g470r/templates/feeds.html:11 msgid "Title" msgstr "" @@ -191,7 +191,7 @@ msgstr "" msgid "Edit the feed" msgstr "" -#: pyaggr3g470r/views.py:577 +#: pyaggr3g470r/views.py:577 pyaggr3g470r/templates/layout.html:48 msgid "Add a feed" msgstr "" @@ -237,59 +237,198 @@ msgstr "" msgid "Share on" msgstr "" -#: pyaggr3g470r/templates/home.html:5 -msgid "You are not subscribed to any feed." +#: pyaggr3g470r/templates/favorites.html:6 +msgid "No favorites" msgstr "" -#: pyaggr3g470r/templates/home.html:5 -msgid "Fix this" +#: pyaggr3g470r/templates/favorites.html:10 +msgid "Favorites articles" msgstr "" -#: pyaggr3g470r/templates/home.html:11 +#: pyaggr3g470r/templates/favorites.html:16 pyaggr3g470r/templates/home.html:11 +#: pyaggr3g470r/templates/unread.html:16 msgid "More articles" msgstr "" -#: pyaggr3g470r/templates/home.html:12 +#: pyaggr3g470r/templates/favorites.html:17 pyaggr3g470r/templates/home.html:12 +#: pyaggr3g470r/templates/unread.html:17 msgid "Details" msgstr "" -#: pyaggr3g470r/templates/home.html:13 +#: pyaggr3g470r/templates/favorites.html:18 pyaggr3g470r/templates/feed.html:8 +#: pyaggr3g470r/templates/feeds.html:33 pyaggr3g470r/templates/home.html:13 +#: pyaggr3g470r/templates/unread.html:18 msgid "Edit this feed" msgstr "" -#: pyaggr3g470r/templates/home.html:15 -msgid "Fetch this feed" +#: pyaggr3g470r/templates/feed.html:7 pyaggr3g470r/templates/feeds.html:34 +msgid "Delete this feed" msgstr "" -#: pyaggr3g470r/templates/home.html:17 -msgid "Mark all as read" +#: pyaggr3g470r/templates/feed.html:12 +msgid "This feed contains" msgstr "" -#: pyaggr3g470r/templates/management.html:5 -msgid "Your subscriptions" +#: pyaggr3g470r/templates/feed.html:12 +msgid "articles" +msgstr "" + +#: pyaggr3g470r/templates/feed.html:14 +msgid "of the database" msgstr "" -#: pyaggr3g470r/templates/management.html:6 +#: pyaggr3g470r/templates/feed.html:17 +msgid "Address of the feed" +msgstr "" + +#: pyaggr3g470r/templates/feed.html:19 +msgid "Address of the site" +msgstr "" + +#: pyaggr3g470r/templates/feed.html:23 +msgid "The last article was posted" +msgstr "" + +#: pyaggr3g470r/templates/feed.html:23 +msgid "day(s) ago." +msgstr "" + +#: pyaggr3g470r/templates/feed.html:24 +msgid "Daily average" +msgstr "" + +#: pyaggr3g470r/templates/feed.html:24 +msgid "between the" +msgstr "" + +#: pyaggr3g470r/templates/feed.html:24 +msgid "and the" +msgstr "" + +#: pyaggr3g470r/templates/feeds.html:4 pyaggr3g470r/templates/management.html:6 msgid "You are subscribed to" msgstr "" -#: pyaggr3g470r/templates/management.html:6 +#: pyaggr3g470r/templates/feeds.html:4 pyaggr3g470r/templates/management.html:6 msgid "feeds" msgstr "" -#: pyaggr3g470r/templates/management.html:6 +#: pyaggr3g470r/templates/feeds.html:4 pyaggr3g470r/templates/management.html:6 msgid "Add a" msgstr "" -#: pyaggr3g470r/templates/management.html:6 +#: pyaggr3g470r/templates/feeds.html:4 pyaggr3g470r/templates/management.html:6 msgid "feed" msgstr "" +#: pyaggr3g470r/templates/feeds.html:10 +msgid "Status" +msgstr "" + +#: pyaggr3g470r/templates/feeds.html:12 +msgid "Site" +msgstr "" + +#: pyaggr3g470r/templates/feeds.html:13 pyaggr3g470r/templates/feeds.html:32 +#: pyaggr3g470r/templates/layout.html:43 +msgid "Articles" +msgstr "" + +#: pyaggr3g470r/templates/feeds.html:14 +msgid "Actions" +msgstr "" + +#: pyaggr3g470r/templates/feeds.html:23 +msgid "Feed enabled" +msgstr "" + +#: pyaggr3g470r/templates/feeds.html:25 +msgid "Feed disabled" +msgstr "" + +#: pyaggr3g470r/templates/home.html:5 +msgid "You are not subscribed to any feed." +msgstr "" + +#: pyaggr3g470r/templates/home.html:5 +msgid "Fix this" +msgstr "" + +#: pyaggr3g470r/templates/home.html:15 +msgid "Fetch this feed" +msgstr "" + +#: pyaggr3g470r/templates/home.html:17 pyaggr3g470r/templates/layout.html:46 +#: pyaggr3g470r/templates/unread.html:19 +msgid "Mark all as read" +msgstr "" + +#: pyaggr3g470r/templates/inactives.html:6 +msgid "Days of inactivity" +msgstr "" + +#: pyaggr3g470r/templates/inactives.html:13 +msgid "days" +msgstr "" + +#: pyaggr3g470r/templates/inactives.html:17 +msgid "No inactive feeds." +msgstr "" + +#: pyaggr3g470r/templates/layout.html:45 +msgid "Fetch" +msgstr "" + +#: pyaggr3g470r/templates/layout.html:52 +msgid "Filter" +msgstr "" + +#: pyaggr3g470r/templates/layout.html:54 +msgid "Unread" +msgstr "" + +#: pyaggr3g470r/templates/layout.html:55 +msgid "Favorites" +msgstr "" + +#: pyaggr3g470r/templates/layout.html:56 +msgid "Inactive feeds" +msgstr "" + +#: pyaggr3g470r/templates/layout.html:57 +msgid "All feeds" +msgstr "" + +#: pyaggr3g470r/templates/layout.html:58 +msgid "History" +msgstr "" + +#: pyaggr3g470r/templates/layout.html:61 +msgid "Management" +msgstr "" + +#: pyaggr3g470r/templates/layout.html:63 +msgid "Dashboard" +msgstr "" + +#: pyaggr3g470r/templates/layout.html:65 +msgid "About" +msgstr "" + +#: pyaggr3g470r/templates/layout.html:66 +msgid "Logout" +msgstr "" + +#: pyaggr3g470r/templates/management.html:5 +msgid "Your subscriptions" +msgstr "" + #: pyaggr3g470r/templates/management.html:7 msgid "articles are stored in the database with" msgstr "" #: pyaggr3g470r/templates/management.html:7 +#: pyaggr3g470r/templates/unread.html:20 msgid "unread articles" msgstr "" @@ -345,3 +484,11 @@ msgstr "" msgid "Export articles" msgstr "" +#: pyaggr3g470r/templates/unread.html:6 +msgid "No unread articles" +msgstr "" + +#: pyaggr3g470r/templates/unread.html:10 +msgid "Unread articles" +msgstr "" + 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) diff --git a/pyaggr3g470r/templates/favorites.html b/pyaggr3g470r/templates/favorites.html index 50378d3c..b0357b41 100644 --- a/pyaggr3g470r/templates/favorites.html +++ b/pyaggr3g470r/templates/favorites.html @@ -3,19 +3,19 @@
{% if feeds|count == 0 %} {% else %} {% for feed in feeds|sort(attribute="title") %}

{{ feed.title|safe }}

- - - + + +
{% for number in range(0, feed.articles.all()|length-(feed.articles.all()|length % 3), 3) %} diff --git a/pyaggr3g470r/templates/feed.html b/pyaggr3g470r/templates/feed.html index 849dba49..98e965e4 100644 --- a/pyaggr3g470r/templates/feed.html +++ b/pyaggr3g470r/templates/feed.html @@ -4,24 +4,24 @@

{{ feed.title }}

{% if feed.description %}

{{ feed.description }}

{% endif %} - - + +

- This feed contains {{ feed.articles.all()|count }} articles + {{ _('This feed contains') }} {{ feed.articles.all()|count }} {{ _('articles') }} {% if nb_articles != 0 %} - ({{ ((feed.articles.all()|count * 100 ) / nb_articles) | round(2, 'floor') }}% of the database) + ({{ ((feed.articles.all()|count * 100 ) / nb_articles) | round(2, 'floor') }}% {{ _('of the database') }}) {% endif %} .
- Address of the feed: {{ feed.link }}
+ {{ _('Address of the feed') }}: {{ feed.link }}
{% if feed.site_link != "" %} - Address of the site: {{ feed.site_link }} + {{ _('Address of the site') }}: {{ feed.site_link }} {% endif %}
{% if feed.articles.all()|count != 0 %} - The last article was posted {{ elapsed.days }} day(s) ago.
- Daily average: {{ average }}, between the {{ first_post_date.strftime('%Y-%m-%d') }} and the {{ end_post_date.strftime('%Y-%m-%d') }}. + {{ _('The last article was posted') }} {{ elapsed.days }} {{ _('day(s) ago.') }}
+ {{ _('Daily average') }}: {{ average }}, {{ _('between the') }} {{ first_post_date.strftime('%Y-%m-%d') }} {{ _('and the') }} {{ end_post_date.strftime('%Y-%m-%d') }}. {% endif %}

diff --git a/pyaggr3g470r/templates/feeds.html b/pyaggr3g470r/templates/feeds.html index 82e4afae..4caf6653 100644 --- a/pyaggr3g470r/templates/feeds.html +++ b/pyaggr3g470r/templates/feeds.html @@ -1,17 +1,17 @@ {% extends "layout.html" %} {% block content %}
-

You are subscribed to {{ feeds.all()|count }} feeds · Add a feed

+

{{ _('You are subscribed to') }} {{ feeds.all()|count }} {{ _('feeds') }} · {{ _('Add a') }} {{ _('feed') }}

- - - - - + + + + + @@ -20,18 +20,18 @@ {% endfor %} diff --git a/pyaggr3g470r/templates/inactives.html b/pyaggr3g470r/templates/inactives.html index 0d093029..1916e09a 100644 --- a/pyaggr3g470r/templates/inactives.html +++ b/pyaggr3g470r/templates/inactives.html @@ -3,18 +3,18 @@
-

Days of inactivity:

+

{{ _('Days of inactivity') }}:


{% if inactives != [] %} {% else %} -

No inactive feeds.

+

{{ _('No inactive feeds.') }}

{% endif %}

diff --git a/pyaggr3g470r/templates/layout.html b/pyaggr3g470r/templates/layout.html index d45ce090..8ed66d89 100644 --- a/pyaggr3g470r/templates/layout.html +++ b/pyaggr3g470r/templates/layout.html @@ -40,30 +40,30 @@
#StatusTitleSiteArticlesActions{{ _('Status') }}{{ _('Title') }}{{ _('Site') }}{{ _('Articles') }}{{ _('Actions') }}
{{ loop.index }} {% if feed.enabled %} - + {% else %} - + {% endif %} {{ feed.title }} {{ feed.site_link }} {{ feed.articles.all()|count }} - - - + + +