Add direct links to translation interface on Special:AllMessages
authorFederico Leva <federicoleva@tiscali.it>
Wed, 6 Nov 2013 23:08:02 +0000 (00:08 +0100)
committerReedy <reedy@wikimedia.org>
Sat, 25 Jan 2014 04:24:27 +0000 (04:24 +0000)
commitfa5576bee539f544962f080b4b5a900e99ee7ea3
tree9cca7f2e1b87f1f8afea49dcf1113208295c28d1
parent198ec331dde6940a60e530bbf6241206e1535cc8
Add direct links to translation interface on Special:AllMessages

The local Special:AllMessages page is the first and most friendly place
where average users will look for the message and try to translate it:
when they find it, add a link to translatewiki.net so that they can start
translating without searching for it from scratch.

Special:SearchTranslations is the only target usable for this: the solr
search is smart enough to present the most relevant results first and the
translation interface is directly available in place.
On the bright side, similar messages popping up from other projects or areas
of the code will provide suggestions and help find other occurrences of
translations which can similarly be improved.

More specifically, we are using a combined language, key and text search:
* the English text is the only thing guaranteed to exist, if the message is
  available, though quoting it can give some false negatives and not quoting
  it would give it too much weight if it's long;
* the key can be used thanks to the feature revealed by Niklas Laxström in
  comments to this patch: it is simpler to handle but allows only exact matches
  and can be wrong if TWN adds a prefix for the extension, so it can't be used
  alone, but in the best case it's what we're looking for;
* the language makes sense in combination with the key match.
We boost key and language to get the current translation of the message where
possible; if it's not, the first result will usually be English text.
https://wiki.apache.org/solr/SolrQuerySyntax
https://lucene.apache.org/core/2_9_4/queryparsersyntax.html

From the initial search, the user can further refine its search and navigate
the interface to find the message(s) and editor where to add or edit the
translation.

Change-Id: I8de3faba829c50cdc0f2d09726f738c585792e00
includes/specials/SpecialAllmessages.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc