From: Siebrand Mazeland Date: Fri, 1 Apr 2011 17:55:15 +0000 (+0200) Subject: Fix i18n issues. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=62eed1e23ef641aedad0afa4f0d4cef604750d85;p=quix0rs-gnu-social.git Fix i18n issues. Fix incorrect variable usage in messages. --- diff --git a/plugins/QnA/actions/qnashowanswer.php b/plugins/QnA/actions/qnashowanswer.php index 5f3bc2eed9..826172c099 100644 --- a/plugins/QnA/actions/qnashowanswer.php +++ b/plugins/QnA/actions/qnashowanswer.php @@ -44,7 +44,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class QnashowanswerAction extends ShownoticeAction { protected $answer = null; @@ -56,7 +55,6 @@ class QnashowanswerAction extends ShownoticeAction * * @return boolean true */ - function prepare($argarray) { OwnerDesignAction::prepare($argarray); @@ -66,32 +64,32 @@ class QnashowanswerAction extends ShownoticeAction $this->answer = QnA_Answer::staticGet('id', $this->id); if (empty($this->answer)) { - throw new ClientException(_('No such answer.'), 404); + throw new ClientException(_m('No such answer.'), 404); } $this->question = $this->answer->getQuestion(); 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); if (empty($this->notice)) { // 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); if (empty($this->user)) { - throw new ClientException(_('No such user.'), 404); + throw new ClientException(_m('No such user.'), 404); } $this->profile = $this->user->getProfile(); 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); @@ -106,13 +104,12 @@ class QnashowanswerAction extends ShownoticeAction * * @return string page tile */ - function title() { $question = $this->answer->getQuestion(); return sprintf( - _('%s\'s answer to "%s"'), + _m('%s\'s answer to "%s"'), $this->user->nickname, $question->title ); @@ -123,7 +120,6 @@ class QnashowanswerAction extends ShownoticeAction * * @return void */ - function showPageTitle() { $this->elementStart('h1'); diff --git a/plugins/QnA/classes/QnA_Answer.php b/plugins/QnA/classes/QnA_Answer.php index 06e88354c9..5727411a80 100644 --- a/plugins/QnA/classes/QnA_Answer.php +++ b/plugins/QnA/classes/QnA_Answer.php @@ -205,8 +205,8 @@ class QnA_Answer extends Managed_DataObject { $notice = $question->getNotice(); - $fmt = 'answer by %3s'; - $fmt .= '%4s'; + $fmt = 'answer by %3$s'; + $fmt .= '%4$s'; return sprintf( $fmt, @@ -221,8 +221,8 @@ class QnA_Answer extends Managed_DataObject { $notice = $question->getNotice(); - $fmt = _( - '%1s answered the question "%2s": %3s' + $fmt = _m( + '%1$s answered the question "%2$s": %3$s' ); return sprintf( diff --git a/plugins/QnA/classes/QnA_Question.php b/plugins/QnA/classes/QnA_Question.php index 1022f2c3a6..2403857d28 100644 --- a/plugins/QnA/classes/QnA_Question.php +++ b/plugins/QnA/classes/QnA_Question.php @@ -222,9 +222,9 @@ class QnA_Question extends Managed_DataObject $notice = $question->getNotice(); $fmt = '
'; - $fmt .= '%2s'; - $fmt .= '%3s'; - $fmt .= 'asked by %5s'; + $fmt .= '%2$s'; + $fmt .= '%3$s'; + $fmt .= 'asked by %5$s'; $fmt .= '
'; $q = sprintf( @@ -251,8 +251,8 @@ class QnA_Question extends Managed_DataObject static function toString($profile, $question, $answers) { - $fmt = _( - '%1s asked the question "%2s": %3s' + $fmt = _m( + '%1$s asked the question "%2$s": %3$s' ); return sprintf(