Santhosh has uploaded a new change for review.

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

Change subject: Provide one click beta feature activation from Special:CX
......................................................................

Provide one click beta feature activation from Special:CX

For the users landing in Special:CX without CX enabled, instead of
providing 'No such special page' message, provide a useful message
and a way to enable the feature easily.

The campaign need to be configured to identify it as a one click
beta feature activation token.

Bug: T125306
Change-Id: I1400da27f1333a3c207a49417d44f4428cc6d71b
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M specials/SpecialContentTranslation.php
4 files changed, 10 insertions(+), 2 deletions(-)


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

diff --git a/extension.json b/extension.json
index 2d80cd0..66ba93c 100644
--- a/extension.json
+++ b/extension.json
@@ -132,7 +132,8 @@
                "ContentTranslationTargetNamespace": "Main",
                "ContentTranslationCampaigns": {
                        "cxstats": true,
-                       "newarticle": true
+                       "newarticle": true,
+                       "specialcx": true
                },
                "ContentTranslationBrowserBlacklist": {
                        "msie": [ [ "<", 10 ] ]
diff --git a/i18n/en.json b/i18n/en.json
index a583f18..2c1d47f 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -18,6 +18,7 @@
        "cx": "Translate page",
        "cx-dashboard-header": "Translations",
        "cx-javascript": "This tool does not work without JavaScript.",
+       "cx-specialpage-enable-betafeature": "[[mw:ContentTranslation|Content 
Translation]] is tool to quickly translate pages into your language. [$1 Try it 
now!.]",
        "cx-license-agreement": "By clicking the \"$1\" button, you agree to 
the [//wikimediafoundation.org/wiki/Terms_of_Use Terms of Use] and you 
irrevocably agree to release your contributions with the translation tool under 
the [https://creativecommons.org/licenses/by-sa/3.0/ CC BY-SA 3.0 License] and 
the 
[//en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License 
GFDL] with the understanding that a hyperlink or URL is sufficient for CC BY-SA 
3.0 attribution.",
        "cx-error-server-connection": "Error: Could not connect to the server.",
        "cx-desc": "Makes it easy to translate content pages",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b6bb1c2..e4b69b6 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -24,6 +24,7 @@
        "cx": "{{doc-special|ContentTranslation}}",
        "cx-dashboard-header": "Title to be displayed in header while viewing 
the dashboard",
        "cx-javascript": "Error message shown when JavaScript is not enabled in 
the browser.",
+       "cx-specialpage-enable-betafeature": "Message shown in 
[[Special:ContentTranslation]] if the user not enabled the beta feature.",
        "cx-license-agreement": "License agreement for the contributions using 
Content Translation tool. This is legal text and be careful. You may point the 
license URLs to a Wikipedia page in your language if it exists. Parameters:\n* 
$1 - Label of the button that starts the translation tool.",
        "cx-error-server-connection": "Error message shown when connection to 
the Content Translation server has failed.",
        "cx-desc": 
"{{desc|name=ContentTranslation|url=https://www.mediawiki.org/wiki/Extension:ContentTranslation}}";,
diff --git a/specials/SpecialContentTranslation.php 
b/specials/SpecialContentTranslation.php
index 02c038a..2732a5d 100644
--- a/specials/SpecialContentTranslation.php
+++ b/specials/SpecialContentTranslation.php
@@ -126,7 +126,12 @@
                                        );
                                        return;
                                }
-                               $out->showErrorPage( 'nosuchspecialpage', 
'nospecialpagetext' );
+                               $out->showErrorPage(
+                                       'cx',
+                                       'cx-specialpage-enable-betafeature',
+                                       SpecialPage::getTitleFor( 
'ContentTranslation' )
+                                               ->getCanonicalURL( array( 
'campaign'=>'specialcx' ) )
+                               );
                                return;
                        }
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1400da27f1333a3c207a49417d44f4428cc6d71b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to