]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/actions/usersalmon.php
Fix L10n/i18n.
[quix0rs-gnu-social.git] / plugins / OStatus / actions / usersalmon.php
index 76125553cf6096030963123b1a3ac38c7e72f652..483de9e50737d0551d68d08599150084055eee20 100644 (file)
@@ -34,12 +34,14 @@ class UsersalmonAction extends SalmonAction
         $id = $this->trimmed('id');
 
         if (!$id) {
+            // TRANS: Client error displayed trying to perform an action without providing an ID.
             $this->clientError(_m('No ID.'));
         }
 
         $this->user = User::staticGet('id', $id);
 
         if (empty($this->user)) {
+            // TRANS: Client error displayed when referring to a non-existing user.
             $this->clientError(_m('No such user.'));
         }
 
@@ -67,7 +69,8 @@ class UsersalmonAction extends SalmonAction
         case ActivityObject::COMMENT:
             break;
         default:
-            throw new ClientException("Can't handle that kind of post.");
+            // TRANS: Client exception thrown when an undefied activity is performed.
+            throw new ClientException(_m('Cannot handle that kind of post.'));
         }
 
         // Notice must either be a) in reply to a notice by this user
@@ -92,11 +95,11 @@ class UsersalmonAction extends SalmonAction
                 !in_array(common_profile_url($this->user->nickname), $context->attention)) {
                 common_log(LOG_ERR, "{$this->user->uri} not in attention list (".implode(',', $context->attention).")");
                 // TRANS: Client exception.
-                throw new ClientException('To the attention of user(s), not including this one.');
+                throw new ClientException(_m('To the attention of user(s), not including this one.'));
             }
         } else {
             // TRANS: Client exception.
-            throw new ClientException('Not to anyone in reply to anything.');
+            throw new ClientException(_m('Not to anyone in reply to anything.'));
         }
 
         $existing = Notice::staticGet('uri', $this->activity->objects[0]->id);
@@ -157,7 +160,7 @@ class UsersalmonAction extends SalmonAction
 
         if (!empty($old)) {
             // TRANS: Client exception.
-            throw new ClientException(_('This is already a favorite.'));
+            throw new ClientException(_m('This is already a favorite.'));
         }
 
         if (!Fave::addNew($profile, $notice)) {
@@ -179,7 +182,7 @@ class UsersalmonAction extends SalmonAction
                                    'notice_id' => $notice->id));
         if (empty($fave)) {
             // TRANS: Client exception.
-            throw new ClientException(_('Notice wasn\'t favorited!'));
+            throw new ClientException(_m('Notice was not favorited!'));
         }
 
         $fave->delete();
@@ -189,18 +192,21 @@ class UsersalmonAction extends SalmonAction
     {
         if ($this->activity->target->type == ActivityObject::_LIST) {
             if ($this->activity->objects[0]->type != ActivityObject::PERSON) {
-                throw new ClientException("Not a person object");
+                // TRANS: Client exception.
+                throw new ClientException(_m('Not a person object.'));
                 return false;
             }
             // this is a peopletag
             $tagged = User::staticGet('uri', $this->activity->objects[0]->id);
 
             if (empty($tagged)) {
-                throw new ClientException("Unidentified profile being tagged");
+                // TRANS: Client exception.
+                throw new ClientException(_m('Unidentified profile being tagged.'));
             }
 
             if ($tagged->id !== $this->user->id) {
-                throw new ClientException("This user is not the one being tagged");
+                // TRANS: Client exception.
+                throw new ClientException(_m('This user is not the one being tagged.'));
             }
 
             // save the list
@@ -210,7 +216,8 @@ class UsersalmonAction extends SalmonAction
             $ptag = $list->localPeopletag();
             $result = Profile_tag::setTag($ptag->tagger, $tagged->id, $ptag->tag);
             if (!$result) {
-                throw new ClientException("The tag could not be saved.");
+                // TRANS: Client exception.
+                throw new ClientException(_m('The tag could not be saved.'));
             }
         }
     }
@@ -219,18 +226,21 @@ class UsersalmonAction extends SalmonAction
     {
         if ($this->activity->target->type == ActivityObject::_LIST) {
             if ($this->activity->objects[0]->type != ActivityObject::PERSON) {
-                throw new ClientException("Not a person object");
+                // TRANS: Client exception.
+                throw new ClientException(_m('Not a person object.'));
                 return false;
             }
             // this is a peopletag
             $tagged = User::staticGet('uri', $this->activity->objects[0]->id);
 
             if (empty($tagged)) {
-                throw new ClientException("Unidentified profile being untagged");
+                // TRANS: Client exception.
+                throw new ClientException(_m('Unidentified profile being untagged.'));
             }
 
             if ($tagged->id !== $this->user->id) {
-                throw new ClientException("This user is not the one being untagged");
+                // TRANS: Client exception.
+                throw new ClientException(_m('This user is not the one being untagged.'));
             }
 
             // save the list
@@ -241,7 +251,8 @@ class UsersalmonAction extends SalmonAction
             $result = Profile_tag::unTag($ptag->tagger, $tagged->id, $ptag->tag);
 
             if (!$result) {
-                throw new ClientException("The tag could not be deleted.");
+                // TRANS: Client exception.
+                throw new ClientException(_m('The tag could not be deleted.'));
             }
         }
     }
@@ -255,7 +266,7 @@ class UsersalmonAction extends SalmonAction
     {
         if (!$object) {
             // TRANS: Client exception.
-            throw new ClientException(_m('Can\'t favorite/unfavorite without an object.'));
+            throw new ClientException(_m('Cannot favorite/unfavorite without an object.'));
         }
 
         switch ($object->type) {
@@ -267,7 +278,7 @@ class UsersalmonAction extends SalmonAction
             break;
         default:
             // TRANS: Client exception.
-            throw new ClientException(_m('Can\'t handle that kind of object for liking/faving.'));
+            throw new ClientException(_m('Cannot handle that kind of object for liking/faving.'));
         }
 
         $notice = Notice::staticGet('uri', $object->id);