jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/382759 )

Change subject: Add "Link to this message" to translation editor tools
......................................................................


Add "Link to this message" to translation editor tools

Change-Id: I46e32a2c7b4a5a1ba83da3da7ee1806367106a55
---
M Resources.php
M api/ApiQueryMessageCollection.php
M i18n/core/en.json
M i18n/core/qqq.json
M resources/js/ext.translate.editor.js
5 files changed, 16 insertions(+), 2 deletions(-)

Approvals:
  Petar.petkovic: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Resources.php b/Resources.php
index cb80344..27578e0 100644
--- a/Resources.php
+++ b/Resources.php
@@ -91,6 +91,7 @@
                'tux-editor-message-tools-delete',
                'tux-editor-message-tools-history',
                'tux-editor-message-tools-translations',
+               'tux-editor-message-tools-linktothis',
                'tux-editor-n-uses',
                'tux-editor-need-more-help',
                'tux-editor-outdated-warning',
diff --git a/api/ApiQueryMessageCollection.php 
b/api/ApiQueryMessageCollection.php
index a0415b1..0bfe461 100644
--- a/api/ApiQueryMessageCollection.php
+++ b/api/ApiQueryMessageCollection.php
@@ -140,6 +140,7 @@
                        if ( is_null( $resultPageSet ) ) {
                                $data = $this->extractMessageData( $result, 
$props, $messages[$mkey] );
                                $data['title'] = $title->getPrefixedText();
+                               $data['primaryGroup'] = ( new MessageHandle( 
$title ) )->getGroup()->getId();
 
                                $result->addValue( [ 'query', 
$this->getModuleName() ], null, $data );
                        } else {
diff --git a/i18n/core/en.json b/i18n/core/en.json
index c7fcaaf..894d8f2 100644
--- a/i18n/core/en.json
+++ b/i18n/core/en.json
@@ -383,6 +383,7 @@
        "tux-editor-message-tools-history": "History",
        "tux-editor-message-tools-delete": "Delete",
        "tux-editor-message-tools-translations": "All translations",
+       "tux-editor-message-tools-linktothis": "Link to this message",
        "tux-editor-loading": "Loading...",
        "translate-search-more-languages-info": "$1 more 
{{PLURAL:$1|language|languages}}",
        "translate-statsbar-tooltip": "$1% translated, $2% reviewed",
diff --git a/i18n/core/qqq.json b/i18n/core/qqq.json
index 9358dbf..408a043 100644
--- a/i18n/core/qqq.json
+++ b/i18n/core/qqq.json
@@ -415,6 +415,7 @@
        "tux-editor-message-tools-history": "A link to the message history. An 
item in a menu that appears when clicking on the message 
title.\n{{Identical|History}}",
        "tux-editor-message-tools-delete": "A link to delete the message. An 
item in a menu that appears when clicking on the message 
title.\n{{Identical|Delete}}",
        "tux-editor-message-tools-translations": "A link to translations of a 
message to all languages. An item in a menu that appears when clicking on 
message title.\n{{Identical|All translations}}",
+       "tux-editor-message-tools-linktothis": "A direct link to the 
translation editor showing this translation. An item in a menu that appears 
when clicking on message title",
        "tux-editor-loading": "Loading message while translation editor is 
being prepared with helper information.\n{{Identical|Loading}}",
        "translate-search-more-languages-info": "Information shown as number of 
languages matching the query using\n[[Special:SearchTranslations]]\n* $1 - 
number of languages\nSee also:\n* {{msg-mw|Translate-search-more-groups-info}}",
        "translate-statsbar-tooltip": "Descriptive text to show for the stats 
bar for message groups on mouse over.\n* $1 percentage of messages 
translated\n* $2 percentage of messages reviewed",
diff --git a/resources/js/ext.translate.editor.js 
b/resources/js/ext.translate.editor.js
index b2adaa5..0268a26 100644
--- a/resources/js/ext.translate.editor.js
+++ b/resources/js/ext.translate.editor.js
@@ -368,7 +368,7 @@
                 * @return {jQuery} The new message tools menu element
                 */
                createMessageTools: function () {
-                       var $editItem, $historyItem, $deleteItem, 
$translationsItem;
+                       var $editItem, $historyItem, $deleteItem, 
$translationsItem, $linkToThisItem;
 
                        $editItem = this.createMessageToolsItem(
                                'message-tools-edit',
@@ -421,9 +421,19 @@
                                'tux-editor-message-tools-translations'
                        );
 
+                       $linkToThisItem = this.createMessageToolsItem(
+                               'message-tools-linktothis',
+                               {
+                                       title: 'Special:Translate',
+                                       showMessage: this.message.key,
+                                       group: this.message.primaryGroup
+                               },
+                               'tux-editor-message-tools-linktothis'
+                       );
+
                        return $( '<ul>' )
                                .addClass( 'tux-dropdown-menu 
tux-message-tools-menu hide' )
-                               .append( $editItem, $historyItem, $deleteItem, 
$translationsItem );
+                               .append( $editItem, $historyItem, $deleteItem, 
$translationsItem, $linkToThisItem );
                },
 
                prepareEditorColumn: function () {

-- 
To view, visit https://gerrit.wikimedia.org/r/382759
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I46e32a2c7b4a5a1ba83da3da7ee1806367106a55
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
Gerrit-Reviewer: Petar.petkovic <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to