r105540 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105539‎ | r105540 | r105541 >
Date:11:53, 8 December 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Bug 31330 - Do not prefer templates over built-in language boxes.
Those templates sometimes are not compatible and break the layout - should also easen the migration path because those old language templates can now be retained until unused.
Modified paths:
  • /trunk/extensions/Babel/Babel.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Babel/Babel.class.php
@@ -39,15 +39,15 @@
4040 $template = wfMessage( 'babel-template', $name )->inContentLanguage()->text();
4141 if ( $name === '' ) {
4242 continue;
 43+ } elseif ( $components !== false ) {
 44+ // Non-existent page and valid parameter syntax, babel box
 45+ $content .= self::mGenerateBox( $components['code'], $components['level'] );
 46+ $content .= self::mGenerateCategories( $components['code'], $components['level'] );
4347 } elseif ( self::mPageExists( $template ) ) {
44 - // Existent template page has precedence
 48+ // Check for a template
4549 $templateParameters[0] = $template;
4650 $template = implode('|', $templateParameters);
4751 $content .= self::mGenerateNotaBox( $parser->replaceVariables( "{{{$template}}}" ) );
48 - } elseif ( $components !== false ) {
49 - // Non-existent page and valid parameter syntax, babel box
50 - $content .= self::mGenerateBox( $components['code'], $components['level'] );
51 - $content .= self::mGenerateCategories( $components['code'], $components['level'] );
5252 } elseif ( self::mValidTitle( $template ) ) {
5353 // Non-existent page and invalid parameter syntax, red link.
5454 $content .= self::mGenerateNotaBox( '[['.$template.']]' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r105909Babel: MFT r102899 r102900 r102912 r105540nikerabbit17:38, 12 December 2011
r112402(Bug 34680) Make babel extension case aware in order to avoid clashes with ex...robin17:19, 25 February 2012

Status & tagging log