Introduce a global variable which causes language conversion to not be disabled in interface messages (as before r94279). Use $wgContLang for conversion (as before r97849) since $wgContLang is set to the base language (e.g. zh) on converter wikis, whereas a typical user language (e.g. zh-tw) only has a FakeConverter.
*/
$wgLocalTZoffset = null;
*/
$wgLocalTZoffset = null;
+/**
+ * If set to true, this will roll back a few bug fixes introduced in 1.19,
+ * emulating the 1.18 behaviour, to avoid introducing bug 34832. In 1.19,
+ * language variant conversion is disabled in interface messages. Setting this
+ * to true re-enables it.
+ *
+ * This variable should be removed (implicitly false) in 1.20 or earlier.
+ */
+$wgBug34832TransitionalRollback = true;
+
+
/** @} */ # End of language/charset settings
/*************************************************************************//**
/** @} */ # End of language/charset settings
/*************************************************************************//**
*/
if ( !( $wgDisableLangConversion
|| isset( $this->mDoubleUnderscores['nocontentconvert'] )
*/
if ( !( $wgDisableLangConversion
|| isset( $this->mDoubleUnderscores['nocontentconvert'] )
- || $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
- # is the <nowiki> mark.
- $text = $this->getTargetLanguage()->convert( $text );
+ || $this->mTitle->isConversionTable() ) )
+ {
+ # Run convert unconditionally in 1.18-compatible mode
+ global $wgBug34832TransitionalRollback;
+ if ( $wgBug34832TransitionalRollback || !$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
+ # is the <nowiki> mark.
+ $text = $this->getConverterLanguage()->convert( $text );
+ }
|| isset( $this->mDoubleUnderscores['notitleconvert'] )
|| $this->mOutput->getDisplayTitle() !== false ) )
{
|| isset( $this->mDoubleUnderscores['notitleconvert'] )
|| $this->mOutput->getDisplayTitle() !== false ) )
{
- $convruletitle = $this->getTargetLanguage()->getConvRuleTitle();
+ $convruletitle = $this->getConverterLanguage()->getConvRuleTitle();
if ( $convruletitle ) {
$this->mOutput->setTitleText( $convruletitle );
} else {
if ( $convruletitle ) {
$this->mOutput->setTitleText( $convruletitle );
} else {
- $titleText = $this->getTargetLanguage()->convertTitle( $title );
+ $titleText = $this->getConverterLanguage()->convertTitle( $title );
$this->mOutput->setTitleText( $titleText );
}
}
$this->mOutput->setTitleText( $titleText );
}
}
return $this->mTitle->getPageLanguage();
}
return $this->mTitle->getPageLanguage();
}
+ /**
+ * Get the language object for language conversion
+ */
+ function getConverterLanguage() {
+ global $wgBug34832TransitionalRollback, $wgContLang;
+ if ( $wgBug34832TransitionalRollback ) {
+ return $wgContLang;
+ } else {
+ return $this->getTargetLanguage();
+ }
+ }
+
/**
* Get a User object either from $this->mUser, if set, or from the
* ParserOptions object otherwise
/**
* Get a User object either from $this->mUser, if set, or from the
* ParserOptions object otherwise
if ( $text === false ) {
# Not an image, make a link
$text = Linker::makeExternalLink( $url,
if ( $text === false ) {
# Not an image, make a link
$text = Linker::makeExternalLink( $url,
- $this->getTargetLanguage()->markNoConversion($url), true, 'free',
+ $this->getConverterLanguage()->markNoConversion($url), true, 'free',
$this->getExternalLinkAttribs( $url ) );
# Register it in the output object...
# Replace unnecessary URL escape codes with their equivalent characters
$this->getExternalLinkAttribs( $url ) );
# Register it in the output object...
# Replace unnecessary URL escape codes with their equivalent characters
list( $dtrail, $trail ) = Linker::splitTrail( $trail );
}
list( $dtrail, $trail ) = Linker::splitTrail( $trail );
}
- $text = $this->getTargetLanguage()->markNoConversion( $text );
+ $text = $this->getConverterLanguage()->markNoConversion( $text );
$url = Sanitizer::cleanUrl( $url );
$url = Sanitizer::cleanUrl( $url );
- if ( $this->getTargetLanguage()->hasVariants() ) {
- $selflink = $this->getTargetLanguage()->autoConvertToAllVariants(
+ if ( $this->getConverterLanguage()->hasVariants() ) {
+ $selflink = $this->getConverterLanguage()->autoConvertToAllVariants(
$this->mTitle->getPrefixedText() );
} else {
$selflink = array( $this->mTitle->getPrefixedText() );
$this->mTitle->getPrefixedText() );
} else {
$selflink = array( $this->mTitle->getPrefixedText() );
}
$sortkey = Sanitizer::decodeCharReferences( $sortkey );
$sortkey = str_replace( "\n", '', $sortkey );
}
$sortkey = Sanitizer::decodeCharReferences( $sortkey );
$sortkey = str_replace( "\n", '', $sortkey );
- $sortkey = $this->getTargetLanguage()->convertCategoryKey( $sortkey );
+ $sortkey = $this->getConverterLanguage()->convertCategoryKey( $sortkey );
$this->mOutput->addCategory( $nt->getDBkey(), $sortkey );
/**
$this->mOutput->addCategory( $nt->getDBkey(), $sortkey );
/**
if ( $title ) {
$titleText = $title->getPrefixedText();
# Check for language variants if the template is not found
if ( $title ) {
$titleText = $title->getPrefixedText();
# Check for language variants if the template is not found
- if ( $this->getTargetLanguage()->hasVariants() && $title->getArticleID() == 0 ) {
- $this->getTargetLanguage()->findVariantLink( $part1, $title, true );
+ if ( $this->getConverterLanguage()->hasVariants() && $title->getArticleID() == 0 ) {
+ $this->getConverterLanguage()->findVariantLink( $part1, $title, true );
}
# Do recursion depth check
$limit = $this->mOptions->getMaxTemplateDepth();
}
# Do recursion depth check
$limit = $this->mOptions->getMaxTemplateDepth();