Amire80 has uploaded a new change for review.

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

Change subject: Show a different message for adding a missing link from the 
page selector
......................................................................

Show a different message for adding a missing link from the page selector

Bug: T106440
Change-Id: I39d3cce0b1588a7bf2fbf7e00ee4f16cfdd592e2
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M modules/tools/ext.cx.tools.link.js
M modules/widgets/pageselector/ext.cx.pageselector.js
5 files changed, 7 insertions(+), 1 deletion(-)


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

diff --git a/extension.json b/extension.json
index ea6dadc..89100bb 100644
--- a/extension.json
+++ b/extension.json
@@ -542,6 +542,7 @@
                                "cx-tools-link-external-link",
                                "cx-tools-link-external-link-placeholder",
                                "cx-tools-link-to-another-page",
+                               "cx-tools-link-add-as-missing",
                                "cx-tools-link-apply"
                        ],
                        "dependencies": [
diff --git a/i18n/en.json b/i18n/en.json
index 9d8fb2b..efad70a 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -191,6 +191,7 @@
        "cx-tools-link-external-link": "External",
        "cx-tools-link-external-link-placeholder": "Add external link",
        "cx-tools-link-to-another-page": "Link to another page",
+       "cx-tools-link-add-as-missing": "Add as missing link",
        "cx-tools-link-apply": "Done",
        "mw-pageselector-missing": "Page does not exist",
        "cx-draft-restoring": "Loading the saved translation...",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 4f7ec40..8d0dadb 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -196,6 +196,7 @@
        "cx-tools-link-external-link": "Label shown in link tool card. Prompts 
to enter an external link. Please try to make translation 
short.\n{{Identical|External}}",
        "cx-tools-link-external-link-placeholder": "Placeholder text for the 
input field to enter an external link",
        "cx-tools-link-to-another-page": "Opens a tool that allows linking to 
any internal or external page.",
+       "cx-tools-link-add-as-missing": "Shown in the page selector when the 
user types a name of a page that doesn't exist in the target wiki. Clicking it 
adds a missing (\"red\") link to this page. \"Missing\" has the same meaning as 
in {{msg-mw|cx-tools-missing-link-mark-link}}.",
        "cx-tools-link-apply": "Button label to apply the link selection from 
link tool card\n{{Identical|Done}}",
        "mw-pageselector-missing": "Message shown in page selector when the 
search did not fetch any result",
        "cx-draft-restoring": "Message indicating the saved translation being 
fetched.",
diff --git a/modules/tools/ext.cx.tools.link.js 
b/modules/tools/ext.cx.tools.link.js
index fe2c98b..7169001 100644
--- a/modules/tools/ext.cx.tools.link.js
+++ b/modules/tools/ext.cx.tools.link.js
@@ -982,6 +982,7 @@
                this.$targetPageSelector = new mw.PageSelector( 
this.$searchInput, {
                        api: mw.cx.siteMapper.getApi( mw.cx.targetLanguage ),
                        showMissingPage: true,
+                       missingPageMessage: 'cx-tools-link-add-as-missing',
                        onSelect: function ( selectedPage ) {
                                self.createLinkWithTool( selectedPage, 
'internal' );
                        }
diff --git a/modules/widgets/pageselector/ext.cx.pageselector.js 
b/modules/widgets/pageselector/ext.cx.pageselector.js
index ef70272..b8f2b92 100644
--- a/modules/widgets/pageselector/ext.cx.pageselector.js
+++ b/modules/widgets/pageselector/ext.cx.pageselector.js
@@ -103,7 +103,7 @@
                                );
                        if ( page.missing ) {
                                $resultItem.addClass( 'mw-page-missing' );
-                               $description.text( mw.msg( 
'mw-pageselector-missing' ) );
+                               $description.text( mw.msg( 
this.options.missingPageMessage ) );
                        }
                        if ( page.thumbnail ) {
                                thumbnailWidth = page.thumbnail.width;
@@ -261,6 +261,8 @@
                api: new mw.Api(),
                // Show a missing page if search did not return any page.
                showMissingPage: false,
+               // The message to show if an item for a missing page is shown.
+               missingPageMessage: 'mw-pageselector-missing',
                // Callback when a page is selected
                onSelect: null
        };

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I39d3cce0b1588a7bf2fbf7e00ee4f16cfdd592e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>

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

Reply via email to