summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-01-15 09:30:15 +0000
committerAndy Staudacher <andy.st@gmail.com>2009-01-15 09:30:15 +0000
commite53916dd0622e3db61d6a05ad0fe69e8d7c7f11a (patch)
treedd7b6c0bbb6884341691189e98451f90870b6c35 /modules
parent0bbde9e059c51fe61c92d23f9f6a4518b2fb1a8c (diff)
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.
Diffstat (limited to 'modules')
-rw-r--r--modules/comment/controllers/admin_comments.php24
-rw-r--r--modules/comment/views/admin_comments.html.php12
2 files changed, 18 insertions, 18 deletions
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 @@
<div>
<? if ($spam_caught > 0): ?>
<p>
- <?= t(array("one" => "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)) ?>
+ <?= t2("Gallery has caught {{count}} spam for you since you installed spam filtering.",
+ "Gallery has caught {{count}} spam for you since you installed spam filtering.",
+ $spam_caught) ?>
</p>
<? endif ?>
<p>
<? if ($spam->count()): ?>
- <?= t(array("one" => "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())) ?>
+ <?= t2("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.",
+ "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.",
+ $spam->count()) ?>
</p>
<p>
<a href="<?= url::site("admin/comments/delete_all_spam?csrf=" . access::csrf_token()) ?>">