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. --- core/controllers/admin_maintenance.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'core/controllers') diff --git a/core/controllers/admin_maintenance.php b/core/controllers/admin_maintenance.php index 3eec16fc..1c9b4164 100644 --- a/core/controllers/admin_maintenance.php +++ b/core/controllers/admin_maintenance.php @@ -30,9 +30,9 @@ class Admin_Maintenance_Controller extends Admin_Controller { "callback" => "graphics::rebuild_dirty_images", "description" => ( $dirty_count ? - t(array("one" => "You have one image which is out of date", - "other" => "You have {{count}} out-of-date images"), - array("count" => $dirty_count)) + t2("You have one image which is out of date", + "You have {{count}} out-of-date images", + $dirty_count) : t("All your images are up to date")), "severity" => $dirty_count ? log::WARNING : log::SUCCESS), ArrayObject::ARRAY_AS_PROPS)); @@ -50,9 +50,9 @@ class Admin_Maintenance_Controller extends Admin_Controller { $stalled_count = $query->count(); if ($stalled_count) { log::warning("tasks", - t(array("one" => "One task is stalled", - "other" => "{{count}} tasks are stalled"), - array("count" => $stalled_count)), + t2("One task is stalled", + "{{count}} tasks are stalled", + $stalled_count), t("{{link_start}}view{{link_end}}", array("link_start" => "", "link_start" => ""))); -- cgit v1.2.3