r96737 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96736‎ | r96737 | r96738 >
Date:20:05, 10 September 2011
Author:robin
Status:resolved (Comments)
Tags:
Comment:
Correctly parse interface messages as such, so it doesn't get converted according to the content language (like r96257/r94395/r94279)

Also whitespace fix in MessagesEn for r96723
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -1312,9 +1312,9 @@
13131313 * @param $text String
13141314 * @param $linestart Boolean: is this the start of a line?
13151315 */
1316 - public function addWikiText( $text, $linestart = true ) {
 1316+ public function addWikiText( $text, $linestart = true, $interface = false ) {
13171317 $title = $this->getTitle(); // Work arround E_STRICT
1318 - $this->addWikiTextTitle( $text, $title, $linestart );
 1318+ $this->addWikiTextTitle( $text, $title, $linestart, /*tidy*/false, $interface );
13191319 }
13201320
13211321 /**
@@ -1357,8 +1357,10 @@
13581358 * @param $title Title object
13591359 * @param $linestart Boolean: is this the start of a line?
13601360 * @param $tidy Boolean: whether to use tidy
 1361+ * @param $interface Boolean: whether it is an interface message
 1362+ * (for example disables conversion)
13611363 */
1362 - public function addWikiTextTitle( $text, &$title, $linestart, $tidy = false ) {
 1364+ public function addWikiTextTitle( $text, &$title, $linestart, $tidy = false, $interface = false ) {
13631365 global $wgParser;
13641366
13651367 wfProfileIn( __METHOD__ );
@@ -1367,6 +1369,7 @@
13681370
13691371 $popts = $this->parserOptions();
13701372 $oldTidy = $popts->setTidy( $tidy );
 1373+ $popts->setInterfaceMessage( (bool) $interface );
13711374
13721375 $parserOutput = $wgParser->parse(
13731376 $text, $title, $popts,
@@ -1938,7 +1941,8 @@
19391942 $this->enableClientCache( false );
19401943 $this->mRedirect = '';
19411944 $this->mBodytext = '';
1942 - $this->addWikiText( $this->formatPermissionsErrorMessage( $errors, $action ) );
 1945+ $this->addWikiText( $this->formatPermissionsErrorMessage( $errors, $action ),
 1946+ /*linestart*/true, /*interface*/true );
19431947 }
19441948
19451949 /**
@@ -2077,7 +2081,8 @@
20782082 } else {
20792083 $this->setPageTitle( wfMsg( 'badaccess' ) );
20802084 }
2081 - $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ) );
 2085+ $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ),
 2086+ /*linestart*/true, /*interface*/true );
20822087 } else {
20832088 // Wiki is read only
20842089 throw new ReadOnlyError;
@@ -3215,7 +3220,7 @@
32163221 }
32173222 $s = str_replace( '$' . ( $n + 1 ), wfMsgExt( $name, $options, $args ), $s );
32183223 }
3219 - $this->addWikiText( $s );
 3224+ $this->addWikiText( $s, /*linestart*/true, /*interface*/true );
32203225 }
32213226
32223227 /**
Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -64,7 +64,7 @@
6565 $text .= $this->getWgHooks();
6666 }
6767
68 - $out->addWikiText( $text );
 68+ $out->addWikiText( $text, /*linestart*/true, /*interface*/true );
6969 $out->addHTML( $this->IPInfo() );
7070
7171 if ( $this->getRequest()->getVal( 'easteregg' ) ) {
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1842,7 +1842,7 @@
18431843 'yourrealname' => 'Real name:',
18441844 'yourlanguage' => 'Language:',
18451845 'yourvariant' => 'Content language variant:',
1846 -'prefs-help-variant' => 'Your preferred variant or orthography to display the content pages of this wiki in.',
 1846+'prefs-help-variant' => 'Your preferred variant or orthography to display the content pages of this wiki in.',
18471847 'yournick' => 'New signature:',
18481848 'prefs-help-signature' => 'Comments on talk pages should be signed with "<nowiki>~~~~</nowiki>" which will be converted into your signature and a timestamp.',
18491849 'badsig' => 'Invalid raw signature.

Follow-up revisions

RevisionCommit summaryAuthorDate
r96812* r96737: set OutputPage->addWikiText() as an interface message by default...robin21:07, 11 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94279* CategoryPage.php: fix the "category-empty" message per comment on r91518, i...robin19:58, 11 August 2011
r94395Mark wfMsgWikiHtml() as an interface message so it doesn't get converted acco...robin23:14, 12 August 2011
r96257Correctly parse interface messages as such, so it doesn't get converted accor...robin21:19, 4 September 2011
r96723* Change the message 'yourvariant' to a more descriptive one (might be a bit ...robin17:12, 10 September 2011

Comments

#Comment by SPQRobin (talk | contribs)   20:05, 10 September 2011

Status & tagging log