i18n fixes.

Whitespace updates.
Update translator documentation.
This commit is contained in:
Siebrand Mazeland 2011-04-19 21:54:56 +02:00
parent f7ffe1df86
commit 0d892e7610
8 changed files with 56 additions and 47 deletions

View File

@ -205,6 +205,7 @@ class EmailregisterAction extends Action
if (!empty($old)) { if (!empty($old)) {
// TRANS: Error text when trying to register with an already registered e-mail address. // 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 '. $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.'), '<a href="%s">password recovery</a> tool to recover a missing password.'),
common_local_url('recoverpassword')); common_local_url('recoverpassword'));
@ -236,10 +237,12 @@ class EmailregisterAction extends Action
if (empty($confirm)) { if (empty($confirm)) {
$confirm = Confirm_address::saveNew(null, $this->email, 'register'); $confirm = Confirm_address::saveNew(null, $this->email, 'register');
// TRANS: Confirmation text after initial registration. // 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.'), $prompt = sprintf(_m('An email was sent to %s to confirm that address. Check your email inbox for instructions.'),
$this->email); $this->email);
} else { } else {
// TRANS: Confirmation text after re-requesting an e-mail confirmation code. // 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.'), $prompt = sprintf(_m('The address %s was already registered but not confirmed. The confirmation code was resent.'),
$this->email); $this->email);
} }
@ -279,14 +282,18 @@ class EmailregisterAction extends Action
} }
if (!$this->tos) { 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; return;
} else if (empty($this->password1)) { } 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) { } 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) { } 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)) { if (!empty($this->error)) {
@ -312,7 +319,7 @@ class EmailregisterAction extends Action
} }
if (empty($this->user)) { if (empty($this->user)) {
throw new Exception("Failed to register user."); throw new Exception('Failed to register user.');
} }
common_set_user($this->user); common_set_user($this->user);

View File

@ -167,12 +167,14 @@ class QnAPlugin extends MicroAppPlugin
'author' => 'Zach Copley', 'author' => 'Zach Copley',
'homepage' => 'http://status.net/wiki/Plugin:QnA', 'homepage' => 'http://status.net/wiki/Plugin:QnA',
'description' => 'description' =>
// TRANS: Plugin description.
_m('Question and Answers micro-app.') _m('Question and Answers micro-app.')
); );
return true; return true;
} }
function appTitle() { function appTitle() {
// TRANS: Application title.
return _m('Question'); return _m('Question');
} }
@ -200,13 +202,13 @@ class QnAPlugin extends MicroAppPlugin
function saveNoticeFromActivity($activity, $actor, $options=array()) function saveNoticeFromActivity($activity, $actor, $options=array())
{ {
if (count($activity->objects) != 1) { if (count($activity->objects) != 1) {
throw new Exception('Too many activity objects.'); throw new Exception(_m('Too many activity objects.'));
} }
$questionObj = $activity->objects[0]; $questionObj = $activity->objects[0];
if ($questionObj->type != QnA_Question::OBJECT_TYPE) { if ($questionObj->type != QnA_Question::OBJECT_TYPE) {
throw new Exception('Wrong type for object.'); throw new Exception(_m('Wrong type for object.'));
} }
$notice = null; $notice = null;
@ -224,12 +226,12 @@ class QnAPlugin extends MicroAppPlugin
$question = QnA_Question::staticGet('uri', $questionObj->id); $question = QnA_Question::staticGet('uri', $questionObj->id);
if (empty($question)) { if (empty($question)) {
// FIXME: save the 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); $notice = QnA_Answer::saveNew($actor, $question, $options);
break; break;
default: default:
throw new Exception("Unknown object type received by QnA Plugin"); throw new Exception(_m('Unknown object type received by QnA Plugin.'));
} }
return $notice; return $notice;
@ -258,13 +260,13 @@ class QnAPlugin extends MicroAppPlugin
} }
if (empty($question)) { if (empty($question)) {
throw new Exception("Unknown object type."); throw new Exception(_m('Unknown object type.'));
} }
$notice = $question->getNotice(); $notice = $question->getNotice();
if (empty($notice)) { if (empty($notice)) {
throw new Exception("Unknown question notice."); throw new Exception(_m('Unknown question notice.'));
} }
$obj = new ActivityObject(); $obj = new ActivityObject();
@ -349,7 +351,6 @@ class QnAPlugin extends MicroAppPlugin
* @param Notice $notice * @param Notice $notice
* @param HTMLOutputter $out * @param HTMLOutputter $out
*/ */
function showNotice($notice, $out) function showNotice($notice, $out)
{ {
switch ($notice->object_type) { switch ($notice->object_type) {
@ -358,11 +359,10 @@ class QnAPlugin extends MicroAppPlugin
case QnA_Answer::OBJECT_TYPE: case QnA_Answer::OBJECT_TYPE:
return $this->showNoticeAnswer($notice, $out); return $this->showNoticeAnswer($notice, $out);
default: default:
throw new Exception(
// TRANS: Exception thrown when performing an unexpected action on a question. // TRANS: Exception thrown when performing an unexpected action on a question.
// TRANS: %s is the unpexpected object type. // TRANS: %s is the unpexpected object type.
throw new Exception( sprintf(_m('Unexpected type for QnA plugin: %s.'),
sprintf(
_m('Unexpected type for QnA plugin: %s.'),
$notice->object_type $notice->object_type
) )
); );
@ -494,9 +494,11 @@ class QnAPlugin extends MicroAppPlugin
$max = Notice::maxContent(); $max = Notice::maxContent();
$short = mb_substr($content, 0, $max - 1); $short = mb_substr($content, 0, $max - 1);
$short .= sprintf( $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, $notice->uri,
_m('more') _m('more...')
); );
} else { } else {
$short = $content; $short = $content;

View File

@ -224,7 +224,7 @@ class QnanewanswerAction extends Action
$this->startHTML('text/xml;charset=utf-8', true); $this->startHTML('text/xml;charset=utf-8', true);
$this->elementStart('head'); $this->elementStart('head');
// TRANS: Page title after an AJAX error occurs on the post answer page. // 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->elementEnd('head');
$this->elementStart('body'); $this->elementStart('body');
$this->element('p', array('id' => 'error'), $msg); $this->element('p', array('id' => 'error'), $msg);

View File

@ -110,7 +110,7 @@ class QnashowanswerForm extends Form
function formLegend() function formLegend()
{ {
// TRANS: Form legend for showing the answer. // TRANS: Form legend for showing the answer.
$this->out->element('legend', null, _('Answer')); $this->out->element('legend', null, _m('Answer'));
} }
/** /**
@ -151,7 +151,7 @@ class QnashowanswerForm extends Form
'submit', 'submit',
'best', 'best',
// TRANS: Title for button text marking an answer as "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', 'submit',
null, null,
// TRANS: Title for button text for revising an answer // TRANS: Title for button text for revising an answer
_('Revise your answer') _m('Revise your answer')
); );
} }
*/ */

View File

@ -103,7 +103,7 @@ class QnashowquestionForm extends Form
function formLegend() function formLegend()
{ {
// TRANS: Form legend for revising the answer. // TRANS: Form legend for revising the answer.
$this->out->element('legend', null, _('Question')); $this->out->element('legend', null, _m('Question'));
} }
/** /**
@ -152,7 +152,7 @@ class QnashowquestionForm extends Form
'submit', 'submit',
'submit', 'submit',
// TRANS: Title for button text for closing a question // TRANS: Title for button text for closing a question
_('Close the question') _m('Close the question')
); );
} }
} }