Change-Id: I333021ee4edc7481b664986c27e12fbcac9d0d08
* @return String: full html of the TOC
*/
public static function tocList( $toc, $lang = false ) {
- $msg = wfMessage( 'toc' );
- if ( $lang !== false ) {
- $msg = $msg->inLanguage( $lang );
- }
- $title = $msg->escaped();
+ $lang = wfGetLangObj( $lang );
+ $title = wfMessage( 'toc' )->inLanguage( $lang )->escaped();
+
return
'<table id="toc" class="toc"><tr><td>'
. '<div id="toctitle"><h2>' . $title . "</h2></div>\n"