]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/command.php
Update/add translator documentation.
[quix0rs-gnu-social.git] / lib / command.php
index a922aa73ac57b66091551c00b843598ca8d6895e..6254cf2e785920e9b0e495ceadd79a99fd5e3272 100644 (file)
@@ -180,7 +180,7 @@ class UnimplementedCommand extends Command
     function handle($channel)
     {
         // TRANS: Error text shown when an unimplemented command is given.
-        $channel->error($this->user, _("Sorry, this command is not yet implemented."));
+        $channel->error($this->user, _('Sorry, this command is not yet implemented.'));
     }
 }
 
@@ -295,7 +295,7 @@ class FavCommand extends Command
 
         if ($fave->fetch()) {
             // TRANS: Error message text shown when a favorite could not be set because it has already been favorited.
-            $channel->error($this->user, _('Could not create favorite: already favorited.'));
+            $channel->error($this->user, _('Could not create favorite: Already favorited.'));
             return;
         }
 
@@ -431,10 +431,12 @@ class TagCommand extends Command
         $cur     = $this->user->getProfile();
 
         if (!$profile) {
+            // TRANS: Client error displayed trying to perform an action related to a non-existing profile.
             $channel->error($cur, _('No such profile.'));
             return;
         }
         if (!$cur->canTag($profile)) {
+            // TRANS: Error displayed when trying to tag a user that cannot be tagged.
             $channel->error($cur, _('You cannot tag this user.'));
             return;
         }
@@ -448,7 +450,9 @@ class TagCommand extends Command
             $tag = $clean_tags[] = common_canonical_tag($tag);
 
             if (!common_valid_profile_tag($tag)) {
-                $channel->error($cur, sprintf(_('Invalid tag: "%s"'), $tag));
+                // TRANS: Error displayed if a given tag is invalid.
+                // TRANS: %s is the invalid tag.
+                $channel->error($cur, sprintf(_('Invalid tag: "%s".'), $tag));
                 return;
             }
             $privs[$tag] = $private;
@@ -459,18 +463,22 @@ class TagCommand extends Command
                 Profile_tag::setTag($cur->id, $profile->id, $tag, null, $privs[$tag]);
             }
         } catch (Exception $e) {
-            $channel->error($cur, sprintf(_('Error tagging %s: %s'),
+            // TRANS: Error displayed if tagging a user fails.
+            // TRANS: %1$s is the tagged user, %2$s is the error message (no punctuation).
+            $channel->error($cur, sprintf(_('Error tagging %1$s: %2$s'),
                                           $profile->nickname, $e->getMessage()));
             return;
         }
 
+        // TRANS: Succes message displayed if tagging a user succeeds.
+        // TRANS: %1$s is the tagged user's nickname, %2$s is a list of tags.
         $channel->output($cur, sprintf(_('%1$s was tagged %2$s'),
                                               $profile->nickname,
-                                              implode(', ', $clean_tags)));
+                                              // TRANS: Separator for list of tags.
+                                              implode(_(', '), $clean_tags)));
     }
 }
 
-
 class UntagCommand extends TagCommand
 {
     function handle($channel)
@@ -479,10 +487,12 @@ class UntagCommand extends TagCommand
         $cur     = $this->user->getProfile();
 
         if (!$profile) {
+            // TRANS: Client error displayed trying to perform an action related to a non-existing profile.
             $channel->error($cur, _('No such profile.'));
             return;
         }
         if (!$cur->canTag($profile)) {
+            // TRANS: Error displayed when trying to tag a user that cannot be tagged.
             $channel->error($cur, _('You cannot tag this user.'));
             return;
         }
@@ -491,6 +501,8 @@ class UntagCommand extends TagCommand
 
         foreach ($tags as $tag) {
             if (!common_valid_profile_tag($tag)) {
+                // TRANS: Error displayed if a given tag is invalid.
+                // TRANS: %s is the invalid tag.
                 $channel->error($cur, sprintf(_('Invalid tag: "%s"'), $tag));
                 return;
             }
@@ -501,14 +513,19 @@ class UntagCommand extends TagCommand
                 Profile_tag::unTag($cur->id, $profile->id, $tag);
             }
         } catch (Exception $e) {
-            $channel->error($cur, sprintf(_('Error untagging %s: %s'),
+            // TRANS: Error displayed if untagging a user fails.
+            // TRANS: %1$s is the untagged user, %2$s is the error message (no punctuation).
+            $channel->error($cur, sprintf(_('Error untagging %1$s: %2$s'),
                                           $profile->nickname, $e->getMessage()));
             return;
         }
 
+        // TRANS: Succes message displayed if untagging a user succeeds.
+        // TRANS: %1$s is the untagged user's nickname, %2$s is a list of tags.
         $channel->output($cur, sprintf(_('The following tag(s) were removed from user %1$s: %2$s.'),
                                               $profile->nickname,
-                                              implode(', ', $tags)));
+                                              // TRANS: Separator for list of tags.
+                                              implode(_(', '), $tags)));
     }
 }
 
@@ -991,83 +1008,83 @@ class HelpCommand extends Command
     {
         // TRANS: Header line of help text for commands.
         $out = array(_m('COMMANDHELP', "Commands:"));
-        $commands = array(// TRANS: Help message for IM/SMS command "on"
+        $commands = array(// TRANS: Help message for IM/SMS command "on".
                           "on" => _m('COMMANDHELP', "turn on notifications"),
-                          // TRANS: Help message for IM/SMS command "off"
+                          // TRANS: Help message for IM/SMS command "off".
                           "off" => _m('COMMANDHELP', "turn off notifications"),
-                          // TRANS: Help message for IM/SMS command "help"
+                          // TRANS: Help message for IM/SMS command "help".
                           "help" => _m('COMMANDHELP', "show this help"),
-                          // TRANS: Help message for IM/SMS command "follow <nickname>"
+                          // TRANS: Help message for IM/SMS command "follow <nickname>".
                           "follow <nickname>" => _m('COMMANDHELP', "subscribe to user"),
-                          // TRANS: Help message for IM/SMS command "groups"
+                          // TRANS: Help message for IM/SMS command "groups".
                           "groups" => _m('COMMANDHELP', "lists the groups you have joined"),
-                          // TRANS: Help message for IM/SMS command "tag"
+                          // TRANS: Help message for IM/SMS command "tag".
                           "tag <nickname> <tags>" => _m('COMMANDHELP',"tag a user"),
-                          // TRANS: Help message for IM/SMS command "untag"
+                          // TRANS: Help message for IM/SMS command "untag".
                           "untag <nickname> <tags>" => _m('COMMANDHELP',"untag a user"),
-                          // TRANS: Help message for IM/SMS command "subscriptions"
+                          // TRANS: Help message for IM/SMS command "subscriptions".
                           "subscriptions" => _m('COMMANDHELP', "list the people you follow"),
-                          // TRANS: Help message for IM/SMS command "subscribers"
+                          // TRANS: Help message for IM/SMS command "subscribers".
                           "subscribers" => _m('COMMANDHELP', "list the people that follow you"),
-                          // TRANS: Help message for IM/SMS command "leave <nickname>"
+                          // TRANS: Help message for IM/SMS command "leave <nickname>".
                           "leave <nickname>" => _m('COMMANDHELP', "unsubscribe from user"),
-                          // TRANS: Help message for IM/SMS command "d <nickname> <text>"
+                          // TRANS: Help message for IM/SMS command "d <nickname> <text>".
                           "d <nickname> <text>" => _m('COMMANDHELP', "direct message to user"),
-                          // TRANS: Help message for IM/SMS command "get <nickname>"
+                          // TRANS: Help message for IM/SMS command "get <nickname>".
                           "get <nickname>" => _m('COMMANDHELP', "get last notice from user"),
-                          // TRANS: Help message for IM/SMS command "whois <nickname>"
+                          // TRANS: Help message for IM/SMS command "whois <nickname>".
                           "whois <nickname>" => _m('COMMANDHELP', "get profile info on user"),
-                          // TRANS: Help message for IM/SMS command "lose <nickname>"
+                          // TRANS: Help message for IM/SMS command "lose <nickname>".
                           "lose <nickname>" => _m('COMMANDHELP', "force user to stop following you"),
-                          // TRANS: Help message for IM/SMS command "fav <nickname>"
+                          // TRANS: Help message for IM/SMS command "fav <nickname>".
                           "fav <nickname>" => _m('COMMANDHELP', "add user's last notice as a 'fave'"),
-                          // TRANS: Help message for IM/SMS command "fav #<notice_id>"
+                          // TRANS: Help message for IM/SMS command "fav #<notice_id>".
                           "fav #<notice_id>" => _m('COMMANDHELP', "add notice with the given id as a 'fave'"),
-                          // TRANS: Help message for IM/SMS command "repeat #<notice_id>"
+                          // TRANS: Help message for IM/SMS command "repeat #<notice_id>".
                           "repeat #<notice_id>" => _m('COMMANDHELP', "repeat a notice with a given id"),
-                          // TRANS: Help message for IM/SMS command "repeat <nickname>"
+                          // TRANS: Help message for IM/SMS command "repeat <nickname>".
                           "repeat <nickname>" => _m('COMMANDHELP', "repeat the last notice from user"),
-                          // TRANS: Help message for IM/SMS command "reply #<notice_id>"
+                          // TRANS: Help message for IM/SMS command "reply #<notice_id>".
                           "reply #<notice_id>" => _m('COMMANDHELP', "reply to notice with a given id"),
-                          // TRANS: Help message for IM/SMS command "reply <nickname>"
+                          // TRANS: Help message for IM/SMS command "reply <nickname>".
                           "reply <nickname>" => _m('COMMANDHELP', "reply to the last notice from user"),
-                          // TRANS: Help message for IM/SMS command "join <group>"
+                          // TRANS: Help message for IM/SMS command "join <group>".
                           "join <group>" => _m('COMMANDHELP', "join group"),
-                          // TRANS: Help message for IM/SMS command "login"
+                          // TRANS: Help message for IM/SMS command "login".
                           "login" => _m('COMMANDHELP', "Get a link to login to the web interface"),
-                          // TRANS: Help message for IM/SMS command "drop <group>"
+                          // TRANS: Help message for IM/SMS command "drop <group>".
                           "drop <group>" => _m('COMMANDHELP', "leave group"),
-                          // TRANS: Help message for IM/SMS command "stats"
+                          // TRANS: Help message for IM/SMS command "stats".
                           "stats" => _m('COMMANDHELP', "get your stats"),
-                          // TRANS: Help message for IM/SMS command "stop"
+                          // TRANS: Help message for IM/SMS command "stop".
                           "stop" => _m('COMMANDHELP', "same as 'off'"),
-                          // TRANS: Help message for IM/SMS command "quit"
+                          // TRANS: Help message for IM/SMS command "quit".
                           "quit" => _m('COMMANDHELP', "same as 'off'"),
-                          // TRANS: Help message for IM/SMS command "sub <nickname>"
+                          // TRANS: Help message for IM/SMS command "sub <nickname>".
                           "sub <nickname>" => _m('COMMANDHELP', "same as 'follow'"),
-                          // TRANS: Help message for IM/SMS command "unsub <nickname>"
+                          // TRANS: Help message for IM/SMS command "unsub <nickname>".
                           "unsub <nickname>" => _m('COMMANDHELP', "same as 'leave'"),
-                          // TRANS: Help message for IM/SMS command "last <nickname>"
+                          // TRANS: Help message for IM/SMS command "last <nickname>".
                           "last <nickname>" => _m('COMMANDHELP', "same as 'get'"),
-                          // TRANS: Help message for IM/SMS command "on <nickname>"
+                          // TRANS: Help message for IM/SMS command "on <nickname>".
                           "on <nickname>" => _m('COMMANDHELP', "not yet implemented."),
-                          // TRANS: Help message for IM/SMS command "off <nickname>"
+                          // TRANS: Help message for IM/SMS command "off <nickname>".
                           "off <nickname>" => _m('COMMANDHELP', "not yet implemented."),
-                          // TRANS: Help message for IM/SMS command "nudge <nickname>"
+                          // TRANS: Help message for IM/SMS command "nudge <nickname>".
                           "nudge <nickname>" => _m('COMMANDHELP', "remind a user to update."),
-                          // TRANS: Help message for IM/SMS command "invite <phone number>"
+                          // TRANS: Help message for IM/SMS command "invite <phone number>".
                           "invite <phone number>" => _m('COMMANDHELP', "not yet implemented."),
-                          // TRANS: Help message for IM/SMS command "track <word>"
+                          // TRANS: Help message for IM/SMS command "track <word>".
                           "track <word>" => _m('COMMANDHELP', "not yet implemented."),
-                          // TRANS: Help message for IM/SMS command "untrack <word>"
+                          // TRANS: Help message for IM/SMS command "untrack <word>".
                           "untrack <word>" => _m('COMMANDHELP', "not yet implemented."),
-                          // TRANS: Help message for IM/SMS command "track off"
+                          // TRANS: Help message for IM/SMS command "track off".
                           "track off" => _m('COMMANDHELP', "not yet implemented."),
-                          // TRANS: Help message for IM/SMS command "untrack all"
+                          // TRANS: Help message for IM/SMS command "untrack all".
                           "untrack all" => _m('COMMANDHELP', "not yet implemented."),
-                          // TRANS: Help message for IM/SMS command "tracks"
+                          // TRANS: Help message for IM/SMS command "tracks".
                           "tracks" => _m('COMMANDHELP', "not yet implemented."),
-                          // TRANS: Help message for IM/SMS command "tracking"
+                          // TRANS: Help message for IM/SMS command "tracking".
                           "tracking" => _m('COMMANDHELP', "not yet implemented."));
 
         // Give plugins a chance to add or override...