From 659cf997b898e051d148363fd8a80e4ca5c94974 Mon Sep 17 00:00:00 2001 From: Olivier PEREZ Date: Tue, 24 Mar 2015 00:22:37 +0100 Subject: [PATCH] Change i18n system in admin pages --- admin/logs.php | 3 +++ admin/migration.php | 2 +- admin/polls.php | 2 ++ admin/purge.php | 2 ++ locale/fr.json | 22 ++++++++++++++++------ tpl/admin/admin_page.tpl | 2 +- tpl/admin/index.tpl | 8 ++++---- tpl/admin/migration.tpl | 18 +++++++++--------- tpl/admin/polls.tpl | 34 +++++++++++++++++----------------- tpl/admin/purge.tpl | 2 +- 10 files changed, 56 insertions(+), 39 deletions(-) diff --git a/admin/logs.php b/admin/logs.php index e4be44d..ca60653 100644 --- a/admin/logs.php +++ b/admin/logs.php @@ -25,4 +25,7 @@ $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/migration.php b/admin/migration.php index e19f4d5..4d3f042 100644 --- a/admin/migration.php +++ b/admin/migration.php @@ -102,6 +102,6 @@ $smarty->assign('countSkipped', $countSkipped); $smarty->assign('countTotal', $countTotal); $smarty->assign('time', $total_time = round((microtime(true)-$_SERVER['REQUEST_TIME_FLOAT']), 4)); -$smarty->assign('title', _('Migration')); +$smarty->assign('title', __('Admin\\Migration')); $smarty->display('admin/migration.tpl'); diff --git a/admin/polls.php b/admin/polls.php index d2a617b..bec7daa 100644 --- a/admin/polls.php +++ b/admin/polls.php @@ -75,4 +75,6 @@ $smarty->assign('pages', ceil($count / POLLS_PER_PAGE)); $smarty->assign('poll_to_delete', $poll_to_delete); $smarty->assign('crsf', $securityService->getToken('admin')); +$smarty->assign('title', __('Admin\\Polls')); + $smarty->display('admin/polls.tpl'); diff --git a/admin/purge.php b/admin/purge.php index b97dcb2..a799256 100644 --- a/admin/purge.php +++ b/admin/purge.php @@ -53,4 +53,6 @@ if ($action === 'purge' && $securityService->checkCsrf('admin', $_POST['csrf'])) $smarty->assign('message', $message); $smarty->assign('crsf', $securityService->getToken('admin')); +$smarty->assign('title', __('Admin\\Purge')); + $smarty->display('admin/purge.tpl'); \ No newline at end of file diff --git a/locale/fr.json b/locale/fr.json index ae5fc78..32429b9 100644 --- a/locale/fr.json +++ b/locale/fr.json @@ -28,7 +28,11 @@ "Yes": "Oui", "Ifneedbe": "Si nécessaire", "No": "Non", - "Legend:": "Légende :" + "Legend:": "Légende :", + "Date": "Date", + "Classic": "Classique", + "Page generated in": "Page généré en", + "secondes": "secondes" }, "Date" : { "(dd/mm/yyyy)": "(jj/mm/aaaa)", @@ -151,7 +155,7 @@ "You can add a new scheduling date to your poll.": "Vous pouvez ajouter une date à votre sondage.", "If you just want to add a new hour to an existant date, put the same date and choose a new hour.": "Si vous voulez juste ajouter un horaire à une date existante, mettez la même date et choisissez un autre horaire. Il sera intégré normalement au sondage existant.", "Confirm removal of the poll": "Confirmer la suppression du sondage", - "Remove the poll": "Je supprime le sondage", + "Delete the poll": "Je supprime le sondage", "Keep the poll": "Je garde le sondage", "Your poll has been removed!": "Votre sondage a été supprimé !", "Poll saved": "Sondage sauvegardé", @@ -227,19 +231,22 @@ "Removal date:": "Date de suppression :" }, "Admin": { + "Back to administration": "Retour à l'administration", "Polls": "Sondages", "Migration": "Migration", - "Confirm removal of the poll": "Confirmer la suppression du sondage", - "polls in the database at this time": "sondages dans la base actuellement", + "Purge": "Purge", + "Logs": "Historique", "Poll ID": "ID sondage", "Format": "Format", "Title": "Titre", "Author": "Auteur", + "Email": "Courriel", + "Expiration date": "Date d'expiration", "Users": "Utilisateurs", "Actions": "Actions", "See the poll": "Voir le sondage", "Change the poll": "Modifier le sondage", - "Logs": "Historique", + "Deleted the poll": "Supprimer le sondage", "Summary": "Résumé", "Success": "Réussite", "Fail": "Échèc", @@ -247,7 +254,10 @@ "Succeeded:": "Réussit:", "Failed:": "Échoué:", "Skipped:": "Passé:", - "Pages:": "Pages :" + "Pages:": "Pages :", + "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" }, "Mail": { "Poll's participation": "Participation au sondage", diff --git a/tpl/admin/admin_page.tpl b/tpl/admin/admin_page.tpl index 2fb2f77..9dc1e27 100644 --- a/tpl/admin/admin_page.tpl +++ b/tpl/admin/admin_page.tpl @@ -3,7 +3,7 @@ {block 'main'}
{block 'admin_main'}{/block} diff --git a/tpl/admin/index.tpl b/tpl/admin/index.tpl index a2453d3..2f3fa8a 100644 --- a/tpl/admin/index.tpl +++ b/tpl/admin/index.tpl @@ -3,17 +3,17 @@ {block 'main'}
{if $logsAreReadable} {/if}
diff --git a/tpl/admin/migration.tpl b/tpl/admin/migration.tpl index 1d904bf..601885b 100644 --- a/tpl/admin/migration.tpl +++ b/tpl/admin/migration.tpl @@ -3,37 +3,37 @@ {block 'admin_main'}
-

{_('Summary')}

- {_('Succeeded:')} {$countSucceeded|html} / {$countTotal|html} +

{__('Admin\\Summary')}

+ {__('Admin\\Succeeded:')} {$countSucceeded|html} / {$countTotal|html}
- {_('Failed:')} {$countFailed|html} / {$countTotal|html} + {__('Admin\\Failed:')} {$countFailed|html} / {$countTotal|html}
- {_('Skipped:')} {$countSkipped|html} / {$countTotal|html} + {__('Admin\\Skipped:')} {$countSkipped|html} / {$countTotal|html}
-

{_('Success')}

+

{__('Admin\\Success')}

    {foreach $success as $s}
  • {$s|html}
  • {foreachelse} -
  • {_('Nothing')}
  • +
  • {__('Admin\\Nothing')}
  • {/foreach}
-

{_('Fail')}

+

{__('Admin\\Fail')}

    {foreach $fail as $f}
  • {$f|html}
  • {foreachelse} -
  • {_('Nothing')}
  • +
  • {__('Admin\\Nothing')}
  • {/foreach}
- {_('Page generated in')} {$time} {_('secondes')} + {__('Generic\\Page generated in')} {$time} {__('Generic\\secondes')}
{/block} \ No newline at end of file diff --git a/tpl/admin/polls.tpl b/tpl/admin/polls.tpl index 9da7819..53bd529 100644 --- a/tpl/admin/polls.tpl +++ b/tpl/admin/polls.tpl @@ -5,41 +5,41 @@ {if $poll_to_delete}
-

{_("Confirm removal of the poll ")}"{$poll_to_delete->id|html}"

+

{__('adminstuds\\Confirm removal of the poll')} "{$poll_to_delete->id|html}"

+ name="annullesuppression">{__('adminstuds\\Keep the poll')} + class="btn btn-danger">{__('adminstuds\\Delete the poll')}

{/if}
- {$polls|count} / {$count} {_('polls in the database at this time')} + {$polls|count} / {$count} {__('Admin\\polls in the database at this time')}
- - - - - - - + + + + + + + {foreach $polls as $poll} @@ -53,15 +53,15 @@ {/if} - - - + + + {/foreach}
{_('Title')}{_('Author')}{_('Email')}{_('Expiration\'s date')}{_('Users')}{_('Poll ID')}{_('Actions')}{__('Admin\\Title')}{__('Admin\\Author')}{__('Admin\\Email')}{__('Admin\\Expiration date')}{__('Admin\\Users')}{__('Admin\\Poll ID')}{__('Admin\\Actions')}
{if $poll->format === 'D'} - {_('Date')} + {__('Generic\\Date')} {else} - {_('Classic')} + {__('Generic\\Classic')} {/if} {$poll->title|html}{$poll->votes|html} {$poll->id|html}{_('See the poll')}{_('Change the poll')}{__('Admin\\See the poll')}{__('Admin\\Change the poll')}
- {_('Pages:')} + {__('Admin\\Pages:')} {for $p=1 to $pages} {if $p===$page} {$p} diff --git a/tpl/admin/purge.tpl b/tpl/admin/purge.tpl index d36553d..0c6b78c 100644 --- a/tpl/admin/purge.tpl +++ b/tpl/admin/purge.tpl @@ -7,7 +7,7 @@
- +
{/block} \ No newline at end of file