From 165519fdf56b19d827d3b0311e4ea2b16b2e4f49 Mon Sep 17 00:00:00 2001 From: Robin Pepermans Date: Thu, 11 Aug 2011 19:58:23 +0000 Subject: [PATCH] =?utf8?q?*=20CategoryPage.php:=20fix=20the=20"category-em?= =?utf8?q?pty"=20message=20per=20comment=20on=20r91518,=20it=20was=20outsi?= =?utf8?q?de=20the=20bodyContent.=20And=20do=20not=20convert=20interface?= =?utf8?q?=20text.=20*=20Parser.php:=20Apparently=20that=20was=20a=20much?= =?utf8?q?=20bigger=20bug:=20do=20not=20convert=20interface=20text=20going?= =?utf8?q?=20through=20the=20parser=20either.=20*=20Preferences.php:=20Do?= =?utf8?q?=20not=20convert=20the=20user=20signature.=20For=20this=20bug=20?= =?utf8?q?in=20action,=20see=20e.g.=20http://sr.wikipedia.org/sr-ec/=D0=9F?= =?utf8?q?=D0=BE=D1=81=D0=B5=D0=B1=D0=BD=D0=BE:=D0=9F=D0=BE=D0=B4=D0=B5?= =?utf8?q?=D1=88=D0=B0=D0=B2=D0=B0=D1=9A=3Fuselang=3Den=20(e.g.=20"Usernam?= =?utf8?q?e"=20->=20"=D0=A3=D1=81=D0=B5=D1=80=D0=BD=D0=B0=D0=BC=D0=B5")?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- RELEASE-NOTES-1.19 | 1 + includes/CategoryPage.php | 14 +++++++------- includes/Preferences.php | 2 +- includes/parser/Parser.php | 15 +++++++++++++-- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 86fcf352b2..90b85b1470 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -40,6 +40,7 @@ production. when the function exists but is disabled. Introduced Maintenance::posix_isatty() * (bug 30264) Changed installer-generated LocalSettings.php to use require_once() instead require() for included extensions. +* Do not convert text in the user interface language to another script. === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 850256f071..42b06a307e 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -172,16 +172,16 @@ class CategoryViewer { // Give a proper message if category is empty if ( $r == '' ) { $r = wfMsgExt( 'category-empty', array( 'parse' ) ); + } else { + $pageLang = $this->title->getPageLanguage(); + $langAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() ); + # close the previous div, show the headings in user language, + # then open a new div with the page content language again + $r = '' . $r . Html::openElement( 'div', $langAttribs ); } - $pageLang = $this->title->getPageLanguage(); - $langAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() ); - # close the previous div, show the headings in user language, - # then open a new div with the page content language again - $r = '' . $r . Html::openElement( 'div', $langAttribs ); - wfProfileOut( __METHOD__ ); - return $wgContLang->convert( $r ); + return $r; } function clearCategoryState() { diff --git a/includes/Preferences.php b/includes/Preferences.php index d33822b3d4..0c8bf29161 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -314,7 +314,7 @@ class Preferences { // show a preview of the old signature first $oldsigWikiText = $wgParser->preSaveTransform( "~~~", new Title, $user, new ParserOptions ); - $oldsigHTML = $wgOut->parseInline( $oldsigWikiText ); + $oldsigHTML = $wgOut->parseInline( $oldsigWikiText, true, true ); $defaultPreferences['oldsig'] = array( 'type' => 'info', 'raw' => true, diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 714d9d312c..7b70362395 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -362,14 +362,16 @@ class Parser { $this->replaceLinkHolders( $text ); /** - * The page doesn't get language converted if + * The input doesn't get language converted if * a) It's disabled * b) Content isn't converted * c) It's a conversion table + * d) it is an interface message (which is in the user language) */ if ( !( $wgDisableLangConversion || isset( $this->mDoubleUnderscores['nocontentconvert'] ) - || $this->mTitle->isConversionTable() ) ) { + || $this->mTitle->isConversionTable() + || $this->mOptions->getInterfaceMessage() ) ) { # The position of the convert() call should not be changed. it # assumes that the links are all replaced and the only thing left @@ -1996,6 +1998,15 @@ class Parser { } wfProfileOut( __METHOD__."-interwiki" ); + # Interprojects + wfProfileIn( __METHOD__."-interproject" ); + global $wgInterProjectLinks; + if ( is_array( $wgInterProjectLinks ) && isset( $wgInterProjectLinks[$iw] ) && $nottalk ) { + $this->mOutput->addInterProjectLink( $iw, $nt, ( $wasblank ? '' : $text ) ); + wfProfileOut( __METHOD__."-interproject" ); + } + wfProfileOut( __METHOD__."-interproject" ); + if ( $ns == NS_FILE ) { wfProfileIn( __METHOD__."-image" ); if ( !wfIsBadImage( $nt->getDBkey(), $this->mTitle ) ) { -- 2.20.1