Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -370,13 +370,16 @@ |
371 | 371 | */ |
372 | 372 | if ( !( $wgDisableLangConversion |
373 | 373 | || isset( $this->mDoubleUnderscores['nocontentconvert'] ) |
374 | | - || $this->mTitle->isConversionTable() |
375 | | - || $this->mOptions->getInterfaceMessage() ) ) { |
376 | | - |
377 | | - # The position of the convert() call should not be changed. it |
378 | | - # assumes that the links are all replaced and the only thing left |
379 | | - # is the <nowiki> mark. |
380 | | - $text = $this->getTargetLanguage()->convert( $text ); |
| 374 | + || $this->mTitle->isConversionTable() ) ) |
| 375 | + { |
| 376 | + # Run convert unconditionally in 1.18-compatible mode |
| 377 | + global $wgBug34832TransitionalRollback; |
| 378 | + if ( $wgBug34832TransitionalRollback || !$this->mOptions->getInterfaceMessage() ) { |
| 379 | + # The position of the convert() call should not be changed. it |
| 380 | + # assumes that the links are all replaced and the only thing left |
| 381 | + # is the <nowiki> mark. |
| 382 | + $text = $this->getConverterLanguage()->convert( $text ); |
| 383 | + } |
381 | 384 | } |
382 | 385 | |
383 | 386 | /** |
— | — | @@ -392,11 +395,11 @@ |
393 | 396 | || isset( $this->mDoubleUnderscores['notitleconvert'] ) |
394 | 397 | || $this->mOutput->getDisplayTitle() !== false ) ) |
395 | 398 | { |
396 | | - $convruletitle = $this->getTargetLanguage()->getConvRuleTitle(); |
| 399 | + $convruletitle = $this->getConverterLanguage()->getConvRuleTitle(); |
397 | 400 | if ( $convruletitle ) { |
398 | 401 | $this->mOutput->setTitleText( $convruletitle ); |
399 | 402 | } else { |
400 | | - $titleText = $this->getTargetLanguage()->convertTitle( $title ); |
| 403 | + $titleText = $this->getConverterLanguage()->convertTitle( $title ); |
401 | 404 | $this->mOutput->setTitleText( $titleText ); |
402 | 405 | } |
403 | 406 | } |
— | — | @@ -717,6 +720,18 @@ |
718 | 721 | } |
719 | 722 | |
720 | 723 | /** |
| 724 | + * Get the language object for language conversion |
| 725 | + */ |
| 726 | + function getConverterLanguage() { |
| 727 | + global $wgBug34832TransitionalRollback, $wgContLang; |
| 728 | + if ( $wgBug34832TransitionalRollback ) { |
| 729 | + return $wgContLang; |
| 730 | + } else { |
| 731 | + return $this->getTargetLanguage(); |
| 732 | + } |
| 733 | + } |
| 734 | + |
| 735 | + /** |
721 | 736 | * Get a User object either from $this->mUser, if set, or from the |
722 | 737 | * ParserOptions object otherwise |
723 | 738 | * |
— | — | @@ -1237,7 +1252,7 @@ |
1238 | 1253 | if ( $text === false ) { |
1239 | 1254 | # Not an image, make a link |
1240 | 1255 | $text = Linker::makeExternalLink( $url, |
1241 | | - $this->getTargetLanguage()->markNoConversion($url), true, 'free', |
| 1256 | + $this->getConverterLanguage()->markNoConversion($url), true, 'free', |
1242 | 1257 | $this->getExternalLinkAttribs( $url ) ); |
1243 | 1258 | # Register it in the output object... |
1244 | 1259 | # Replace unnecessary URL escape codes with their equivalent characters |
— | — | @@ -1510,7 +1525,7 @@ |
1511 | 1526 | list( $dtrail, $trail ) = Linker::splitTrail( $trail ); |
1512 | 1527 | } |
1513 | 1528 | |
1514 | | - $text = $this->getTargetLanguage()->markNoConversion( $text ); |
| 1529 | + $text = $this->getConverterLanguage()->markNoConversion( $text ); |
1515 | 1530 | |
1516 | 1531 | $url = Sanitizer::cleanUrl( $url ); |
1517 | 1532 | |
— | — | @@ -1716,8 +1731,8 @@ |
1717 | 1732 | $prefix = ''; |
1718 | 1733 | } |
1719 | 1734 | |
1720 | | - if ( $this->getTargetLanguage()->hasVariants() ) { |
1721 | | - $selflink = $this->getTargetLanguage()->autoConvertToAllVariants( |
| 1735 | + if ( $this->getConverterLanguage()->hasVariants() ) { |
| 1736 | + $selflink = $this->getConverterLanguage()->autoConvertToAllVariants( |
1722 | 1737 | $this->mTitle->getPrefixedText() ); |
1723 | 1738 | } else { |
1724 | 1739 | $selflink = array( $this->mTitle->getPrefixedText() ); |
— | — | @@ -1936,7 +1951,7 @@ |
1937 | 1952 | } |
1938 | 1953 | $sortkey = Sanitizer::decodeCharReferences( $sortkey ); |
1939 | 1954 | $sortkey = str_replace( "\n", '', $sortkey ); |
1940 | | - $sortkey = $this->getTargetLanguage()->convertCategoryKey( $sortkey ); |
| 1955 | + $sortkey = $this->getConverterLanguage()->convertCategoryKey( $sortkey ); |
1941 | 1956 | $this->mOutput->addCategory( $nt->getDBkey(), $sortkey ); |
1942 | 1957 | |
1943 | 1958 | /** |
— | — | @@ -3214,8 +3229,8 @@ |
3215 | 3230 | if ( $title ) { |
3216 | 3231 | $titleText = $title->getPrefixedText(); |
3217 | 3232 | # Check for language variants if the template is not found |
3218 | | - if ( $this->getTargetLanguage()->hasVariants() && $title->getArticleID() == 0 ) { |
3219 | | - $this->getTargetLanguage()->findVariantLink( $part1, $title, true ); |
| 3233 | + if ( $this->getConverterLanguage()->hasVariants() && $title->getArticleID() == 0 ) { |
| 3234 | + $this->getConverterLanguage()->findVariantLink( $part1, $title, true ); |
3220 | 3235 | } |
3221 | 3236 | # Do recursion depth check |
3222 | 3237 | $limit = $this->mOptions->getMaxTemplateDepth(); |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2178,6 +2178,17 @@ |
2179 | 2179 | */ |
2180 | 2180 | $wgLocalTZoffset = null; |
2181 | 2181 | |
| 2182 | +/** |
| 2183 | + * If set to true, this will roll back a few bug fixes introduced in 1.19, |
| 2184 | + * emulating the 1.18 behaviour, to avoid introducing bug 34832. In 1.19, |
| 2185 | + * language variant conversion is disabled in interface messages. Setting this |
| 2186 | + * to true re-enables it. |
| 2187 | + * |
| 2188 | + * This variable should be removed (implicitly false) in 1.20 or earlier. |
| 2189 | + */ |
| 2190 | +$wgBug34832TransitionalRollback = true; |
| 2191 | + |
| 2192 | + |
2182 | 2193 | /** @} */ # End of language/charset settings |
2183 | 2194 | |
2184 | 2195 | /*************************************************************************//** |