diff --git a/app/inc/i18n.php b/app/inc/i18n.php index a7de10d..dde6247 100644 --- a/app/inc/i18n.php +++ b/app/inc/i18n.php @@ -39,11 +39,11 @@ if (isset($_POST['lang']) && is_string($_POST['lang']) && in_array($_POST['lang' $html_lang = substr($locale, 0, 2); /* Date Format */ -$date_format['txt_full'] = _('%A, den %e. %B %Y'); //summary in choix_date.php and removal date in choix_(date|autre).php -$date_format['txt_short'] = _('%A %e %B %Y'); // radio title -$date_format['txt_day'] = _('%a %e'); -$date_format['txt_date'] = _('%Y-%m-%d'); -$date_format['txt_year_month'] = _('%B %Y'); +$date_format['txt_full'] = __('Date\\FULL'); //summary in choix_date.php and removal date in choix_(date|autre).php +$date_format['txt_short'] = __('Date\\SHORT'); // radio title +$date_format['txt_day'] = __('Date\\DAY'); +$date_format['txt_date'] = __('Date\\DATE'); +$date_format['txt_month_year'] = __('Date\\MONTH_YEAR'); if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { //%e can't be used on Windows platform, use %#d instead foreach ($date_format as $k => $v) { $date_format[$k] = preg_replace('#(?title) || empty($_SESSION['form']->admin_name) || (($config['use_smtp']) ? empty($_SESSION['form']->admin_mail) : false)) { - Utils::print_header(_("Error!")); - bandeau_titre(_("Error!")); + Utils::print_header(__("Error!")); + bandeau_titre(__("Error!")); echo '
-

' . _('You haven\'t filled the first section of the poll creation.') . ' !

-

' . _('Back to the homepage of') . ' ' . NOMAPPLICATION . '

+

' . __('You haven\'t filled the first section of the poll creation.') . ' !

+

' . __('Back to the homepage of') . ' ' . NOMAPPLICATION . '

' . "\n"; bandeau_pied(); @@ -96,20 +96,20 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || ( // Send confirmation by mail if enabled 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 = __("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['form']->admin_name, ENT_QUOTES, "UTF-8")) . ' ' . _('hast just created a poll called') . ' : "' . stripslashes(htmlspecialchars_decode($_SESSION['form']->title, 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 .= stripslashes(html_entity_decode($_SESSION['form']->admin_name, ENT_QUOTES, "UTF-8")) . ' ' . __('hast just created a poll called') . ' : "' . stripslashes(htmlspecialchars_decode($_SESSION['form']->title, 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_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($poll_id)); $message_admin = sprintf($message_admin, Utils::getUrlSondage($admin_poll_id, true)); if ($mailService->isValidEmail($_SESSION['form']->admin_mail)) { - $mailService->send($_SESSION['form']->admin_mail, '[' . NOMAPPLICATION . '][' . _('Author\'s message') . '] ' . _('Poll') . ' : ' . stripslashes(htmlspecialchars_decode($_SESSION['form']->title, ENT_QUOTES)), $message_admin); - $mailService->send($_SESSION['form']->admin_mail, '[' . NOMAPPLICATION . '][' . _('For sending to the polled users') . '] ' . _('Poll') . ' : ' . stripslashes(htmlspecialchars_decode($_SESSION['form']->title, ENT_QUOTES)), $message); + $mailService->send($_SESSION['form']->admin_mail, '[' . NOMAPPLICATION . '][' . __('Author\'s message') . '] ' . __('Poll') . ' : ' . stripslashes(htmlspecialchars_decode($_SESSION['form']->title, ENT_QUOTES)), $message_admin); + $mailService->send($_SESSION['form']->admin_mail, '[' . NOMAPPLICATION . '][' . __('For sending to the polled users') . '] ' . __('Poll') . ' : ' . stripslashes(htmlspecialchars_decode($_SESSION['form']->title, ENT_QUOTES)), $message); } } @@ -125,8 +125,8 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || ( } // Step 3/4 : Confirm poll creation and choose a removal date else if (isset($_POST['fin_sondage_autre'])) { - Utils::print_header(_('Removal date and confirmation (3 on 3)')); - bandeau_titre(_('Removal date and confirmation (3 on 3)')); + Utils::print_header(__('Step 3\\Removal date and confirmation (3 on 3)')); + bandeau_titre(__('Step 3\\Removal date and confirmation (3 on 3)')); // Store choices in $_SESSION @@ -153,17 +153,17 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || ( preg_match_all('/\[(.*?)\]\((.*?)\)/', $choice->getName(), $md_a); // Markdown [text](href) if (isset($md_a_img[2][0]) && $md_a_img[2][0] != '' && isset($md_a_img[3][0]) && $md_a_img[3][0] != '') { // [![alt](src)](href) - $li_subject_text = (isset($md_a_img[1][0]) && $md_a_img[1][0] != '') ? stripslashes($md_a_img[1][0]) : _('Choice') . ' ' . ($i + 1); + $li_subject_text = (isset($md_a_img[1][0]) && $md_a_img[1][0] != '') ? stripslashes($md_a_img[1][0]) : __('Generic\\Choice') . ' ' . ($i + 1); $li_subject_html = '' . $li_subject_text . ''; } elseif (isset($md_img[2][0]) && $md_img[2][0] != '') { // ![alt](src) - $li_subject_text = (isset($md_img[1][0]) && $md_img[1][0] != '') ? stripslashes($md_img[1][0]) : _('Choice') . ' ' . ($i + 1); + $li_subject_text = (isset($md_img[1][0]) && $md_img[1][0] != '') ? stripslashes($md_img[1][0]) : __('Generic\\Choice') . ' ' . ($i + 1); $li_subject_html = '' . $li_subject_text . ''; } elseif (isset($md_a[2][0]) && $md_a[2][0] != '') { // [text](href) - $li_subject_text = (isset($md_a[1][0]) && $md_a[1][0] != '') ? stripslashes($md_a[1][0]) : _('Choice') . ' ' . ($i + 1); + $li_subject_text = (isset($md_a[1][0]) && $md_a[1][0] != '') ? stripslashes($md_a[1][0]) : __('Generic\\Choice') . ' ' . ($i + 1); $li_subject_html = '' . $li_subject_text . ''; } else { // text only @@ -184,33 +184,33 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || (
-

' . _('List of your choices') . '

+

' . __('Step 3\\List of your choices') . '

' . $summary . '
-

' . _('Your poll will be automatically removed after') . ' ' . $config['default_poll_duration'] . ' ' . _('days') . '.
' . _('You can set a closer removal date for it.') . '

+

' . __('Step 3\\Your poll will be automatically removed after') . ' ' . $config['default_poll_duration'] . ' ' . __('Generic\\days') . '.
' . __('Step 3\\You can set a closer removal date for it.') . '

- +
- +
- ' . _('(dd/mm/yyyy)') . ' + ' . __('Date\\dd/mm/yyyy') . '
-

' . _('Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll.') . '

'; +

' . __('Step 3\\Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll.') . '

'; if ($config['use_smtp'] == true) { echo ' -

' . _('Then, you will receive quickly two emails: one contening the link of your poll for sending it to the voters, the other contening the link to the administration page of your poll.') . '

'; +

' . __('Step 3\\Then, you will receive quickly two emails: one contening the link of your poll for sending it to the voters, the other contening the link to the administration page of your poll.') . '

'; } echo '

- - + +

@@ -220,8 +220,8 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || ( // Step 2/4 : Select choices of the poll } else { - Utils::print_header(_('Poll subjects (2 on 3)')); - bandeau_titre(_('Poll subjects (2 on 3)')); + Utils::print_header(__('Step 2 classic\\Poll subjects (2 on 3)')); + bandeau_titre(__('Step 2 classic\\Poll subjects (2 on 3)')); echo '
@@ -229,10 +229,10 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || (
'; echo '
-

' . _("To make a generic poll you need to propose at least two choices between differents subjects.") . '

-

' . _("You can add or remove additional choices with the buttons") . ' ' . _("Remove") . ' ' . _("Add") . '

'; +

' . __('Step 2 classic\\To make a generic poll you need to propose at least two choices between differents subjects.') . '

+

' . __('Step 2 classic\\You can add or remove additional choices with the buttons') . ' ' . __('Generic\\Remove') . ' ' . __('Generic\\Add') . '

'; if ($config['user_can_add_img_or_link']) { - echo '

' . _("It's possible to propose links or images by using ") . '' . _("the Markdown syntax") . '.

'; + echo '

' . __('Step 2 classic\\It\'s possible to propose links or images by using') . ' ' . __('Step 2 classic\\the Markdown syntax') . '.

'; } echo '
' . "\n"; @@ -243,11 +243,11 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || ( $choice = isset($choices[$i]) ? $choices[$i] : new Choice(); echo '
- +
'; if ($config['user_can_add_img_or_link']) { - echo ' '; + echo ' '; } echo '
@@ -257,13 +257,13 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || ( echo '
- - + +
- ' . _('Back') . ' - + ' . __('Generic\\Back') . ' +
@@ -271,27 +271,27 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || ( diff --git a/choix_date.php b/choix_date.php index d444d4b..abfaecb 100644 --- a/choix_date.php +++ b/choix_date.php @@ -196,7 +196,7 @@ if (!isset($_SESSION['form']->title) || !isset($_SESSION['form']->admin_name) || - '. __("Date\\(dd/mm/yyyy)") .' + ('. __("Date\\dd/mm/yyyy") .')
@@ -245,7 +245,7 @@ if (!isset($_SESSION['form']->title) || !isset($_SESSION['form']->admin_name) ||
- '. __('Date\\(dd/mm/yyyy)') .' + ('. __('Date\\dd/mm/yyyy') .') '."\n"; // Fields hours : 3 by default diff --git a/locale/de.json b/locale/de.json index bb67bb0..2935976 100644 --- a/locale/de.json +++ b/locale/de.json @@ -18,7 +18,6 @@ "Description": "Beschreibung", "Back to the homepage of": "Zurück zur Homepage von ", "Error!": "Fehler!", - "(dd/mm/yyyy)": "(tt/mm/jjjj)", "dd/mm/yyyy": "tt/mm/jjjj", "%A, den %e. %B %Y": "%A %e %B %Y", "Expiration's date": "Verfallsdatum" diff --git a/locale/en.json b/locale/en.json index 73d8aa5..a8ad751 100644 --- a/locale/en.json +++ b/locale/en.json @@ -18,7 +18,6 @@ "Description": "Description", "Back to the homepage of": "Back to the homepage of", "Error!": "Error!", - "(dd/mm/yyyy)": "(dd/mm/yyyy)", "dd/mm/yyyy": "dd/mm/yyyy", "%A, den %e. %B %Y": "%A, den %e. %B %Y", "days": "days", diff --git a/locale/fr.json b/locale/fr.json index 32429b9..21c277f 100644 --- a/locale/fr.json +++ b/locale/fr.json @@ -32,12 +32,18 @@ "Date": "Date", "Classic": "Classique", "Page generated in": "Page généré en", - "secondes": "secondes" + "secondes": "secondes", + "Choice": "Choix", + "Link": "Lien" }, "Date" : { - "(dd/mm/yyyy)": "(jj/mm/aaaa)", "dd/mm/yyyy": "jj/mm/aaaa", - "%A, den %e. %B %Y": "%A %e %B %Y" + "%A, den %e. %B %Y": "%A %e %B %Y", + "FULL": "%A, den %e. %B %Y", + "SHORT": "%A %e %B %Y", + "DAY": "%a %e", + "DATE": "%Y-%m-%d", + "MONTH_YEAR": "%B %Y" }, "Language selector": { "Select the language": "Choisir la langue", @@ -116,12 +122,11 @@ }, "Poll results": { "Votes of the poll": "Votes du sondage", - "Remove the column": "Effacer la colonne", "Edit the line:": "Modifier la ligne :", "Remove the line:": "Supprimer la ligne :", - "Vote no for ": "Voter « non » pour ", - "Vote yes for ": "Voter « oui » pour ", - "Vote ifneedbe for ": "Voter « Si nécessaire » pour ", + "Vote no for": "Voter « non » pour", + "Vote yes for": "Voter « oui » pour", + "Vote ifneedbe for": "Voter « Si nécessaire » pour", "Save the choices": "Enregister les choix", "Addition": "Somme", "Best choice": "Meilleur choix", @@ -165,6 +170,7 @@ "All votes deleted": "Tous les votes ont été supprimés", "Back to the poll": "Retour au sondage", "Add a column": "Ajouter une colonne", + "Remove the column": "Effacer la colonne", "Choice added": "Choix ajouté", "Confirm removal of all votes of the poll": "Confirmer la suppression de tous les votes de ce sondage", "Keep the votes": "Garder les votes", @@ -206,13 +212,11 @@ "Poll subjects (2 on 3)": "Choix des sujets (2 sur 3)", "To make a generic poll you need to propose at least two choices between differents subjects.": "Pour créer un sondage classique, vous devez proposer au moins deux choix différents.", "You can add or remove additional choices with the buttons": "Vous pouvez ajouter ou supprimer des choix supplémentaires avec les boutons", - "It's possible to propose links or images by using ": "Il est possible d’insérer des liens ou des images en utilisant ", + "It's possible to propose links or images by using": "Il est possible d’insérer des liens ou des images en utilisant ", "the Markdown syntax": "la syntaxe Markdown", - "Choice": "Choix", "Add a link or an image": "Ajouter un lien ou une image", "These fields are optional. You can add a link, an image or both.": "Ces champs sont facultatifs. Vous pouvez ajouter un lien, une image ou les deux.", "URL of the image": "URL de l'image", - "Link": "Lien", "Alternative text": "Texte alternatif", "Remove a choice": "Supprimer le dernier choix", "Add a choice": "Ajouter un choix" @@ -225,7 +229,7 @@ "Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll.": "Une fois que vous aurez confirmé la création du sondage, vous serez redirigé automatiquement vers la page d'administration de votre sondage.", "Then, you will receive quickly two emails: one contening the link of your poll for sending it to the voters, the other contening the link to the administration page of your poll.": "En même temps, vous recevrez deux courriels : l'un contenant le lien vers votre sondage pour le faire suivre aux futurs sondés, l'autre contenant le lien vers la page d'administraion du sondage.", "Create the poll": "Créer le sondage", - "Your poll will be automatically removed ": "Votre sondage sera automatiquement effacé ", + "Your poll will be automatically removed after": "Votre sondage sera automatiquement effacé après", "after the last date of your poll:": "après la date la plus tardive :", "You can set a closer removal date for it.": "Vous pouvez décider d'une date de suppression plus proche.", "Removal date:": "Date de suppression :" diff --git a/tpl/add_slot.tpl b/tpl/add_slot.tpl index 9f634bc..be359ca 100644 --- a/tpl/add_slot.tpl +++ b/tpl/add_slot.tpl @@ -13,7 +13,7 @@ - {__('Date\\(dd/mm/yyyy)')} + ({__('Date\\dd/mm/yyyy')})
diff --git a/tpl/part/vote_table_classic.tpl b/tpl/part/vote_table_classic.tpl index 35ef7cb..e36559d 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -14,11 +14,11 @@ {foreach $slots as $id=>$slot} - + {/foreach} - + {/if} @@ -40,7 +40,7 @@
- +
@@ -50,26 +50,26 @@ {/foreach} - + {else} {* Voted line *} @@ -79,23 +79,23 @@ {foreach $vote->choices as $id=>$choice} {if $choice==2} - {__('Yes')} + {__('Generic\\Yes')} {elseif $choice==1} - (){__('Ifneedbe')} + (){__('Generic\\Ifneedbe')} {else} - {__('No')} + {__('Generic\\No')} {/if} {/foreach} {if $active && $poll->editable && !$expired} - {if $admin} - {/if} @@ -113,7 +113,7 @@
- +
{foreach $slots as $id=>$slot} @@ -121,26 +121,26 @@ {/foreach} - + {/if} @@ -149,13 +149,15 @@ {$max = max($best_choices)} {if $max > 0} - {__("Addition")} + {__('Poll results\\Addition')} {foreach $best_choices as $best_choice} {if $max == $best_choice} {$count_bests = $count_bests +1} {$best_choice|html} - {else} + {elseif $best_choice > 0} {$best_choice|html} + {else} + {/if} {/foreach} @@ -171,13 +173,13 @@ {if $max > 0}
{if $count_bests == 1} -

{__("Best choice")}

+

{__('Poll results\\Best choice')}

-

{__('The best choice at this time is:')}

+

{__('Poll results\\The best choice at this time is:')}

{elseif $count_bests > 1} -

{__("Best choices")}

+

{__('Poll results\\Best choices')}

-

{__('The bests choices at this time are:')}

+

{__('Poll results\\The bests choices at this time are:')}

{/if} @@ -190,7 +192,7 @@ {$i = $i+1} {/foreach} -

{__('with')} {$max|html} {if $max==1}{__('vote')}{else}{__('votes')}{/if}.

+

{__('Generic\\with')} {$max|html} {if $max==1}{__('Generic\\vote')}{else}{__('Generic\\votes')}{/if}.

{/if} \ No newline at end of file diff --git a/tpl/part/vote_table_date.tpl b/tpl/part/vote_table_date.tpl index c5ce39f..feb071f 100644 --- a/tpl/part/vote_table_date.tpl +++ b/tpl/part/vote_table_date.tpl @@ -16,13 +16,13 @@ {foreach $slots as $slot} {foreach $slot->moments as $id=>$moment} - + {$headersDCount = $headersDCount+1} {/foreach} {/foreach} - + {/if} @@ -31,7 +31,7 @@ {$count_same = 0} {$previous = 0} {foreach $slots as $id=>$slot} - {$display = $slot->day|date_format:$date_format.txt_year_month|html} + {$display = $slot->day|date_format:$date_format.txt_month_year|html} {if $previous !== 0 && $previous != $display} {$previous} {$count_same = 0} @@ -64,11 +64,13 @@ {$headersDCount=0} + {$slots_raw = array()} {foreach $slots as $slot} {foreach $slot->moments as $id=>$moment} {$moment|html} {append var='headersH' value=$headersDCount} {$headersDCount = $headersDCount+1} + {$slots_raw[] = $slot->day|date_format:$date_format.txt_full|cat:' - '|cat:$moment} {/foreach} {/foreach} @@ -94,19 +96,19 @@
  • -
  • -
  • -
  • @@ -167,19 +169,19 @@
    • -
    • -
    • -
    • @@ -202,8 +204,10 @@ {if $max == $best_moment} {$count_bests = $count_bests +1} {$best_moment|html} - {else} + {elseif $best_moment > 0} {$best_moment|html} + {else} + {/if} {/foreach}