i18n: Apply lang on UI messages on diff table
authorEbrahim Byagowi <ebrahim@gnu.org>
Fri, 17 Apr 2015 21:49:52 +0000 (21:49 +0000)
committerEbrahim Byagowi <ebrahim@gnu.org>
Sat, 18 Apr 2015 08:56:01 +0000 (08:56 +0000)
Change-Id: Ib37e4f9115e935fa60b461c2fcc36047fe4c9dc6

includes/diff/DifferenceEngine.php

index 77bbd36..2c63dfb 100644 (file)
@@ -1077,10 +1077,11 @@ class DifferenceEngine extends ContextSource {
                // is often in a different language, mostly the page content language/dir
                $tableClass = 'diff diff-contentalign-' . htmlspecialchars( $this->getDiffLang()->alignStart() );
                $header = "<table class='$tableClass'>";
+               $userLang = htmlspecialchars( $this->getLanguage()->getHtmlCode() );
 
                if ( !$diff && !$otitle ) {
                        $header .= "
-                       <tr style='vertical-align: top;'>
+                       <tr style='vertical-align: top;' lang='{$userLang}'>
                        <td class='diff-ntitle'>{$ntitle}</td>
                        </tr>";
                        $multiColspan = 1;
@@ -1099,7 +1100,7 @@ class DifferenceEngine extends ContextSource {
                        }
                        if ( $otitle || $ntitle ) {
                                $header .= "
-                               <tr style='vertical-align: top;'>
+                               <tr style='vertical-align: top;' lang='{$userLang}'>
                                <td colspan='$colspan' class='diff-otitle'>{$otitle}</td>
                                <td colspan='$colspan' class='diff-ntitle'>{$ntitle}</td>
                                </tr>";
@@ -1108,10 +1109,11 @@ class DifferenceEngine extends ContextSource {
 
                if ( $multi != '' ) {
                        $header .= "<tr><td colspan='{$multiColspan}' style='text-align: center;' " .
-                               "class='diff-multi'>{$multi}</td></tr>";
+                               "class='diff-multi' lang='{$userLang}'>{$multi}</td></tr>";
                }
                if ( $notice != '' ) {
-                       $header .= "<tr><td colspan='{$multiColspan}' style='text-align: center;'>{$notice}</td></tr>";
+                       $header .= "<tr><td colspan='{$multiColspan}' style='text-align: center;' " .
+                               "lang='{$userLang}'>{$notice}</td></tr>";
                }
 
                return $header . $diff . "</table>";