(Bug #27634) TOC title appears in wrong language
authorMark A. Hershberger <mah@users.mediawiki.org>
Wed, 23 Feb 2011 20:32:57 +0000 (20:32 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Wed, 23 Feb 2011 20:32:57 +0000 (20:32 +0000)
Patch from P.Copp

includes/Linker.php
includes/parser/Parser.php

index e6624eb..568ac61 100644 (file)
@@ -1322,10 +1322,11 @@ class Linker {
         * Wraps the TOC in a table and provides the hide/collapse javascript.
         *
         * @param $toc String: html of the Table Of Contents
+        * @param $lang mixed: Language code for the toc title
         * @return String: full html of the TOC
         */
-       function tocList( $toc ) {
-               $title = wfMsgHtml( 'toc' ) ;
+       function tocList( $toc, $lang = false ) {
+               $title = wfMsgExt( 'toc', array( 'language' => $lang, 'escape' ) );
                return
                   '<table id="toc" class="toc"><tr><td>'
                 . '<div id="toctitle"><h2>' . $title . "</h2></div>\n"
index afa3934..9e75c32 100644 (file)
@@ -3980,7 +3980,7 @@ class Parser {
                        if ( $prevtoclevel > 0 && $prevtoclevel < $wgMaxTocLevel ) {
                                $toc .= $sk->tocUnindent( $prevtoclevel - 1 );
                        }
-                       $toc = $sk->tocList( $toc );
+                       $toc = $sk->tocList( $toc, $this->mOptions->getUserLang() );
                        $this->mOutput->setTOCHTML( $toc );
                }