From e53916dd0622e3db61d6a05ad0fe69e8d7c7f11a Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Thu, 15 Jan 2009 09:30:15 +0000 Subject: Simplifying the way t() is called. Refactoring localization function t($message, $options=array()) into 2 separate functions: - the new t($message, $options=array()) is for simple strings, optionally with placeholder interpolation. - t2($singular, $plural, $count, $options=array()) is for plurals. --- modules/comment/controllers/admin_comments.php | 24 ++++++++++++------------ modules/comment/views/admin_comments.html.php | 12 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'modules') diff --git a/modules/comment/controllers/admin_comments.php b/modules/comment/controllers/admin_comments.php index f8dfa8ee..d1666d41 100644 --- a/modules/comment/controllers/admin_comments.php +++ b/modules/comment/controllers/admin_comments.php @@ -29,27 +29,27 @@ class Admin_Comments_Controller extends Admin_Controller { $view->content->menu = Menu::factory("root") ->append(Menu::factory("link") ->id("unpublished") - ->label(t(array("one" => "Awaiting Moderation ({{count}})", - "other" => "Awaiting Moderation ({{count}})"), - array("count" => $view->content->unpublished->count()))) + ->label(t2("Awaiting Moderation ({{count}})", + "Awaiting Moderation ({{count}})", + $view->content->unpublished->count())) ->url(url::site("admin/comments/queue/unpublished"))) ->append(Menu::factory("link") ->id("published") - ->label(t(array("one" => "Approved ({{count}})", - "other" => "Approved ({{count}})"), - array("count" => $view->content->published->count()))) + ->label(t2("Approved ({{count}})", + "Approved ({{count}})", + $view->content->published->count())) ->url(url::site("admin/comments/queue/published"))) ->append(Menu::factory("link") ->id("spam") - ->label(t(array("one" => "Spam ({{count}})", - "other" => "Spam ({{count}})"), - array("count" => $view->content->spam->count()))) + ->label(t2("Spam ({{count}})", + "Spam ({{count}})", + $view->content->spam->count())) ->url(url::site("admin/comments/queue/spam"))) ->append(Menu::factory("link") ->id("deleted") - ->label(t(array("one" => "Recently Deleted ({{count}})", - "other" => "Recently Deleted ({{count}})"), - array("count" => $view->content->deleted->count()))) + ->label(t2("Recently Deleted ({{count}})", + "Recently Deleted ({{count}})", + $view->content->deleted->count())) ->url(url::site("admin/comments/queue/deleted"))); return $view; } diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php index 9ef52720..83672bc1 100644 --- a/modules/comment/views/admin_comments.html.php +++ b/modules/comment/views/admin_comments.html.php @@ -51,16 +51,16 @@
0): ?>

- "Gallery has caught {{count}} spam for you since you installed spam filtering.", - "other" => "Gallery has caught {{count}} spam for you since you installed spam filtering."), - array("count" => $spam_caught)) ?> +

count()): ?> - "There is currently one comment in your spam queue. You can delete it with a single click, but there is no undo operation so you may want to check the message first to make sure that it really is spam.", - "other" => "There are currently {{count}} comments in your spam queue. You can delete them all with a single click, but there is no undo operation so you may want to check the messages first to make sure that they really are spam. All spam messages will be deleted after 7 days automatically."), - array("count" => $spam->count())) ?> + count()) ?>

-- cgit v1.2.3