Simplify translatewiki.net links from Special:AllMessages
authorFederico Leva <federicoleva@tiscali.it>
Mon, 17 Aug 2015 20:32:49 +0000 (22:32 +0200)
committerFederico Leva <federicoleva@tiscali.it>
Mon, 13 Jun 2016 07:55:28 +0000 (09:55 +0200)
* SearchTranslations was migrated to ElasticSearch, which does not
  support operators.
* Full text search with content and message key is the simplest
  possible search and hopefully will be always supported in the future.
  By avoiding the "MediaWiki:" prefix for the key, we can hope to
  match message keys which are prefixed in translatewiki.net.
* Per T70518, the message keys are now indeed indexed, so we can
  hope to find something.
* Since T55656 was fixed, we can just search the available translation
  (or source text) and then let the tabs and facets help the user
  find the existing message in the correct language or the interface
  to translate it in the desired language.

This makes results significantly more relevant, see an example with an
abusefilter message.
Before, the correct message isn't in the first page in any language.
https://phabricator.wikimedia.org/F4160053
After, the top 5 results include the correct message and language.
https://phabricator.wikimedia.org/F4160054

Change-Id: I0ab9b7c80513818a0776681eca9353845f6541d0

includes/specials/pagers/AllMessagesTablePager.php

index 8e4fbaa..60f642d 100644 (file)
@@ -306,9 +306,8 @@ class AllMessagesTablePager extends TablePager {
                                                'title' => 'Special:SearchTranslations',
                                                'group' => 'mediawiki',
                                                'grouppath' => 'mediawiki',
-                                               'query' => 'language:' . $this->getLanguage()->getCode() . '^25 ' .
-                                                       'messageid:"MediaWiki:' . $value . '"^10 "' .
-                                                       $this->msg( $value )->inLanguage( 'en' )->plain() . '"'
+                                               'language' => $this->getLanguage()->getCode(),
+                                               'query' => $value . ' ' . $this->msg( $value )->plain()
                                        ] ),
                                        $this->msg( 'allmessages-filter-translate' )->text()
                                );