r72508 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72507‎ | r72508 | r72509 >
Date:20:11, 6 September 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Don't display warning of outdated translations if not applicable.

Does extra query for now, but could use the cache later.
Modified paths:
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -455,9 +455,14 @@
456456
457457 $wgOut->wrapWikiMsg( $wrap, array( 'tpt-translation-intro', $url, $titleText, $per ) );
458458
459 - if ( ( (int) $per ) < 100 ) {
460 - $wrap = '<div style="font-size: x-small; text-align: center" class="mw-translate-fuzzy">$1</div>';
461 - $wgOut->wrapWikiMsg( $wrap, array( 'tpt-translation-intro-fuzzy' ) );
 459+ if ( ((int) $per) < 100 ) {
 460+ $group = MessageGroups::getGroup( 'page|' . $page->getTitle()->getPrefixedText() );
 461+ $collection = $group->initCollection( $code );
 462+ $collection->filter( 'fuzzy', false );
 463+ if ( count( $collection ) ) {
 464+ $wrap = '<div style="font-size: x-small; text-align: center" class="mw-translate-fuzzy">$1</div>';
 465+ $wgOut->wrapWikiMsg( $wrap, array( 'tpt-translation-intro-fuzzy' ) );
 466+ }
462467 }
463468
464469 $wgOut->addHTML( '<hr />' );

Status & tagging log