From: Robin Pepermans Date: Sat, 10 Sep 2011 20:05:13 +0000 (+0000) Subject: Correctly parse interface messages as such, so it doesn't get converted according... X-Git-Tag: 1.31.0-rc.0~27745 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dcompta/operations/modifier.php?a=commitdiff_plain;h=e4e6a2ec640a561594282660ffb48668f1e4ccae;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 7b68ecfa8b..42f81d0af1 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1312,9 +1312,9 @@ class OutputPage extends ContextSource { * @param $text String * @param $linestart Boolean: is this the start of a line? */ - public function addWikiText( $text, $linestart = true ) { + public function addWikiText( $text, $linestart = true, $interface = false ) { $title = $this->getTitle(); // Work arround E_STRICT - $this->addWikiTextTitle( $text, $title, $linestart ); + $this->addWikiTextTitle( $text, $title, $linestart, /*tidy*/false, $interface ); } /** @@ -1357,8 +1357,10 @@ class OutputPage extends ContextSource { * @param $title Title object * @param $linestart Boolean: is this the start of a line? * @param $tidy Boolean: whether to use tidy + * @param $interface Boolean: whether it is an interface message + * (for example disables conversion) */ - public function addWikiTextTitle( $text, &$title, $linestart, $tidy = false ) { + public function addWikiTextTitle( $text, &$title, $linestart, $tidy = false, $interface = false ) { global $wgParser; wfProfileIn( __METHOD__ ); @@ -1367,6 +1369,7 @@ class OutputPage extends ContextSource { $popts = $this->parserOptions(); $oldTidy = $popts->setTidy( $tidy ); + $popts->setInterfaceMessage( (bool) $interface ); $parserOutput = $wgParser->parse( $text, $title, $popts, @@ -1938,7 +1941,8 @@ class OutputPage extends ContextSource { $this->enableClientCache( false ); $this->mRedirect = ''; $this->mBodytext = ''; - $this->addWikiText( $this->formatPermissionsErrorMessage( $errors, $action ) ); + $this->addWikiText( $this->formatPermissionsErrorMessage( $errors, $action ), + /*linestart*/true, /*interface*/true ); } /** @@ -2077,7 +2081,8 @@ class OutputPage extends ContextSource { } else { $this->setPageTitle( wfMsg( 'badaccess' ) ); } - $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ) ); + $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ), + /*linestart*/true, /*interface*/true ); } else { // Wiki is read only throw new ReadOnlyError; @@ -3215,7 +3220,7 @@ $distantTemplates } $s = str_replace( '$' . ( $n + 1 ), wfMsgExt( $name, $options, $args ), $s ); } - $this->addWikiText( $s ); + $this->addWikiText( $s, /*linestart*/true, /*interface*/true ); } /** diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 4651fe6c8c..bb7daca841 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -64,7 +64,7 @@ class SpecialVersion extends SpecialPage { $text .= $this->getWgHooks(); } - $out->addWikiText( $text ); + $out->addWikiText( $text, /*linestart*/true, /*interface*/true ); $out->addHTML( $this->IPInfo() ); if ( $this->getRequest()->getVal( 'easteregg' ) ) { diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index e555319f88..f50c25fde4 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1842,7 +1842,7 @@ This cannot be undone.', 'yourrealname' => 'Real name:', 'yourlanguage' => 'Language:', 'yourvariant' => 'Content language variant:', -'prefs-help-variant' => 'Your preferred variant or orthography to display the content pages of this wiki in.', +'prefs-help-variant' => 'Your preferred variant or orthography to display the content pages of this wiki in.', 'yournick' => 'New signature:', 'prefs-help-signature' => 'Comments on talk pages should be signed with "~~~~" which will be converted into your signature and a timestamp.', 'badsig' => 'Invalid raw signature.