Remove $wgMediaInTargetLanguage
authorMax Semenik <maxsem.wiki@gmail.com>
Fri, 8 Mar 2019 23:23:10 +0000 (15:23 -0800)
committerMax Semenik <maxsem.wiki@gmail.com>
Fri, 8 Mar 2019 23:24:39 +0000 (15:24 -0800)
It's a temporary feature flag not included in any release, just
removing it outright. The functonality will now be always enabled.

Bug: T205040
Change-Id: Ia9da82e6f6b2d270f1790a99fc8c35ad5e6aee5e

RELEASE-NOTES-1.33
includes/parser/Parser.php
tests/parser/ParserTestRunner.php
tests/parser/parserTests.txt

index 0180763..d8879fc 100644 (file)
@@ -11,8 +11,6 @@ production.
 * $wgEnablePartialBlocks – This enables the Partial Blocks feature, which gives
   accounts with block permissions the ability to block users, IPs, and IP ranges
   from editing specific pages, while allowing them to edit the rest of the wiki.
-* $wgMediaInTargetLanguage – whether multilingual images should be dispalyed in
-  the current parse language where available.
 
 ==== Changed configuration ====
 * Some external link searches will not work correctly until update.php (or
@@ -61,6 +59,8 @@ production.
   (requires PHP 7.2+) and GPU hacking (7.3+).
 * Special:CreateAccount now warns the user if their chosen username has to be
   normalized.
+* (T205040) Multilingual images are now be displayed in the current parse
+  language where available.
 
 === External library changes in 1.33 ===
 
index 04d3c85..546152f 100644 (file)
@@ -5282,8 +5282,6 @@ class Parser {
                #  * bottom
                #  * text-bottom
 
-               global $wgMediaInTargetLanguage;
-
                # Protect LanguageConverter markup when splitting into parts
                $parts = StringUtils::delimiterExplode(
                        '-{', '}-', '|', $options, true /* allow nesting */
@@ -5444,9 +5442,7 @@ class Parser {
                        # Use the "caption" for the tooltip text
                        $params['frame']['title'] = $this->stripAltText( $caption, $holders );
                }
-               if ( $wgMediaInTargetLanguage ) {
-                       $params['handler']['targetlang'] = $this->getTargetLanguage()->getCode();
-               }
+               $params['handler']['targetlang'] = $this->getTargetLanguage()->getCode();
 
                Hooks::run( 'ParserMakeImageParams', [ $title, $file, &$params, $this ] );
 
index 0e6a3ee..699de95 100644 (file)
@@ -282,7 +282,6 @@ class ParserTestRunner {
                $setup['wgHtml5'] = true;
                $setup['wgDisableLangConversion'] = false;
                $setup['wgDisableTitleConversion'] = false;
-               $setup['wgMediaInTargetLanguage'] = false;
 
                // "extra language links"
                // see https://gerrit.wikimedia.org/r/111390
@@ -1090,7 +1089,6 @@ class ParserTestRunner {
                                + [ 'ISBN' => true, 'PMID' => true, 'RFC' => true ],
                        // Test with legacy encoding by default until HTML5 is very stable and default
                        'wgFragmentMode' => [ 'legacy' ],
-                       'wgMediaInTargetLanguage' => self::getOptionValue( 'wgMediaInTargetLanguage', $opts, false ),
                ];
 
                $nonIncludable = self::getOptionValue( 'wgNonincludableNamespaces', $opts, false );
index a73d036..7ef057a 100644 (file)
@@ -37,7 +37,7 @@
 # You can also set the following parser properties via test options:
 #  wgEnableUploads, wgAllowExternalImages, wgMaxTocLevel,
 #  wgLinkHolderBatchSize, wgRawHtml, wgInterwikiMagic,
-#  wgEnableMagicLinks, wgMediaInTargetLanguage
+#  wgEnableMagicLinks
 #
 # For testing purposes, temporary articles can created:
 # !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle
@@ -15955,7 +15955,6 @@ parsoid=wt2html,wt2wt,html2html
 SVG thumbnails in page language
 !! options
 language=ru
-wgMediaInTargetLanguage = true
 !! wikitext
 [[File:Foobar.svg]] [[File:Foobar.svg|lang=en]]
 !! html/php
@@ -15967,7 +15966,6 @@ wgMediaInTargetLanguage = true
 SVG thumbnails in page language not present in the file
 !! options
 language=de
-wgMediaInTargetLanguage = true
 !! wikitext
 [[File:Foobar.svg]] [[File:Foobar.svg|lang=ru]]
 !! html/php