Display SVGs in target language
[lhc/web/wiklou.git] / includes / parser / Parser.php
index 3509200..721d1fb 100644 (file)
@@ -5258,6 +5258,8 @@ class Parser {
                #  * bottom
                #  * text-bottom
 
+               global $wgMediaInTargetLanguage;
+
                # Protect LanguageConverter markup when splitting into parts
                $parts = StringUtils::delimiterExplode(
                        '-{', '}-', '|', $options, true /* allow nesting */
@@ -5415,6 +5417,9 @@ class Parser {
                        # Use the "caption" for the tooltip text
                        $params['frame']['title'] = $this->stripAltText( $caption, $holders );
                }
+               if ( $wgMediaInTargetLanguage ) {
+                       $params['handler']['targetlang'] = $this->getTargetLanguage()->getCode();
+               }
 
                Hooks::run( 'ParserMakeImageParams', [ $title, $file, &$params, $this ] );