from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
-from gettext import gettext
+from gettext import translation
+import locale
+import os
+
+current_locale, encoding = locale.getdefaultlocale()
+locale_path = 'translations/'
+language = translation('messages', locale_path, [current_locale])
+gettext = language.ugettext
+
#from flask_openid import OpenID
#from flaskext.babel import Babel, gettext, ngettext
import sqlite3
from datetime import date, time, timedelta, datetime
import time
from contextlib import closing
-import locale
-locale.setlocale(locale.LC_ALL, '')
-import os
import hashlib
import smtplib
import string
vote = query_db('select * from votes where id = ?', [voteid], one=True)
if vote is None:
abort(404)
- print "\nvote: %s\n" % str(vote)
if request.method == 'POST':
if request.form['title']:
if request.form['days'] > 0:
# Translations template for PROJECT.
-# Copyright (C) 2012 ORGANIZATION
+# Copyright (C) 2014 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2012-12-22 19:01+0100\n"
+"POT-Creation-Date: 2014-10-19 08:27+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"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.6\n"
-#: main.py:120
+#: main.py:123
msgid "Successfully signed in"
-msgstr ""
+msgstr "Connexion réussie"
-#: main.py:151
+#: main.py:154
msgid "Lost password"
-msgstr ""
+msgstr "Phrase-de-passe perdue"
-#: main.py:155
+#: main.py:159
msgid "It seems that you have lost your password."
-msgstr ""
+msgstr "Il semblerait que vous ayez perdi votre phrase-de-passe"
-#: main.py:156
+#: main.py:160
msgid "This link will log you without password."
-msgstr ""
+msgstr "Ce lien vous connectera sans phrase-de-passe"
-#: main.py:157
+#: main.py:161
msgid "Don't forget to define a new one as soon a possible!"
-msgstr ""
+msgstr "N’oubliez pas de le changer aussi tôt que possible !"
-#: main.py:158
+#: main.py:162
msgid "This link will only work one time."
-msgstr ""
+msgstr "Ce lien ne fonctionnera qu’une fois"
-#: main.py:162 main.py:618 reminder.py:53 reminder.py:75
+#: main.py:166 main.py:804 reminder.py:54 reminder.py:78
msgid "If you think this mail is not for you, please ignore and delete it."
msgstr ""
+"Si vous pensez que ce mail ne vous est pas adressé, vous pouvez l’ignorer"
+" et le supprimer."
-#: main.py:285
+#: main.py:292
msgid "Welcome"
-msgstr ""
+msgstr "Bienvenue"
-#: main.py:289
+#: main.py:297
msgid "Hi"
-msgstr ""
+msgstr "Salut"
-#: main.py:290
+#: main.py:298
msgid "Welcome on"
-msgstr ""
+msgstr "Bienvenue sur"
-#: main.py:291
+#: main.py:299
msgid "Your account address is"
-msgstr ""
+msgstr "L’adresse de votre compte est"
-#: main.py:293
+#: main.py:301
msgid ""
"To log in for the first time and set your password, please follow this "
"link :"
-msgstr ""
+msgstr "Pour vous connecter la première fois et changer votre phrase-de-passe, veuillez suivre ce lien :"
-#: main.py:609
-msgid "A vote has been opened for your group"
-msgstr ""
+#: main.py:799
+msgid "A new vote for the group \""
+msgstr "Un nouveau vote pour le groupe « "
-#: main.py:613
-msgid "A vote has been opened and you are in a group concerned by it :"
-msgstr ""
+#: main.py:801
+msgid "\" concerns you:"
+msgstr " » vous concerne :"
-#: main.py:615
-msgid "This link will bring you to the form where you will be able to vote :"
-msgstr ""
+#: main.py:805
+msgid "For more informations, you can contact:"
+msgstr "Pour plus d’informations, vous pouvez contacter :"
#: reminder.py:43
msgid "Vote reminder - You didn't take part to it"
-msgstr ""
+msgstr "Rappel de vote - Vous n’y avez pas pris part"
-#: reminder.py:47
+#: reminder.py:48
msgid "A vote concerns you and is going to terminate on"
-msgstr ""
+msgstr "Un vote vous concernant va se terminer le"
-#: reminder.py:48
+#: reminder.py:49
msgid "You still didn't take part to it !"
-msgstr ""
+msgstr "Vous n’y avez toujours pas pris part !"
-#: reminder.py:50 reminder.py:72
+#: reminder.py:51 reminder.py:75
msgid ""
"This link will bring you to the form where you will be able to "
"participate :"
-msgstr ""
+msgstr "Ce lien vous conduira au formulaire où vous pourrez y participer :"
-#: reminder.py:65
+#: reminder.py:67
msgid "Vote reminder - Last days to modify your choice"
-msgstr ""
+msgstr "Rappel de vote - Dernier jour pour changer votre vote"
-#: reminder.py:69
+#: reminder.py:72
msgid "A vote concerns you and is going to terminate on "
-msgstr ""
+msgstr "Un vote vous concernant va se terminer le "
-#: reminder.py:70
-msgid "You have already voted but you can still modify you choice"
-msgstr ""
+#: reminder.py:73
+msgid "You have already voted but you can still modify your choice"
+msgstr "Vous avez déjà voter mais vous pouvez encore changer votre vote"
msgstr ""
"Project-Id-Version: Cavote \n"
"Report-Msgid-Bugs-To: jrabier@ilico.org\n"
-"POT-Creation-Date: 2012-12-22 19:01+0100\n"
+"POT-Creation-Date: 2014-10-19 08:27+0200\n"
"PO-Revision-Date: 2012-12-22 15:11+0100\n"
"Last-Translator: Julien Rabier <jrabier@ilico.org>\n"
"Language-Team: fr <contact@ffdn.org>\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.6\n"
-#: main.py:120
+#: main.py:123
msgid "Successfully signed in"
msgstr "Vous êtes connectés"
-#: main.py:151
+#: main.py:154
msgid "Lost password"
msgstr "Mot de passe perdu"
-#: main.py:155
+#: main.py:159
msgid "It seems that you have lost your password."
msgstr "Il semble que vous ayez perdu votre mot de passe."
-#: main.py:156
+#: main.py:160
msgid "This link will log you without password."
msgstr "Ce lien vous permet de vous connecter sans mot de passe."
-#: main.py:157
+#: main.py:161
msgid "Don't forget to define a new one as soon a possible!"
msgstr "N'oubliez pas d'en définir un nouveau dès que possible !"
-#: main.py:158
+#: main.py:162
msgid "This link will only work one time."
msgstr "Ce lien n'est valable qu'une seule fois."
-#: main.py:162 main.py:618 reminder.py:53 reminder.py:75
+#: main.py:166 main.py:804 reminder.py:54 reminder.py:78
msgid "If you think this mail is not for you, please ignore and delete it."
-msgstr "Si vous pensez que ce mail ne vous est pas adressé, vous pouvez l'ignorer et le supprimer."
+msgstr ""
+"Si vous pensez que ce mail ne vous est pas adressé, vous pouvez l'ignorer"
+" et le supprimer."
-#: main.py:285
+#: main.py:292
msgid "Welcome"
msgstr "Bienvenue"
-#: main.py:289
+#: main.py:297
msgid "Hi"
msgstr "Bonjour"
-#: main.py:290
+#: main.py:298
msgid "Welcome on"
msgstr "Bienvenue sur"
-#: main.py:291
+#: main.py:299
msgid "Your account address is"
msgstr "L'adresse associée à votre compte est"
-#: main.py:293
+#: main.py:301
msgid ""
"To log in for the first time and set your password, please follow this "
"link :"
"Pour vous connecter la première fois et définir votre mot de passe, "
"suivez ce lien :"
-#: main.py:609
-msgid "A vote has been opened for your group"
-msgstr "Un vote a été ouvert pour votre groupe"
-
-#: main.py:613
-msgid "A vote has been opened and you are in a group concerned by it :"
-msgstr "Un vote a été ouvert et vous êtes dans le groupe concerné par celui-ci :"
+#: main.py:804
+msgid "A new vote concerns you within the group: "
+msgstr "Un nouveau vote vous concerne dans le groupe : "
-#: main.py:615
-msgid "This link will bring you to the form where you will be able to vote :"
-msgstr "Ce lien vous conduira au formulaire qui vous permettra de voter :"
+#: main.py:809
+msgid "For more informations, you can contact:"
+msgstr "Pour plus d’informations, vous pouvez contacter :"
#: reminder.py:43
msgid "Vote reminder - You didn't take part to it"
msgstr "Rappel - Vous n'avez pas encore voté"
-#: reminder.py:47
+#: reminder.py:48
msgid "A vote concerns you and is going to terminate on"
msgstr "Un vote vous concerne et va se terminer le"
-#: reminder.py:48
+#: reminder.py:49
msgid "You still didn't take part to it !"
msgstr "Vous n'y avez pas encore participé !"
-#: reminder.py:50 reminder.py:72
+#: reminder.py:51 reminder.py:75
msgid ""
"This link will bring you to the form where you will be able to "
"participate :"
msgstr "Ce lien vous conduira au formulaire qui vous permettra de voter :"
-#: reminder.py:65
+#: reminder.py:67
msgid "Vote reminder - Last days to modify your choice"
msgstr "Rappel - Derniers jours pour modifier votre vote"
-#: reminder.py:69
+#: reminder.py:72
msgid "A vote concerns you and is going to terminate on "
msgstr "Un vote vous concerne et va se terminer le "
-#: reminder.py:70
-msgid "You have already voted but you can still modify you choice"
+#: reminder.py:73
+#, fuzzy
+msgid "You have already voted but you can still modify your choice"
msgstr "Vous avez déjà voté mais vous pouvez encore modifier votre choix"