diff options
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/controllers/admin_comments.php | 27 | ||||
-rw-r--r-- | modules/comment/helpers/comment.php | 24 | ||||
-rw-r--r-- | modules/comment/helpers/comment_block.php | 4 | ||||
-rw-r--r-- | modules/comment/helpers/comment_menu.php | 4 | ||||
-rw-r--r-- | modules/comment/views/admin_block_recent_comments.html.php | 5 | ||||
-rw-r--r-- | modules/comment/views/admin_comments.html.php | 31 | ||||
-rw-r--r-- | modules/comment/views/comment.html.php | 4 | ||||
-rw-r--r-- | modules/comment/views/comments.html.php | 4 |
8 files changed, 57 insertions, 46 deletions
diff --git a/modules/comment/controllers/admin_comments.php b/modules/comment/controllers/admin_comments.php index 7c88c1d9..9d7e1222 100644 --- a/modules/comment/controllers/admin_comments.php +++ b/modules/comment/controllers/admin_comments.php @@ -33,42 +33,47 @@ class Admin_Comments_Controller extends Admin_Controller { $view->content->menu = Menu::factory("root") ->append(Menu::factory("link") ->id("all") - ->label(sprintf(_("All Comments (%d)"), - $view->content->all->count())) + ->label(t(array("one" => "All Comments ({{count}})", + "other" => "All Comments ({{count}})"), + array("count" => $view->content->all->count()))) ->url(url::site("admin/comments/queue/all"))) ->append(Menu::factory("link") ->id("unpublished") - ->label(sprintf(_("Awaiting Moderation (%d)"), - $view->content->unpublished->count())) + ->label(t(array("one" => "Awaiting Moderation ({{count}})", + "other" => "Awaiting Moderation ({{count}})"), + array("count" => $view->content->unpublished->count()))) ->url(url::site("admin/comments/queue/unpublished"))) ->append(Menu::factory("link") ->id("published") - ->label(sprintf(_("Approved (%d)"), - $view->content->published->count())) + ->label(t(array("one" => "Approved ({{count}})", + "other" => "Approved ({{count}})"), + array("count" => $view->content->published->count()))) ->url(url::site("admin/comments/queue/published"))) ->append(Menu::factory("link") ->id("spam") - ->label(sprintf(_("Spam (%d)"), $view->content->spam->count())) + ->label(t(array("one" => "Spam ({{count}})", + "other" => "Spam ({{count}})"), + array("count" => $view->content->spam->count()))) ->url(url::site("admin/comments/queue/spam"))); switch ($state) { case "all": $view->content->comments = $view->content->all; - $view->content->title = _("All Comments"); + $view->content->title = t("All Comments"); break; case "published": $view->content->comments = $view->content->published; - $view->content->title = _("Approved Comments"); + $view->content->title = t("Approved Comments"); break; case "unpublished": $view->content->comments = $view->content->unpublished; - $view->content->title = _("Comments Awaiting Moderation"); + $view->content->title = t("Comments Awaiting Moderation"); break; case "spam": - $view->content->title = _("Spam Comments"); + $view->content->title = t("Spam Comments"); $view->content->comments = $view->content->spam; $view->content->spam_caught = module::get_var("comment", "spam_caught"); break; diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php index 4bc77e57..3b6c0240 100644 --- a/modules/comment/helpers/comment.php +++ b/modules/comment/helpers/comment.php @@ -100,25 +100,25 @@ class comment_Core { static function get_add_form($item) { $form = new Forge("comments", "", "post"); - $group = $form->group("add_comment")->label(_("Add comment")); - $group->input("author") ->label(_("Author")) ->id("gAuthor"); - $group->input("email") ->label(_("Email")) ->id("gEmail"); - $group->input("url") ->label(_("Website (hidden)"))->id("gUrl"); - $group->textarea("text") ->label(_("Text")) ->id("gText"); + $group = $form->group("add_comment")->label(t("Add comment")); + $group->input("author") ->label(t("Author")) ->id("gAuthor"); + $group->input("email") ->label(t("Email")) ->id("gEmail"); + $group->input("url") ->label(t("Website (hidden)"))->id("gUrl"); + $group->textarea("text") ->label(t("Text")) ->id("gText"); $group->hidden("item_id")->value($item->id); - $group->submit(_("Add")); + $group->submit(t("Add")); $form->add_rules_from(ORM::factory("comment")); return $form; } static function get_edit_form($comment) { $form = new Forge("comments/{$comment->id}?_method=put", "", "post"); - $group = $form->group("edit_comment")->label(_("Edit comment")); - $group->input("author") ->label(_("Author")) ->id("gAuthor")->value($comment->author); - $group->input("email") ->label(_("Email")) ->id("gEmail") ->value($comment->email); - $group->input("url") ->label(_("Website (hidden)"))->id("gUrl") ->value($comment->url); - $group->textarea("text")->label(_("Text")) ->id("gText") ->value($comment->text); - $group->submit(_("Edit")); + $group = $form->group("edit_comment")->label(t("Edit comment")); + $group->input("author") ->label(t("Author")) ->id("gAuthor")->value($comment->author); + $group->input("email") ->label(t("Email")) ->id("gEmail") ->value($comment->email); + $group->input("url") ->label(t("Website (hidden)"))->id("gUrl") ->value($comment->url); + $group->textarea("text")->label(t("Text")) ->id("gText") ->value($comment->text); + $group->submit(t("Edit")); $form->add_rules_from($comment); return $form; } diff --git a/modules/comment/helpers/comment_block.php b/modules/comment/helpers/comment_block.php index 9a104baf..837eebb9 100644 --- a/modules/comment/helpers/comment_block.php +++ b/modules/comment/helpers/comment_block.php @@ -27,7 +27,7 @@ class comment_block_Core { public static function photo_bottom($theme) { $block = new Block; $block->id = "gComments"; - $block->title = _("Comments"); + $block->title = t("Comments"); $view = new View("comments.html"); $view->comments = ORM::factory("comment") @@ -44,7 +44,7 @@ class comment_block_Core { public static function admin_dashboard_blocks($theme) { $block = new Block(); $block->id = "gRecentComments"; - $block->title = _("Recent Comments"); + $block->title = t("Recent Comments"); $block->content = new View("admin_block_recent_comments.html"); $block->content->comments = ORM::factory("comment")->orderby("created", "DESC")->limit(5)->find_all(); diff --git a/modules/comment/helpers/comment_menu.php b/modules/comment/helpers/comment_menu.php index 9c7a5698..9df3024a 100644 --- a/modules/comment/helpers/comment_menu.php +++ b/modules/comment/helpers/comment_menu.php @@ -22,7 +22,7 @@ class comment_menu_Core { $menu->get("content_menu") ->append(Menu::factory("link") ->id("comments") - ->label(_("Comments")) + ->label(t("Comments")) ->url(url::site("admin/comments"))); } @@ -30,7 +30,7 @@ class comment_menu_Core { $menu ->append(Menu::factory("link") ->id("comments") - ->label(_("View comments on this item")) + ->label(t("View comments on this item")) ->url("#comments") ->css_id("gCommentsLink")); } diff --git a/modules/comment/views/admin_block_recent_comments.html.php b/modules/comment/views/admin_block_recent_comments.html.php index 6829d74b..2d753bd7 100644 --- a/modules/comment/views/admin_block_recent_comments.html.php +++ b/modules/comment/views/admin_block_recent_comments.html.php @@ -3,8 +3,9 @@ <? foreach ($comments as $comment): ?> <li> <?= date("Y-M-d H:i:s", $comment->created) ?> - <? printf(_("%s said %s"), "<a href=\"#\">$comment->author</a>", - "<i>\"" . text::limit_words($comment->text, 50) . "\"</i>"); ?> + <?= t("{{author_name}} said {{comment_text}}", + array("author_name" => "<a href=\"#\">$comment->author</a>", + "comment_text" => "<i>\"" . text::limit_words($comment->text, 50) . "\"</i>")); ?> </li> <? endforeach ?> </ul> diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php index b1f0aa97..b9f5148b 100644 --- a/modules/comment/views/admin_comments.html.php +++ b/modules/comment/views/admin_comments.html.php @@ -16,7 +16,7 @@ </script> <div id="gAdminComments"> - <h1> <?= _("Manage Comments") ?> </h1> + <h1> <?= t("Manage Comments") ?> </h1> <div id="gAdminCommentsMenu"> <?= $menu ?> @@ -33,18 +33,22 @@ <? if ($queue == "spam"): ?> <div> <p> - <? printf(_("Gallery has caught %d spam for you since you installed spam filtering."), $spam_caught) ?> + <?= 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)) ?> </p> <p> <? if ($spam->count()): ?> - <? printf(_("There are currently %d 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."), $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."), + array("count" => $spam->count())) ?> </p> <p> <a href="<?= url::site("admin/comments/delete_all_spam?csrf=" . access::csrf_token()) ?>"> - <?= _("Delete all spam") ?> + <?= t("Delete all spam") ?> </a> <? else: ?> - <?= _("Your spam queue is empty!") ?> + <?= t("Your spam queue is empty!") ?> <? endif ?> </p> </div> @@ -58,13 +62,13 @@ <table> <tr> <th> - <?= _("Comment") ?> + <?= t("Comment") ?> </th> <th style="width: 100px"> - <?= _("Date") ?> + <?= t("Date") ?> </th> <th> - <?= _("Actions") ?> + <?= t("Actions") ?> </th> </tr> <? foreach ($comments as $comment): ?> @@ -89,7 +93,8 @@ <?= photo::img_dimensions($item->thumb_width, $item->thumb_height, 75) ?> /> </a> - <?= sprintf(_("Comment left on <a href=\"%s\">%s</a>"), $item->url(), $item->title) ?> + <?= t("Comment left on {{item_title}}", + array("item_title" => sprintf("<a href=\"%s\">%s</a>", $item->url(), $item->title))) ?> </div> </td> <td> @@ -100,7 +105,7 @@ <? if ($comment->state != "unpublished"): ?> <li> <a href="javascript:set_state('unpublished',<?=$comment->id?>)"> - <?= _("Unapprove") ?> + <?= t("Unapprove") ?> </a> </li> <? endif ?> @@ -108,7 +113,7 @@ <? if ($comment->state != "published"): ?> <li> <a href="javascript:set_state('published',<?=$comment->id?>)"> - <?= _("Approve") ?> + <?= t("Approve") ?> </a> </li> <? endif ?> @@ -116,14 +121,14 @@ <? if ($comment->state != "spam"): ?> <li> <a href="javascript:set_state('spam',<?=$comment->id?>)"> - <?= _("Spam") ?> + <?= t("Spam") ?> </a> </li> <? endif ?> <li> <a href="javascript:del(<?=$comment->id?>)"> - <?= _("Delete") ?> + <?= t("Delete") ?> </a> </li> </ul> diff --git a/modules/comment/views/comment.html.php b/modules/comment/views/comment.html.php index a87634e9..de0640bd 100644 --- a/modules/comment/views/comment.html.php +++ b/modules/comment/views/comment.html.php @@ -6,8 +6,8 @@ <? //endif ?> <p class="gAuthor"> <a href="#"><img src="<?= $avatar ?>" class="gAvatar" alt="<?= $comment->author ?>" /></a> - <?= _("on ") . date("Y-M-d H:i:s", $comment->created) ?> - <a href="#"><?= $comment->author ?></a> <?= _("said") ?> + <?= t("on ") . date("Y-M-d H:i:s", $comment->created) ?> + <a href="#"><?= $comment->author ?></a> <?= t("said") ?> </p> <div> <?= $comment->text ?> diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php index e34446ac..b28a536e 100644 --- a/modules/comment/views/comments.html.php +++ b/modules/comment/views/comments.html.php @@ -9,8 +9,8 @@ <? //endif ?> <p class="gAuthor"> <a href="#"><img src="<?= $avatar ?>" class="gAvatar" alt="<?= $comment->author ?>" /></a> - <?= _("on ") . date("Y-M-d H:i:s", $comment->created) ?> - <a href="#"><?= $comment->author ?></a> <?= _("said") ?> + <?= t("on ") . date("Y-M-d H:i:s", $comment->created) ?> + <a href="#"><?= $comment->author ?></a> <?= t("said") ?> </p> <div> <?= $comment->text ?> |