r86700 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86699‎ | r86700 | r86701 >
Date:11:28, 22 April 2011
Author:nikerabbit
Status:deferred
Tags:
Comment:
New namespace filter for search
Modified paths:
  • /trunk/extensions/Translate/Translate.i18n.php (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/TranslateEditAddons.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/TranslateEditAddons.php
@@ -485,4 +485,17 @@
486486 $out->addHtml( $output );
487487 return false;
488488 }
 489+
 490+ public static function searchProfile( &$profiles ) {
 491+ global $wgTranslateMessageNamespaces;
 492+ $insert = array();
 493+ $insert['translation'] = array(
 494+ 'message' => 'translate-searchprofile',
 495+ 'tooltip' => 'translate-searchprofile-tooltip',
 496+ 'namespaces' => $wgTranslateMessageNamespaces,
 497+ );
 498+
 499+ $profiles = wfArrayInsertAfter( $profiles, $insert, 'help' );
 500+ return true;
 501+ }
489502 }
Index: trunk/extensions/Translate/Translate.php
@@ -111,6 +111,9 @@
112112 // Translation display related
113113 $wgHooks['ArticleContentOnDiff'][] = 'TranslateEditAddons::displayOnDiff';
114114
 115+// Search profile
 116+$wgHooks['SpecialSearchProfiles'][] = 'TranslateEditAddons::searchProfile';
 117+
115118 // New rights
116119 $wgAvailableRights[] = 'translate';
117120 $wgAvailableRights[] = 'translate-import';
Index: trunk/extensions/Translate/Translate.i18n.php
@@ -357,6 +357,10 @@
358358 'translate-gs-avgscore' => 'Avg. score',
359359
360360 'translate-documentation-language' => 'Message documentation',
 361+
 362+ // Search profile hook
 363+ 'translate-searchprofile' => 'Translations',
 364+ 'translate-searchprofile-tooltip' => 'Search from all translations',
361365 );
362366
363367 /** Message documentation (Message documentation)

Status & tagging log