r82696 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82695‎ | r82696 | r82697 >
Date:20:32, 23 February 2011
Author:mah
Status:ok (Comments)
Tags:
Comment:
(Bug #27634) TOC title appears in wrong language

Patch from P.Copp
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -3980,7 +3980,7 @@
39813981 if ( $prevtoclevel > 0 && $prevtoclevel < $wgMaxTocLevel ) {
39823982 $toc .= $sk->tocUnindent( $prevtoclevel - 1 );
39833983 }
3984 - $toc = $sk->tocList( $toc );
 3984+ $toc = $sk->tocList( $toc, $this->mOptions->getUserLang() );
39853985 $this->mOutput->setTOCHTML( $toc );
39863986 }
39873987
Index: trunk/phase3/includes/Linker.php
@@ -1322,10 +1322,11 @@
13231323 * Wraps the TOC in a table and provides the hide/collapse javascript.
13241324 *
13251325 * @param $toc String: html of the Table Of Contents
 1326+ * @param $lang mixed: Language code for the toc title
13261327 * @return String: full html of the TOC
13271328 */
1328 - function tocList( $toc ) {
1329 - $title = wfMsgHtml( 'toc' ) ;
 1329+ function tocList( $toc, $lang = false ) {
 1330+ $title = wfMsgExt( 'toc', array( 'language' => $lang, 'escape' ) );
13301331 return
13311332 '<table id="toc" class="toc"><tr><td>'
13321333 . '<div id="toctitle"><h2>' . $title . "</h2></div>\n"

Follow-up revisions

RevisionCommit summaryAuthorDate
r834871.17wmf1: MFT r82696, r83270, r83284, r83374, r83390, r83392, r83402, r83403,...catrope21:44, 7 March 2011
r85354MFT r82518, r82530, r82538, r82547, r82550, r82565, r82572, r82608, r82696, r...demon18:25, 4 April 2011

Comments

#Comment by MarkAHershberger (talk | contribs)   20:38, 23 February 2011

P.Copp warns "Note, that for trunk this will reintroduce the parser cache fragmentation, that has been tried to avoid by r79520 and follow-ups."

#Comment by Platonides (talk | contribs)   00:19, 25 February 2011

wfMsgHtml() is actually equivalent to wfMsgExt() with 'escape' and 'replaceafter', but as it has no parameters, the step at which the replace is done is irrelevant.

That cache fragmentation is already present in 1.17 and 1.17wmf1 so it's no blocker for deployment. It just means that we didn't achieve at removing it yet. ;)

Status & tagging log