Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/148634

Change subject: Make the translation guidelines link configurable per language
......................................................................

Make the translation guidelines link configurable per language

Bug: 68420
Change-Id: If0c424f3b801be7ba2973e8580a89aacf3343177
---
M Resources.php
M i18n/en.json
M i18n/qqq.json
M modules/tools/ext.cx.tools.instructions.js
M modules/tools/ext.cx.tools.mtabuse.js
5 files changed, 8 insertions(+), 22 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/34/148634/1

diff --git a/Resources.php b/Resources.php
index 00e0417..dcf5128 100644
--- a/Resources.php
+++ b/Resources.php
@@ -190,6 +190,7 @@
                'cx-tools-instructions-text5',
                'cx-tools-instructions-text6',
                'cx-tools-view-guidelines',
+               'cx-tools-view-guidelines-link',
        ),
        'dependencies' => array(
                'ext.cx.tools.manager',
@@ -209,6 +210,8 @@
        'messages' => array(
                'cx-mt-abuse-warning-title',
                'cx-mt-abuse-warning-text',
+               'cx-tools-view-guidelines',
+               'cx-tools-view-guidelines-link',
        ),
        'dependencies' => array(
                'ext.cx.tools.manager',
diff --git a/i18n/en.json b/i18n/en.json
index f6d9bfb..64129c9 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -47,6 +47,7 @@
        "cx-tools-instructions-text6": "When {{GENDER:|you}} are happy with the 
result, press \"{{int:cx-publish-button}}\".",
        "cx-tools-searchbox-text": "Search for a word",
        "cx-tools-view-guidelines": "{{GENDER:|View}} translation guidelines",
+       "cx-tools-view-guidelines-link": 
"https://en.wikipedia.org/wiki/Project:Translation#How_to_translate";,
        "cx-tools-dictionary-title": "Definition",
        "cx-tools-link-title": "Link",
        "cx-tools-link-add": "Add link",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 857eda8..a4ee0c0 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -51,6 +51,7 @@
        "cx-tools-instructions-text6": "Help text for the translation tools 
pane on Special:ContentTranslation.\n\nPreceded by the heading 
{{msg-mw|Cx-tools-instructions-text5}}.",
        "cx-tools-searchbox-text": "Placeholder text for the search box on the 
translation tools column.",
        "cx-tools-view-guidelines": "Shown at the bottom of the instructions 
text. A hyperlink to the translation guidelines in the target language.",
+       "cx-tools-view-guidelines-link": "Link to translation guideline in the 
target language wiki. Give the absolute URL of a translation guidelines page in 
target language.",
        "cx-tools-dictionary-title": "Title of tool card that shows dictionary 
definitions on Special:ContentTranslation.\n{{Identical|Definition}}",
        "cx-tools-link-title": "Title of link tool card.\n{{Identical|Link}}",
        "cx-tools-link-add": "Text shown in link tool card. Clicking on it adds 
the link in the cursor position.\n{{Identical|Add link}}",
diff --git a/modules/tools/ext.cx.tools.instructions.js 
b/modules/tools/ext.cx.tools.instructions.js
index d74415b..7a9318e 100644
--- a/modules/tools/ext.cx.tools.instructions.js
+++ b/modules/tools/ext.cx.tools.instructions.js
@@ -40,9 +40,7 @@
        InstructionsCard.prototype.constructor = InstructionsCard;
 
        InstructionsCard.prototype.render = function () {
-               var $guidelines,
-                       uri = new mw.Uri(),
-                       domainTemplate = mw.config.get( 
'wgContentTranslationDomainTemplate' );
+               var $guidelines;
 
                this.$card.find( '.tools.count.one' )
                        .text( mw.language.convertNumber( 1 ) );
@@ -65,17 +63,10 @@
                this.$card.find( '.text.description.three' )
                        .text( mw.msg( 'cx-tools-instructions-text6' ) );
 
-               uri.host = domainTemplate.replace( '$1', mw.cx.targetLanguage );
-               uri.path = mw.config.get( 'wgScript' );
-               uri.query = {
-                       // TODO: This must customizable per project
-                       title: 'Project:Translation#How_to_translate'
-               };
-
                $guidelines = this.$card.find( '.card__section.guidelines' )
                        .append( $( '<a>' )
                                .prop( {
-                                       href: uri.toString(),
+                                       href: mw.msg( 
'cx-tools-view-guidelines-link' ),
                                        target: '_blank'
                                } )
                                .text( mw.msg( 'cx-tools-view-guidelines' ) )
diff --git a/modules/tools/ext.cx.tools.mtabuse.js 
b/modules/tools/ext.cx.tools.mtabuse.js
index 321cf7d..65e0016 100644
--- a/modules/tools/ext.cx.tools.mtabuse.js
+++ b/modules/tools/ext.cx.tools.mtabuse.js
@@ -23,22 +23,12 @@
        }
 
        MTAbuseCard.prototype.render = function () {
-               var uri = new mw.Uri(),
-                       domainTemplate = mw.config.get( 
'wgContentTranslationDomainTemplate' );
-
                this.$card.find( '.card__mtabuse-details' )
                        .text( mw.msg( 'cx-mt-abuse-warning-text' ) );
-               uri.host = domainTemplate.replace( '$1', mw.cx.targetLanguage );
-               uri.path = mw.config.get( 'wgScript' );
-               uri.query = {
-                       // TODO: This must customizable per project
-                       title: 'Project:Translation#How_to_translate'
-               };
-
                this.$card.find( '.card__mtabuse-link' )
                        .append( $( '<a>' )
                                .prop( {
-                                       href: uri.toString(),
+                                       href: mw.msg( 
'cx-tools-view-guidelines-link' ),
                                        target: '_blank'
                                } )
                                .text( mw.msg( 'cx-tools-view-guidelines' ) )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If0c424f3b801be7ba2973e8580a89aacf3343177
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to