r92975 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92974‎ | r92975 | r92976 >
Date:00:56, 24 July 2011
Author:robin
Status:ok (Comments)
Tags:
Comment:
Add lang & dir attributes around the recentchangestext message, because it is in the content language.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialRecentchanges.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRecentchanges.php
@@ -616,7 +616,12 @@
617617 * @param $opts FormOptions
618618 */
619619 function setTopText( FormOptions $opts ) {
620 - $this->getOutput()->addWikiText( wfMsgForContentNoTrans( 'recentchangestext' ) );
 620+ global $wgContLang;
 621+ $this->getOutput()->addWikiText(
 622+ Html::rawElement( 'p',
 623+ array( 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ),
 624+ wfMsgForContentNoTrans( 'recentchangestext' )
 625+ ), false );
621626 }
622627
623628 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r108359r92975 caused wikitable in MediaWiki:Recentchangestext (eg. enwiki)...platonides17:29, 8 January 2012

Comments

#Comment by Nikerabbit (talk | contribs)   06:34, 24 July 2011

Would ->addContentWikiMsg() be useful to get the wrapping automatically? Or is this kind of use too rare?

#Comment by SPQRobin (talk | contribs)   20:16, 24 July 2011

I think it would be quite rare, yes.

#Comment by Happy-melon (talk | contribs)   13:37, 10 August 2011

Why is this not translated?

#Comment by SPQRobin (talk | contribs)   14:42, 10 August 2011

Probably because it is often customised, see e.g. MediaWiki:Recentchangestext. If that message used translations, the custom links would not be shown when the user language is different from the content langauge.

As a sidenote, something that may be useful here as well is if it displayed translations only if the local page exists. (See also [https://bugzilla.wikimedia.org/show_bug.cgi?id=28423 bug 28423] for that.)

#Comment by Happy-melon (talk | contribs)   16:02, 10 August 2011

That does not alter the fact that it is an interface message that provides information that should be in a language the user can read. If it is customised, it should be customised in all relevant languages.

Status & tagging log