From: Robin Pepermans Date: Thu, 11 Aug 2011 19:58:23 +0000 (+0000) Subject: * CategoryPage.php: fix the "category-empty" message per comment on r91518, it was... X-Git-Tag: 1.31.0-rc.0~28346 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=165519fdf56b19d827d3b0311e4ea2b16b2e4f49;p=lhc%2Fweb%2Fwiklou.git * CategoryPage.php: fix the "category-empty" message per comment on r91518, it was outside the bodyContent. And do not convert interface text. * Parser.php: Apparently that was a much bigger bug: do not convert interface text going through the parser either. * Preferences.php: Do not convert the user signature. For this bug in action, see e.g. http://sr.wikipedia.org/sr-ec/Посебно:Подешавањ?uselang=en (e.g. "Username" -> "Усернаме") --- 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 ) ) {