diff --git a/OPSession.inc.zip b/OPSession.inc.zip deleted file mode 100644 index dcb79a9..0000000 Binary files a/OPSession.inc.zip and /dev/null differ diff --git a/admin/index.php b/admin/index.php index 28014ef..ed48b62 100644 --- a/admin/index.php +++ b/admin/index.php @@ -19,6 +19,6 @@ require_once '../app/inc/init.php'; -$smarty->assign('title', _('Administration')); +$smarty->assign('title', __('Admin', 'Administration')); $smarty->assign('logsAreReadable', is_readable('../' . LOG_FILE)); $smarty->display('admin/index.tpl'); \ No newline at end of file diff --git a/admin/logs.php b/admin/logs.php index 8feb6bb..3008a94 100644 --- a/admin/logs.php +++ b/admin/logs.php @@ -23,9 +23,7 @@ ob_start(); is_readable('../' . LOG_FILE) ? readfile('../' . LOG_FILE) : null; $content = ob_get_clean(); -$smarty->assign('title', _('Administration')); $smarty->assign('logs', $content); - $smarty->assign('title', __('Admin', 'Logs')); $smarty->display('admin/logs.tpl'); \ No newline at end of file diff --git a/admin/purge.php b/admin/purge.php index 0ef29b9..c258353 100644 --- a/admin/purge.php +++ b/admin/purge.php @@ -46,7 +46,7 @@ $action = filter_input(INPUT_POST, 'action', FILTER_VALIDATE_REGEXP, ['options' if ($action === 'purge' && $securityService->checkCsrf('admin', $_POST['csrf'])) { $count = $purgeService->purgeOldPolls(); - $message = _('Purged:') . ' ' . $count; + $message = __('Admin', 'Purged:') . ' ' . $count; } // Assign data to template diff --git a/app/classes/Framadate/Services/MailService.php b/app/classes/Framadate/Services/MailService.php index c8ce77d..3095869 100644 --- a/app/classes/Framadate/Services/MailService.php +++ b/app/classes/Framadate/Services/MailService.php @@ -39,7 +39,7 @@ class MailService { $headers .= "Auto-Submitted:auto-generated\n"; $headers .= 'Return-Path: <>'; - $body = html_entity_decode($body, ENT_QUOTES, 'UTF-8') . _("\n--\n\n« La route est longue, mais la voie est libre… »\nFramasoft ne vit que par vos dons (déductibles des impôts).\nMerci d'avance pour votre soutien http://soutenir.framasoft.org."); + $body = html_entity_decode($body, ENT_QUOTES, 'UTF-8') . __('Mail', "\n--\n\n« La route est longue, mais la voie est libre… »\nFramasoft ne vit que par vos dons (déductibles des impôts).\nMerci d'avance pour votre soutien http://soutenir.framasoft.org."); mail($to, $subject, $body, $headers, $param); } diff --git a/creation_sondage.php b/creation_sondage.php deleted file mode 100644 index 469ed75..0000000 --- a/creation_sondage.php +++ /dev/null @@ -1,122 +0,0 @@ -Param('id_sondage') ; - $sql = $connect->Prepare($sql); - $poll = $connect->Execute($sql, [$id]); - - if ($poll === false) { - return false; - } - - $dbpoll = $poll->FetchObject(false); - - return $dbpoll->id_sondage; -} - -function ajouter_sondage() -{ - global $connect; - global $config; - - $sondage = random(16); - while(check_poll_id($sondage) == $sondage) { - $sondage = random(16); - } - $sondage_admin = $sondage.random(8); - - $date_fin = $_SESSION["champdatefin"]; // provided by create_classic_poll.php or create_date_poll.php - $_SESSION["champdatefin"]=""; //clean param cause 2 polls created by the same user in the same session can be affected by this param during the 2nd creation. - $sql = 'INSERT INTO sondage - (id_sondage, commentaires, mail_admin, nom_admin, titre, id_sondage_admin, date_fin, format, mailsonde) - VALUES ( - '.$connect->Param('id_sondage').', - '.$connect->Param('commentaires').', - '.$connect->Param('mail_admin').', - '.$connect->Param('nom_admin').', - '.$connect->Param('titre').', - '.$connect->Param('id_sondage_admin').', - FROM_UNIXTIME('.$date_fin.'), - '.$connect->Param('format').', - '.$connect->Param('mailsonde').' - )'; - $sql = $connect->Prepare($sql); - $res = $connect->Execute($sql, array($sondage, $_SESSION['commentaires'], $_SESSION['adresse'], $_SESSION['nom'], $_SESSION['titre'], $sondage_admin, $_SESSION['formatsondage'], $_SESSION['mailsonde'])); - - $sql = 'INSERT INTO sujet_studs values ('.$connect->Param('sondage').', '.$connect->Param('choix').')'; - $sql = $connect->Prepare($sql); - $connect->Execute($sql, array($sondage, $_SESSION['toutchoix'])); - - if($config['use_smtp']==true){ - $message = _("This is the message you have to send to the people you want to poll. \nNow, you have to send this message to everyone you want to poll."); - $message .= "\n\n"; - $message .= stripslashes(html_entity_decode($_SESSION["nom"],ENT_QUOTES,"UTF-8"))." " . _("hast just created a poll called") . " : \"".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES))."\".\n"; - $message .= _("Thanks for filling the poll at the link above") . " :\n\n%s\n\n" . _("Thanks for your confidence.") . "\n".NOMAPPLICATION; - - $message_admin = _("This message should NOT be sent to the polled people. It is private for the poll's creator.\n\nYou can now modify it at the link above"); - $message_admin .= " :\n\n"."%s \n\n" . _("Thanks for your confidence.") . "\n".NOMAPPLICATION; - - $message = sprintf($message, Utils::getUrlSondage($sondage)); - $message_admin = sprintf($message_admin, Utils::getUrlSondage($sondage_admin, true)); - - if (Utils::isValidEmail($_SESSION['adresse'])) { - Utils::sendEmail( "$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("Author's message") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message_admin, $_SESSION['adresse'] ); - Utils::sendEmail( "$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("For sending to the polled users") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message, $_SESSION['adresse'] ); - } - } - error_log(date('H:i:s d/m/Y:') . ' CREATION: '.$sondage."\t".$_SESSION[formatsondage]."\t".$_SESSION[nom]."\t".$_SESSION[adresse]."\t \t".$_SESSION[toutchoix]."\n", 3, 'admin/logs_studs.txt'); - //Utils::cleaning_polls($connect, 'admin/logs_studs.txt'); - - // Don't keep days, hours and choices in memory (in order to make new polls) - for ($i = 0; $i < count($_SESSION["totalchoixjour"]); $i++) { - unset($_SESSION['horaires'.$i]); - } - unset($_SESSION["totalchoixjour"]); - unset($_SESSION['choices']); - - header("Location:".Utils::getUrlSondage($sondage_admin, true)); - - exit(); -} diff --git a/doc/TREEVIEW.md b/doc/TREEVIEW.md index 51444d6..e47a36f 100644 --- a/doc/TREEVIEW.md +++ b/doc/TREEVIEW.md @@ -33,8 +33,6 @@ Here are the main files and directories you need to know in order to develop on * La page de création (2/2) pour un sondage pour déterminer une date * crete_classic_poll.php * La page de création (2/2) pour un sondage sur un sujet quelconque -* creation_sondage.php - * Le fichier qui récupérent les informations des pages précédentes pour procéder à l'insertion du nouveau sondage dans la base PostgreSQL * bandeaux.php * Le fichier contenant tous les bandeaux des pages PHP de l'application * favicon.ico diff --git a/exportcsv.php b/exportcsv.php index 509f6f6..81801df 100644 --- a/exportcsv.php +++ b/exportcsv.php @@ -48,7 +48,7 @@ if (!empty($_GET['poll'])) { } if (!$poll) { - $smarty->assign('error', _('This poll doesn\'t exist !')); + $smarty->assign('error', __('Error', 'This poll doesn\'t exist !')); $smarty->display('error.tpl'); exit; } @@ -86,13 +86,13 @@ foreach ($votes as $vote) { foreach ($choices as $choice) { switch ($choice) { case 0: - $text = _('No'); + $text = __('Generic', 'No'); break; case 1: - $text = _('Ifneedbe'); + $text = __('Generic', 'Ifneedbe'); break; case 2: - $text = _('Yes'); + $text = __('Generic', 'Yes'); break; default: $text = 'unkown'; diff --git a/locale/de.json b/locale/de.json index 5a3512f..1e8e837 100644 --- a/locale/de.json +++ b/locale/de.json @@ -148,7 +148,8 @@ "POLL_LOCKED_WARNING": "Die Administration gesperrt diese Umfrage. Bewertungen und Kommentare werden eingefroren, es ist nicht mehr möglich, teilzunehmen", "The poll is expired, it will be deleted soon.": "Die Umfrage ist abgelaufen, es wird bald gelöscht werden.", "Deletion date:": "Löschdatum:", - "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "DE_Votre vote a bien été pris en compte, mais faites attention : ce sondage n'autorise l'édition de votre vote qu'avec le lien personnalisé suivant ; conservez le précieusement ! " + "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "DE_Votre vote a bien été pris en compte, mais faites attention : ce sondage n'autorise l'édition de votre vote qu'avec le lien personnalisé suivant ; conservez le précieusement ! ", + "Update vote succeeded": "Update Abstimmung gelungen" }, "adminstuds": { "As poll administrator, you can change all the lines of this poll with this button": "Als Administrator der Umfrage, können Sie alle Zeilen der Umfrage über diesen Button ändern", @@ -244,6 +245,7 @@ }, "Admin": { "Back to administration": "Zurück zur Verwaltung", + "Administration": "Verwaltung", "Polls": "Umfragen", "Migration": "Migration", "Purge": "Säuberung", @@ -267,6 +269,7 @@ "Failed:": "fehlgeschlagen:", "Skipped:": "übersprungene:", "Pages:": "Seiten:", + "Purged:": "gespült :", "Confirm removal of the poll": "Bestätigen Sie die Löschung ihrer Umfrage", "polls in the database at this time": "Umfragen derzeit in der Datenbank", "Purge the polls": "TRANSLATE_ Purge the polls" @@ -290,14 +293,17 @@ "Error": { "Error!": "Fehler!", "Enter a title": "Titel eingeben", + "Something is going wrong...": "Etwas falsch läuft...", "Something is wrong with the format": "Something is wrong with the format", "Enter an email address": "Sie müssen eine E-Mail-Adresse eingeben", "The address is not correct! You should enter a valid email address (like r.stallman@outlock.com) in order to receive the link to your poll.": "Die Adresse ist nicht korrekt! Sie sollten eine funktionierende E-Mail-Adresse angeben, um den Link zu ihrer Umfrage zu erhalten", + "There is a problem with your choices": "Es gibt ein Problem mit der Auswahl", "You haven't filled the first section of the poll creation.": "Sie haben den ersten Teil der Umfrageerstellung nicht ausgefüllt.", "Javascript is disabled on your browser. Its activation is required to create a poll.": "Javascript ist in Ihrem Browser deaktiviert. Seine Aktivierung ist erforderlich, um eine Umfrage zu erstellen.", "Cookies are disabled on your browser. Theirs activation is required to create a poll.": "Cookies werden auf Ihrem Browser deaktiviert. Deren Aktivierung ist erforderlich, um eine Umfrage zu erstellen.", "This poll doesn't exist !": "Diese Umfrage existiert nicht!", "Enter a name": "Geben Sie einen Namen ein", + "Name is incorrect": "Name ist falsch", "The name you've chosen already exist in this poll!": "Der von Ihnen eingegebenen Name existiert bereits in dieser Umfrage", "Enter a name and a comment!": "Geben Sie einen Namen und ein Kommentar ein!", "Failed to insert the comment!": "Einfügen des Kommentars gescheitert!", @@ -305,6 +311,7 @@ "Failed to save poll": "Fehlgeschlagen Umfrage sparen", "Update vote failed": "Update vote failed", "Adding vote failed": "Adding vote failed", + "Comment failed": "Kommentar gescheitert", "You can't create a poll with hidden results with the following edition option:": "DE_Vous ne pouvez pas créer de sondage avec résulats cachés avec les options d'éditions suivantes : " } -} \ No newline at end of file +} diff --git a/locale/en.json b/locale/en.json index 5e03ef4..077e01f 100644 --- a/locale/en.json +++ b/locale/en.json @@ -85,7 +85,6 @@ "Remove all the votes": "Remove all the votes", "Print": "Print", "Export to CSV": "Export to CSV", - "Remove the poll": "Remove the poll", "Title": "Title of the poll", "Edit the title": "Edit the title", "Save the new title": "Save the new title", @@ -149,7 +148,8 @@ "POLL_LOCKED_WARNING": "The administration locked this poll. Votes and comments are frozen, it is no longer possible to participate", "The poll is expired, it will be deleted soon.": "The poll is expired, it will be deleted soon.", "Deletion date:": "Deletion date:", - "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote." + "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote.", + "Update vote succeeded": "Update vote succeeded" }, "adminstuds": { "As poll administrator, you can change all the lines of this poll with this button": "As poll administrator, you can change all the lines of this poll with this button", @@ -245,6 +245,7 @@ }, "Admin": { "Back to administration": "Back to administration", + "Administration": "Administration", "Polls": "Polls", "Migration": "Migration", "Purge": "Purge", @@ -268,6 +269,7 @@ "Failed:": "Failed:", "Skipped:": "Skipped:", "Pages:": "Pages:", + "Purged:": "Purged:", "Confirm removal of the poll": "Confirm removal of the poll ", "polls in the database at this time": "polls in the database at this time", "Purge the polls": "Purge the polls" @@ -291,14 +293,17 @@ "Error": { "Error!": "Error!", "Enter a title": "Enter a title", + "Something is going wrong...": "Something is going wrong...", "Something is wrong with the format": "Something is wrong with the format", "Enter an email address": "Enter an email address", "The address is not correct! You should enter a valid email address (like r.stallman@outlock.com) in order to receive the link to your poll.": "The address is not correct! You should enter a valid email address (like r.stallman@outlock.com) in order to receive the link to your poll.", + "There is a problem with your choices": "There is a problem with your choices", "You haven't filled the first section of the poll creation.": "You haven't filled the first section of the poll creation.", "Javascript is disabled on your browser. Its activation is required to create a poll.": "Javascript is disabled on your browser. Its activation is required to create a poll.", "Cookies are disabled on your browser. Theirs activation is required to create a poll.": "Cookies are disabled on your browser. Theirs activation is required to create a poll.", "This poll doesn't exist !": "This poll doesn't exist !", "Enter a name": "Enter a name", + "Name is incorrect": "Name is incorrect", "The name you've chosen already exist in this poll!": "The name you've chosen already exist in this poll!", "Enter a name and a comment!": "Enter a name and a comment!", "Failed to insert the comment!": "Failed to insert the comment!", @@ -306,6 +311,7 @@ "Failed to save poll": "Failed to save poll", "Update vote failed": "Update vote failed", "Adding vote failed": "Adding vote failed", + "Comment failed": "Comment failed", "You can't create a poll with hidden results with the following edition option:": "You can't create a poll with hidden results with the following edition option: " } -} \ No newline at end of file +} diff --git a/locale/es.json b/locale/es.json index 601c291..6bf143e 100644 --- a/locale/es.json +++ b/locale/es.json @@ -148,7 +148,8 @@ "POLL_LOCKED_WARNING": "ES_L'administrateur a verrouillé ce sondage. Les votes et commentaires sont gelés, il n'est plus possible de participer", "The poll is expired, it will be deleted soon.": "ES_Le sondage a expiré, il sera bientôt supprimé.", "Deletion date:": "ES_Date de suppression :", - "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "ES_Votre vote a bien été pris en compte, mais faites attention : ce sondage n'autorise l'édition de votre vote qu'avec le lien personnalisé suivant ; conservez le précieusement ! " + "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "ES_Votre vote a bien été pris en compte, mais faites attention : ce sondage n'autorise l'édition de votre vote qu'avec le lien personnalisé suivant ; conservez le précieusement ! ", + "Update vote succeeded": "ES_Mise à jour du vote réussi" }, "adminstuds": { "As poll administrator, you can change all the lines of this poll with this button": "En calidad de administrador, Usted puede cambiar todas la líneas de este encuesta con este botón", @@ -244,6 +245,7 @@ }, "Admin": { "Back to administration": "ES_Retour à l'administration", + "Administration": "ES_Administration", "Polls": "ES_Sondages", "Migration": "ES_Migration", "Purge": "ES_Purge", @@ -267,6 +269,7 @@ "Failed:": "ES_Échoué:", "Skipped:": "ES_Passé:", "Pages:": "ES_Pages :", + "Purged:": "ES_Purgés :", "Confirm removal of the poll": "Confirmar el borrado dela encuesta", "polls in the database at this time": "encuestas en la basa por el momento", "Purge the polls": "ES_Purger les sondages" @@ -290,14 +293,17 @@ "Error": { "Error!": "Error!", "Enter a title": "Introducza un título", + "Something is going wrong...": "ES_Quelque chose ne va pas...", "Something is wrong with the format": "Something is wrong with the format", "Enter an email address": "Introduzca una dirección electrónica", "The address is not correct! You should enter a valid email address (like r.stallman@outlock.com) in order to receive the link to your poll.": "ES_L'adresse saisie n'est pas correcte ! Il faut une adresse électronique valide (par exemple r.stallman@outlock.com) pour recevoir le lien vers le sondage.", + "There is a problem with your choices": "ES_Il y a un problème avec vos choix", "You haven't filled the first section of the poll creation.": "Usted no habia llenado la primera pagina dela encuesta", "Javascript is disabled on your browser. Its activation is required to create a poll.": "ES_Javascript est désactivé sur votre navigateur. Son activation est requise pour la création d'un sondage.", "Cookies are disabled on your browser. Theirs activation is required to create a poll.": "ES_Les cookies sont désactivés sur votre navigateur. Leur activation est requise pour la création d'un sondage.", "This poll doesn't exist !": "Este encuesta no existe!", "Enter a name": "Introduzca un nombre", + "Name is incorrect": "ES_Le nom est pas correct", "The name you've chosen already exist in this poll!": "El nombre entrado existe ya!", "Enter a name and a comment!": "Introduzca su nombre y un comentario!", "Failed to insert the comment!": "ES_Échec à l'insertion du commentaire !", @@ -305,6 +311,7 @@ "Failed to save poll": "ES_Echèc de la sauvegarde du sondage", "Update vote failed": "ES_Mise à jour du vote échoué", "Adding vote failed": "ES_Ajout d'un vote échoué", + "Comment failed": "ES_Commentaire échoué", "You can't create a poll with hidden results with the following edition option:": "ES_Vous ne pouvez pas créer de sondage avec résulats cachés avec les options d'éditions suivantes : " } -} \ No newline at end of file +} diff --git a/locale/fr.json b/locale/fr.json index 31bb497..bf5f7a9 100644 --- a/locale/fr.json +++ b/locale/fr.json @@ -148,7 +148,8 @@ "POLL_LOCKED_WARNING": "L'administrateur a verrouillé ce sondage. Les votes et commentaires sont gelés, il n'est plus possible de participer", "The poll is expired, it will be deleted soon.": "Le sondage a expiré, il sera bientôt supprimé.", "Deletion date:": "Date de suppression :", - "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "Votre vote a bien été pris en compte, mais faites attention : ce sondage n'autorise l'édition de votre vote qu'avec le lien personnalisé suivant ; conservez le précieusement ! " + "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "Votre vote a bien été pris en compte, mais faites attention : ce sondage n'autorise l'édition de votre vote qu'avec le lien personnalisé suivant ; conservez le précieusement ! ", + "Update vote succeeded": "Mise à jour du vote réussi" }, "adminstuds": { "As poll administrator, you can change all the lines of this poll with this button": "En tant qu'administrateur, vous pouvez modifier toutes les lignes de ce sondage avec ce bouton", @@ -244,6 +245,7 @@ }, "Admin": { "Back to administration": "Retour à l'administration", + "Administration": "Administration", "Polls": "Sondages", "Migration": "Migration", "Purge": "Purge", @@ -267,6 +269,7 @@ "Failed:": "Échoué:", "Skipped:": "Passé:", "Pages:": "Pages :", + "Purged:": "Purgés :", "Confirm removal of the poll": "Confirmer la suppression du sondage", "polls in the database at this time": "sondages dans la base actuellement", "Purge the polls": "Purger les sondages" @@ -290,14 +293,17 @@ "Error": { "Error!": "Erreur !", "Enter a title": "Il faut saisir un titre !", + "Something is going wrong...": "Quelque chose ne va pas...", "Something is wrong with the format": "Quelque chose ne va pas avec le format", "Enter an email address": "Il faut saisir une adresse électronique !", "The address is not correct! You should enter a valid email address (like r.stallman@outlock.com) in order to receive the link to your poll.": "L'adresse saisie n'est pas correcte ! Il faut une adresse électronique valide (par exemple r.stallman@outlock.com) pour recevoir le lien vers le sondage.", + "There is a problem with your choices": "Il y a un problème avec vos choix", "You haven't filled the first section of the poll creation.": "Vous n'avez pas renseigné la première page du sondage", "Javascript is disabled on your browser. Its activation is required to create a poll.": "Javascript est désactivé sur votre navigateur. Son activation est requise pour la création d'un sondage.", "Cookies are disabled on your browser. Theirs activation is required to create a poll.": "Les cookies sont désactivés sur votre navigateur. Leur activation est requise pour la création d'un sondage.", "This poll doesn't exist !": "Ce sondage n'existe pas !", "Enter a name": "Vous n'avez pas saisi de nom !", + "Name is incorrect": "Le nom est pas correct", "The name you've chosen already exist in this poll!": "Le nom que vous avez choisi existe déjà !", "Enter a name and a comment!": "Merci de remplir les deux champs !", "Failed to insert the comment!": "Échec à l'insertion du commentaire !", @@ -305,6 +311,7 @@ "Failed to save poll": "Echèc de la sauvegarde du sondage", "Update vote failed": "Mise à jour du vote échoué", "Adding vote failed": "Ajout d'un vote échoué", + "Comment failed": "Commentaire échoué", "You can't create a poll with hidden results with the following edition option:": "Vous ne pouvez pas créer de sondage avec résulats cachés avec les options d'éditions suivantes : " } } diff --git a/studs.php b/studs.php index 0d360d2..abc3996 100644 --- a/studs.php +++ b/studs.php @@ -66,22 +66,22 @@ function sendUpdateNotification($poll, $mailService, $name, $type) { if ($poll->receiveNewVotes && (!isset($_SESSION['mail_sent'][$poll->id]) || $_SESSION['mail_sent'][$poll->id] !== true)) { - $subject = '[' . NOMAPPLICATION . '] ' . _('Poll\'s participation') . ' : ' . $poll->title; + $subject = '[' . NOMAPPLICATION . '] ' . __('Mail', 'Poll\'s participation') . ' : ' . $poll->title; $message = $name . ' '; switch ($type) { case UPDATE_VOTE: - $message .= _('updated a vote.\nYou can find your poll at the link') . " :\n\n"; + $message .= __('Mail', "updated a vote.\nYou can find your poll at the link") . " :\n\n"; break; case ADD_VOTE: - $message .= _('filled a vote.\nYou can find your poll at the link') . " :\n\n"; + $message .= __('Mail', "filled a vote.\nYou can find your poll at the link") . " :\n\n"; break; case ADD_COMMENT: - $message .= _('wrote a comment.\nYou can find your poll at the link') . " :\n\n"; + $message .= __('Mail', "wrote a comment.\nYou can find your poll at the link") . " :\n\n"; break; } $message .= Utils::getUrlSondage($poll->admin_id, true) . "\n\n"; - $message .= _('Thanks for your confidence.') . "\n" . NOMAPPLICATION; + $message .= __('Mail', 'Thanks for your confidence.') . "\n" . NOMAPPLICATION; $mailService->send($poll->admin_mail, $subject, $message); @@ -100,7 +100,7 @@ if (!empty($_GET['poll'])) { } if (!$poll) { - $smarty->assign('error', _('This poll doesn\'t exist !')); + $smarty->assign('error', __('Error', 'This poll doesn\'t exist !')); $smarty->display('error.tpl'); exit; } @@ -123,10 +123,10 @@ if (!empty($_POST['save'])) { // Save edition of an old vote $choices = $inputService->filterArray($_POST['choices'], FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => CHOICE_REGEX]]); if (empty($editedVote)) { - $message = new Message('danger', _('Something is going wrong...')); + $message = new Message('danger', __('Error', 'Something is going wrong...')); } if (count($choices) != count($_POST['choices'])) { - $message = new Message('danger', _('There is a problem with your choices.')); + $message = new Message('danger', __('Error', 'There is a problem with your choices')); } if ($message == null) { @@ -138,11 +138,11 @@ if (!empty($_POST['save'])) { // Save edition of an old vote $urlEditVote = Utils::getUrlSondage($poll_id, false, $editedVoteUniqId); $message = new Message('success', __('studs', "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:"), $urlEditVote); } else { - $message = new Message('success', _('Update vote successfully.')); + $message = new Message('success', __('studs', 'Update vote succeeded')); } sendUpdateNotification($poll, $mailService, $name, UPDATE_VOTE); } else { - $message = new Message('danger', _('Update vote failed.')); + $message = new Message('danger', __('Error', 'Update vote failed')); } } } elseif (isset($_POST['save'])) { // Add a new vote @@ -150,10 +150,10 @@ if (!empty($_POST['save'])) { // Save edition of an old vote $choices = $inputService->filterArray($_POST['choices'], FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => CHOICE_REGEX]]); if (empty($name)) { - $message = new Message('danger', _('Name is incorrect.')); + $message = new Message('danger', __('Error', 'Name is incorrect')); } if (count($choices) != count($_POST['choices'])) { - $message = new Message('danger', _('There is a problem with your choices.')); + $message = new Message('danger', __('There is a problem with your choices')); } if ($message == null) { @@ -164,11 +164,11 @@ if (!empty($_POST['save'])) { // Save edition of an old vote $urlEditVote = Utils::getUrlSondage($poll_id, false, $result->uniqId); $message = new Message('success', __('studs', "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:"), $urlEditVote); } else { - $message = new Message('success', _('Update vote successfully.')); + $message = new Message('success', __('studs', 'Update vote succeeded')); } sendUpdateNotification($poll, $mailService, $name, ADD_VOTE); } else { - $message = new Message('danger', _('Update vote failed.')); + $message = new Message('danger', __('Error', 'Update vote failed')); } } } @@ -182,17 +182,17 @@ if (isset($_POST['add_comment'])) { $comment = strip_tags($_POST['comment']); if (empty($name)) { - $message = new Message('danger', _('Name is incorrect.')); + $message = new Message('danger', __('Error', 'Name is incorrect')); } if ($message == null) { // Add comment $result = $pollService->addComment($poll_id, $name, $comment); if ($result) { - $message = new Message('success', _('Comment added.')); + $message = new Message('success', __('Comments', 'Comment added')); sendUpdateNotification($poll, $mailService, $name, ADD_COMMENT); } else { - $message = new Message('danger', _('Comment failed.')); + $message = new Message('danger', __('Error', 'Comment failed')); } } @@ -206,7 +206,7 @@ $comments = $pollService->allCommentsByPollId($poll_id); // Assign data to template $smarty->assign('poll_id', $poll_id); $smarty->assign('poll', $poll); -$smarty->assign('title', _('Poll') . ' - ' . $poll->title); +$smarty->assign('title', __('Generic', 'Poll') . ' - ' . $poll->title); $smarty->assign('expired', strtotime($poll->end_date) < time()); $smarty->assign('deletion_date', $poll->end_date + PURGE_DELAY * 86400); $smarty->assign('slots', $poll->format === 'D' ? $pollService->splitSlots($slots) : $slots); diff --git a/tpl/part/poll_hint.tpl b/tpl/part/poll_hint.tpl index 309b2ca..e4c0fc5 100644 --- a/tpl/part/poll_hint.tpl +++ b/tpl/part/poll_hint.tpl @@ -1,11 +1,11 @@ {if $active}

{__('studs', 'If you want to vote in this poll, you have to give your name, choose the values that fit best for you and validate with the plus button at the end of the line.')}

- +
{else}

{__('studs', 'POLL_LOCKED_WARNING')}

- +
{/if} \ No newline at end of file diff --git a/tpl/part/poll_hint_admin.tpl b/tpl/part/poll_hint_admin.tpl index 977152d..8a16d08 100644 --- a/tpl/part/poll_hint_admin.tpl +++ b/tpl/part/poll_hint_admin.tpl @@ -1,7 +1,7 @@
-

{__('adminstuds', 'As poll administrator, you can change all the lines of this poll with this button')} {_('Edit')}, - {__('adminstuds', 'remove a column or a line with')} {_('Remove')} - {__('adminstuds', 'and add a new column with')} {_('Add a column')}.

+

{__('adminstuds', 'As poll administrator, you can change all the lines of this poll with this button')} {__('Generic', 'Edit')}, + {__('adminstuds', 'remove a column or a line with')} {__('Generic', 'Remove')} + {__('adminstuds', 'and add a new column with')} {__('adminstuds', 'Add a column')}.

{__('adminstuds', 'Finally, you can change the informations of this poll like the title, the comments or your email address.')}

\ No newline at end of file