Fix i18n issues.

Fix incorrect variable usage in messages.
This commit is contained in:
Siebrand Mazeland 2011-04-01 19:55:15 +02:00
parent 7abecb61bd
commit 62eed1e23e
3 changed files with 15 additions and 19 deletions

View File

@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class QnashowanswerAction extends ShownoticeAction class QnashowanswerAction extends ShownoticeAction
{ {
protected $answer = null; protected $answer = null;
@ -56,7 +55,6 @@ class QnashowanswerAction extends ShownoticeAction
* *
* @return boolean true * @return boolean true
*/ */
function prepare($argarray) function prepare($argarray)
{ {
OwnerDesignAction::prepare($argarray); OwnerDesignAction::prepare($argarray);
@ -66,32 +64,32 @@ class QnashowanswerAction extends ShownoticeAction
$this->answer = QnA_Answer::staticGet('id', $this->id); $this->answer = QnA_Answer::staticGet('id', $this->id);
if (empty($this->answer)) { if (empty($this->answer)) {
throw new ClientException(_('No such answer.'), 404); throw new ClientException(_m('No such answer.'), 404);
} }
$this->question = $this->answer->getQuestion(); $this->question = $this->answer->getQuestion();
if (empty($this->question)) { if (empty($this->question)) {
throw new ClientException(_('No question for this answer.'), 404); throw new ClientException(_m('No question for this answer.'), 404);
} }
$this->notice = Notice::staticGet('uri', $this->answer->uri); $this->notice = Notice::staticGet('uri', $this->answer->uri);
if (empty($this->notice)) { if (empty($this->notice)) {
// Did we used to have it, and it got deleted? // Did we used to have it, and it got deleted?
throw new ClientException(_('No such answer.'), 404); throw new ClientException(_m('No such answer.'), 404);
} }
$this->user = User::staticGet('id', $this->answer->profile_id); $this->user = User::staticGet('id', $this->answer->profile_id);
if (empty($this->user)) { if (empty($this->user)) {
throw new ClientException(_('No such user.'), 404); throw new ClientException(_m('No such user.'), 404);
} }
$this->profile = $this->user->getProfile(); $this->profile = $this->user->getProfile();
if (empty($this->profile)) { if (empty($this->profile)) {
throw new ServerException(_('User without a profile.')); throw new ServerException(_m('User without a profile.'));
} }
$this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE); $this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
@ -106,13 +104,12 @@ class QnashowanswerAction extends ShownoticeAction
* *
* @return string page tile * @return string page tile
*/ */
function title() function title()
{ {
$question = $this->answer->getQuestion(); $question = $this->answer->getQuestion();
return sprintf( return sprintf(
_('%s\'s answer to "%s"'), _m('%s\'s answer to "%s"'),
$this->user->nickname, $this->user->nickname,
$question->title $question->title
); );
@ -123,7 +120,6 @@ class QnashowanswerAction extends ShownoticeAction
* *
* @return void * @return void
*/ */
function showPageTitle() function showPageTitle()
{ {
$this->elementStart('h1'); $this->elementStart('h1');

View File

@ -205,8 +205,8 @@ class QnA_Answer extends Managed_DataObject
{ {
$notice = $question->getNotice(); $notice = $question->getNotice();
$fmt = '<span class="answer_author"><a href="%1s">answer</a> by <a href="%2s">%3s</a></span>'; $fmt = '<span class="answer_author"><a href="%1$s">answer</a> by <a href="%2$s">%3$s</a></span>';
$fmt .= '<span class="answer_content">%4s</span>'; $fmt .= '<span class="answer_content">%4$s</span>';
return sprintf( return sprintf(
$fmt, $fmt,
@ -221,8 +221,8 @@ class QnA_Answer extends Managed_DataObject
{ {
$notice = $question->getNotice(); $notice = $question->getNotice();
$fmt = _( $fmt = _m(
'%1s answered the question "%2s": %3s' '%1$s answered the question "%2$s": %3$s'
); );
return sprintf( return sprintf(

View File

@ -222,9 +222,9 @@ class QnA_Question extends Managed_DataObject
$notice = $question->getNotice(); $notice = $question->getNotice();
$fmt = '<div class="qna_question">'; $fmt = '<div class="qna_question">';
$fmt .= '<span class="question_title"><a href="%1s">%2s</a></span>'; $fmt .= '<span class="question_title"><a href="%1$s">%2$s</a></span>';
$fmt .= '<span class="question_description">%3s</span>'; $fmt .= '<span class="question_description">%3$s</span>';
$fmt .= '<span class="question_author">asked by <a href="%4s">%5s</a></span>'; $fmt .= '<span class="question_author">asked by <a href="%4$s">%5$s</a></span>';
$fmt .= '</div>'; $fmt .= '</div>';
$q = sprintf( $q = sprintf(
@ -251,8 +251,8 @@ class QnA_Question extends Managed_DataObject
static function toString($profile, $question, $answers) static function toString($profile, $question, $answers)
{ {
$fmt = _( $fmt = _m(
'%1s asked the question "%2s": %3s' '%1$s asked the question "%2$s": %3$s'
); );
return sprintf( return sprintf(