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
* @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');

View File

@ -205,8 +205,8 @@ class QnA_Answer extends Managed_DataObject
{
$notice = $question->getNotice();
$fmt = '<span class="answer_author"><a href="%1s">answer</a> by <a href="%2s">%3s</a></span>';
$fmt .= '<span class="answer_content">%4s</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">%4$s</span>';
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(

View File

@ -222,9 +222,9 @@ class QnA_Question extends Managed_DataObject
$notice = $question->getNotice();
$fmt = '<div class="qna_question">';
$fmt .= '<span class="question_title"><a href="%1s">%2s</a></span>';
$fmt .= '<span class="question_description">%3s</span>';
$fmt .= '<span class="question_author">asked by <a href="%4s">%5s</a></span>';
$fmt .= '<span class="question_title"><a href="%1$s">%2$s</a></span>';
$fmt .= '<span class="question_description">%3$s</span>';
$fmt .= '<span class="question_author">asked by <a href="%4$s">%5$s</a></span>';
$fmt .= '</div>';
$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(