]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
i18n fixes.
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Tue, 19 Apr 2011 19:54:56 +0000 (21:54 +0200)
committerSiebrand Mazeland <s.mazeland@xs4all.nl>
Tue, 19 Apr 2011 19:54:56 +0000 (21:54 +0200)
Whitespace updates.
Update translator documentation.

plugins/EmailRegistration/emailregister.php
plugins/QnA/QnAPlugin.php
plugins/QnA/actions/qnaclosequestion.php
plugins/QnA/actions/qnanewanswer.php
plugins/QnA/actions/qnareviseanswer.php
plugins/QnA/classes/QnA_Vote.php
plugins/QnA/lib/qnashowanswerform.php
plugins/QnA/lib/qnashowquestionform.php

index f6d0ec9b3c4de3e4bec187e4025bfbf10a4ae62e..4bda1d9cedc13a2392cb0fe7d436fa4cb5b9a974 100644 (file)
@@ -205,6 +205,7 @@ class EmailregisterAction extends Action
 
         if (!empty($old)) {
             // TRANS: Error text when trying to register with an already registered e-mail address.
+            // TRANS: %s is the URL to recover password at.
             $this->error = sprintf(_m('A user with that email address already exists. You can use the '.
                                      '<a href="%s">password recovery</a> tool to recover a missing password.'),
                                    common_local_url('recoverpassword'));
@@ -236,10 +237,12 @@ class EmailregisterAction extends Action
         if (empty($confirm)) {
             $confirm = Confirm_address::saveNew(null, $this->email, 'register');
             // TRANS: Confirmation text after initial registration.
+            // TRANS: %s an e-mail address.
             $prompt = sprintf(_m('An email was sent to %s to confirm that address. Check your email inbox for instructions.'),
                               $this->email);
         } else {
             // TRANS: Confirmation text after re-requesting an e-mail confirmation code.
+            // TRANS: %s is an e-mail address.
             $prompt = sprintf(_m('The address %s was already registered but not confirmed. The confirmation code was resent.'),
                               $this->email);
         }
@@ -279,14 +282,18 @@ class EmailregisterAction extends Action
         }
 
         if (!$this->tos) {
-            $this->error = _('You must accept the terms of service and privacy policy to register.');
+            // TRANS: Error text when trying to register without agreeing to the terms.
+            $this->error = _m('You must accept the terms of service and privacy policy to register.');
             return;
         } else if (empty($this->password1)) {
-            $this->error = _('You must set a password');
+            // TRANS: Error text when trying to register without a password.
+            $this->error = _m('You must set a password');
         } else if (strlen($this->password1) < 6) {
-            $this->error = _('Password must be 6 or more characters.');
+            // TRANS: Error text when trying to register with too short a password.
+            $this->error = _m('Password must be 6 or more characters.');
         } else if ($this->password1 != $this->password2) {
-            $this->error = _('Passwords do not match.');
+            // TRANS: Error text when trying to register without providing the same password twice.
+            $this->error = _m('Passwords do not match.');
         }
 
         if (!empty($this->error)) {
@@ -312,7 +319,7 @@ class EmailregisterAction extends Action
         }
 
         if (empty($this->user)) {
-            throw new Exception("Failed to register user.");
+            throw new Exception('Failed to register user.');
         }
 
         common_set_user($this->user);
index ad0541a71cf1f08d34787261ba6e7e6e87ee9d8f..f6381792707e7c1d7ca65fc29043722254d9a2ce 100644 (file)
@@ -167,12 +167,14 @@ class QnAPlugin extends MicroAppPlugin
             'author'      => 'Zach Copley',
             'homepage'    => 'http://status.net/wiki/Plugin:QnA',
             'description' =>
+             // TRANS: Plugin description.
              _m('Question and Answers micro-app.')
         );
         return true;
     }
 
     function appTitle() {
+        // TRANS: Application title.
         return _m('Question');
     }
 
@@ -200,13 +202,13 @@ class QnAPlugin extends MicroAppPlugin
     function saveNoticeFromActivity($activity, $actor, $options=array())
     {
         if (count($activity->objects) != 1) {
-            throw new Exception('Too many activity objects.');
+            throw new Exception(_m('Too many activity objects.'));
         }
 
         $questionObj = $activity->objects[0];
 
         if ($questionObj->type != QnA_Question::OBJECT_TYPE) {
-            throw new Exception('Wrong type for object.');
+            throw new Exception(_m('Wrong type for object.'));
         }
 
         $notice = null;
@@ -224,12 +226,12 @@ class QnAPlugin extends MicroAppPlugin
             $question = QnA_Question::staticGet('uri', $questionObj->id);
             if (empty($question)) {
                 // FIXME: save the question
-                throw new Exception("Answer to unknown question.");
+                throw new Exception(_m('Answer to unknown question.'));
             }
             $notice = QnA_Answer::saveNew($actor, $question, $options);
             break;
         default:
-            throw new Exception("Unknown object type received by QnA Plugin");
+            throw new Exception(_m('Unknown object type received by QnA Plugin.'));
         }
 
         return $notice;
@@ -258,13 +260,13 @@ class QnAPlugin extends MicroAppPlugin
         }
 
         if (empty($question)) {
-            throw new Exception("Unknown object type.");
+            throw new Exception(_m('Unknown object type.'));
         }
 
         $notice = $question->getNotice();
 
         if (empty($notice)) {
-            throw new Exception("Unknown question notice.");
+            throw new Exception(_m('Unknown question notice.'));
         }
 
         $obj = new ActivityObject();
@@ -349,7 +351,6 @@ class QnAPlugin extends MicroAppPlugin
      * @param Notice $notice
      * @param HTMLOutputter $out
      */
-
     function showNotice($notice, $out)
     {
         switch ($notice->object_type) {
@@ -358,12 +359,11 @@ class QnAPlugin extends MicroAppPlugin
         case QnA_Answer::OBJECT_TYPE:
             return $this->showNoticeAnswer($notice, $out);
         default:
-            // TRANS: Exception thrown when performing an unexpected action on a question.
-            // TRANS: %s is the unpexpected object type.
             throw new Exception(
-                sprintf(
-                    _m('Unexpected type for QnA plugin: %s.'),
-                    $notice->object_type
+                // TRANS: Exception thrown when performing an unexpected action on a question.
+                // TRANS: %s is the unpexpected object type.
+                sprintf(_m('Unexpected type for QnA plugin: %s.'),
+                        $notice->object_type
                 )
             );
         }
@@ -494,9 +494,11 @@ class QnAPlugin extends MicroAppPlugin
             $max = Notice::maxContent();
             $short = mb_substr($content, 0, $max - 1);
             $short .= sprintf(
-                '<a href="%s" rel="more" title="%s">…</a>',
+                // TRANS: Link to full notice text if it is longer than what will be dispplayed.
+                // TRANS: %s a notice URI.
+                _m('<a href="%s" rel="more" title="%s">…</a>'),
                 $notice->uri,
-                _m('more')
+                _m('more...')
             );
         } else {
             $short = $content;
index 28d4e547b455f5fb26ed756f1921393934eb0fb0..a8607faa9f8a0bf28169e6d990391ab7bc6495dc 100644 (file)
@@ -140,7 +140,7 @@ class QnaclosequestionAction extends Action
             $orig = clone($this->question);
             $this->question->closed = 1;
             $this->question->update($orig);
-            
+
         } catch (ClientException $ce) {
             $this->error = $ce->getMessage();
             $this->showPage();
index 4e2fa5d36cca94d9a84ad6b9d78ded4b5f65b7aa..dbab6c5eefa6692dfda3cdfc0b4bdd6808d7b62c 100644 (file)
@@ -162,10 +162,10 @@ class QnanewanswerAction extends Action
 
             $this->elementStart('body');
 
-            
+
             $nli = new NoticeAnswerListItem($notice, $this, $this->question, $answer);
             $nli->show();
-  
+
             $this->elementEnd('body');
             $this->elementEnd('html');
         } else {
@@ -224,7 +224,7 @@ class QnanewanswerAction extends Action
         $this->startHTML('text/xml;charset=utf-8', true);
         $this->elementStart('head');
         // TRANS: Page title after an AJAX error occurs on the post answer page.
-        $this->element('title', null, _('Ajax Error'));
+        $this->element('title', null, _m('Ajax Error'));
         $this->elementEnd('head');
         $this->elementStart('body');
         $this->element('p', array('id' => 'error'), $msg);
index cea1258e0d1ae981d1f348d7a97711ac08e69ae2..993543c99503df521ced7c0db9a1f57866006c85 100644 (file)
@@ -89,7 +89,7 @@ class QnareviseanswerAction extends Action
         $id = substr($this->trimmed('id'), 7);
 
         $this->answer   = QnA_Answer::staticGet('id', $id);
-        $this->question = $this->answer->getQuestion(); 
+        $this->question = $this->answer->getQuestion();
 
         if (empty($this->answer) || empty($this->question)) {
             // TRANS: Client exception thrown trying to respond to a non-existing question.
@@ -142,7 +142,7 @@ class QnareviseanswerAction extends Action
     function reviseAnswer()
     {
         $answer = $this->answer;
-        
+
         try {
             $orig = clone($answer);
             $answer->content = $this->answerText;
@@ -181,13 +181,13 @@ class QnareviseanswerAction extends Action
     {
         $question = $this->question;
         $answer   = $this->answer;
-       
+
         try {
             // close the question to further answers
             $orig = clone($question);
             $question->closed = 1;
             $result = $question->update($orig);
-            
+
             // mark this answer an the best answer
             $orig = clone($answer);
             $answer->best = 1;
index ad579666b84da27ffe5b82887288094bad957f6e..cbb8a717c94a32692fb7f1a6c451f08bf3d5ad9d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Data class to save users votes for 
+ * Data class to save users votes for
  *
  * PHP version 5
  *
@@ -46,7 +46,7 @@ class QnA_Vote extends Managed_DataObject
 {
     const UP   = 'http://activitystrea.ms/schema/1.0/like';
     const DOWN = 'http://activityschema.org/object/dislike'; // Gar!
-    
+
     public $__table = 'qna_vote'; // table name
     public $id;          // char(36) primary key not null -> UUID
     public $question_id; // char(36) -> question.id UUID
@@ -97,20 +97,20 @@ class QnA_Vote extends Managed_DataObject
             'description' => 'For storing votes on questions and answers',
             'fields' => array(
                 'id' => array(
-                    'type'        => 'char', 
-                    'length'      => 36, 
-                    'not null'    => true, 
+                    'type'        => 'char',
+                    'length'      => 36,
+                    'not null'    => true,
                     'description' => 'UUID of the vote'
                 ),
                 'question_id' => array(
-                    'type'        => 'char', 
-                    'length'      => 36, 
-                    'not null'    => true, 
+                    'type'        => 'char',
+                    'length'      => 36,
+                    'not null'    => true,
                     'description' => 'UUID of question being voted on'
                 ),
                 'answer_id' => array(
-                    'type'        => 'char', 
-                    'length'      => 36, 
+                    'type'        => 'char',
+                    'length'      => 36,
                     'not null'    => true,
                     'description' => 'UUID of answer being voted on'
                 ),
@@ -121,11 +121,11 @@ class QnA_Vote extends Managed_DataObject
             'primary key' => array('id'),
             'indexes' => array(
                 'profile_id_question_Id_index' => array(
-                    'profile_id', 
+                    'profile_id',
                     'question_id'
                 ),
                 'profile_id_question_Id_index' => array(
-                    'profile_id', 
+                    'profile_id',
                     'answer_id'
                 )
             )
@@ -154,7 +154,7 @@ class QnA_Vote extends Managed_DataObject
         $v->created     = common_sql_now();
 
         common_log(LOG_DEBUG, "Saving vote: $v->id $v->vote");
-        
+
         $v->insert();
     }
 }
index e900eb1992d70763242905bbd3cf880692e0c6d1..fcefb5d0ed0fade527ef9c599452cc4081ea0f3f 100644 (file)
@@ -110,7 +110,7 @@ class QnashowanswerForm extends Form
     function formLegend()
     {
         // TRANS: Form legend for showing the answer.
-        $this->out->element('legend', null, _('Answer'));
+        $this->out->element('legend', null, _m('Answer'));
     }
 
     /**
@@ -151,9 +151,9 @@ class QnashowanswerForm extends Form
                         'submit',
                         'best',
                         // TRANS: Title for button text marking an answer as "best"
-                        _('Mark as best answer')
+                        _m('Mark as best answer')
                     );
-        
+
                 }
             }
 
@@ -171,7 +171,7 @@ class QnashowanswerForm extends Form
                     'submit',
                     null,
                     // TRANS: Title for button text for revising an answer
-                    _('Revise your answer')
+                    _m('Revise your answer')
                 );
             }
              */
index 9ef7a9e4c9b7a81d8336b24bd537b5cb675eb7b4..07fd5a68dbfd008da7ec2b3a8e39df3a30ac121d 100644 (file)
@@ -103,7 +103,7 @@ class QnashowquestionForm extends Form
     function formLegend()
     {
         // TRANS: Form legend for revising the answer.
-        $this->out->element('legend', null, _('Question'));
+        $this->out->element('legend', null, _m('Question'));
     }
 
     /**
@@ -152,9 +152,9 @@ class QnashowquestionForm extends Form
                 'submit',
                 'submit',
                 // TRANS: Title for button text for closing a question
-                _('Close the question')
+                _m('Close the question')
              );
-            }            
+            }
         }
     }