summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-02-10 03:42:25 +0000
committerBharat Mediratta <bharat@menalto.com>2009-02-10 03:42:25 +0000
commit9f76d15086972c3661cbb8c4a786b7763203a745 (patch)
treebfd22f989e7e1231c357e8d5a4dd94f6cbf7a747 /modules
parent9f77ca61f8f71c1b2c25c5c366cc5f604544ff84 (diff)
Clean up translations to use t() properly and differentiate between
albums and photos. We should not say the word "item" to users if we can avoid it.
Diffstat (limited to 'modules')
-rw-r--r--modules/notification/helpers/notification.php21
-rw-r--r--modules/notification/views/item_deleted.html.php2
2 files changed, 18 insertions, 5 deletions
diff --git a/modules/notification/helpers/notification.php b/modules/notification/helpers/notification.php
index f5f0aa57..1048d094 100644
--- a/modules/notification/helpers/notification.php
+++ b/modules/notification/helpers/notification.php
@@ -84,7 +84,9 @@ class notification {
static function send_item_updated($old, $new) {
$body = new View("item_updated.html");
- $body->subject = sprintf(t("Item %s updated"), $old->title);
+ $body->subject = $old->is_album() ?
+ t("Album %title updated", array("title" => $old->title)) :
+ t("Photo %title updated", array("title" => $old->title));
$body->type = ucfirst($old->type);
$body->item_title = $old->title;
$body->description = $item->description;
@@ -97,7 +99,11 @@ class notification {
static function send_item_add($item) {
$body = new View("item_added.html");
- $body->subject = sprintf(t("Item added to %s"), $item->parent()->title);
+ $body->subject = $item->is_album() ?
+ t("Album %title added to %parent_title",
+ array("title" => $item->title, "parent_title" => $item->parent()->title)) :
+ t("Photo %title added to %parent_title",
+ array("title" => $item->title, "parent_title" => $item->parent()->title));
$body->parent_title = $item->parent()->title;
$body->type = $item->type;
$body->item_title = $item->title;
@@ -110,7 +116,12 @@ class notification {
static function send_item_deleted($item) {
$parent = $item->parent();
$body = new View("item_deleted.html");
- $body->subject = sprintf(t("Item %s deleted from %s"), $item->title, $parent->title);
+ $body->subject =
+ $item->is_album() ?
+ t("Album %title removed from %parent_title",
+ array("title" => $item->title, "parent_title" => $item->parent()->title)) :
+ t("Photo %title removed from %parent_title",
+ array("title" => $item->title, "parent_title" => $item->parent()->title));
$body->parent_title = $parent->title;
$body->type = $item->type;
$body->item_title = $item->title;
@@ -122,7 +133,9 @@ class notification {
static function send_comment_published($comment) {
$item = $comment->item();
$body = new View("comment_published.html");
- $body->subject = sprintf(t("A new comment for %s was published"), $item->title);
+ $body->subject = $item->is_album() ?
+ t("A new comment was published for album %title", array("title" => $item->title)) :
+ t("A new comment was published for photo %title", array("title" => $item->title));
$body->text = $comment->text;
if (!empty($comment->author_id)) {
$author = ORM::factory("user", $comment->author_id);
diff --git a/modules/notification/views/item_deleted.html.php b/modules/notification/views/item_deleted.html.php
index 006985ff..f3e098da 100644
--- a/modules/notification/views/item_deleted.html.php
+++ b/modules/notification/views/item_deleted.html.php
@@ -4,7 +4,7 @@
<title><?= $subject ?> </title>
</head>
<body>
- <h2><?= sprintf(t("%s: %s was deleted from %s"), $type, $item_title, $parent_title) ?></h2>
+ <h2><?= sprintf(t("%s: %s was removed from %s"), $type, $item_title, $parent_title) ?></h2>
<table>
<tr>
<td colspan="2"><?= sprintf(t("To view the changed album %s use the link below."), $parent_title) ?></td>