jenkins-bot has submitted this change and it was merged.

Change subject: Display nice nojs error on Special:Translate
......................................................................


Display nice nojs error on Special:Translate

Bug: T50154
Change-Id: I912ec299f05a123818c9b7ee361ec1b1aa2d88ae
---
M i18n/core/en.json
M i18n/core/qqq.json
M resources/css/ext.translate.special.translate.css
M specials/SpecialTranslate.php
4 files changed, 15 insertions(+), 3 deletions(-)

Approvals:
  Siebrand: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/core/en.json b/i18n/core/en.json
index 63bb601..75f0b4e 100644
--- a/i18n/core/en.json
+++ b/i18n/core/en.json
@@ -384,5 +384,6 @@
        "translate-search-more-groups-info": "$1 more 
{{PLURAL:$1|group|groups}}",
        "translate-ulsdep-title": "Configuration error",
        "translate-ulsdep-body": "The Translate extension depends on the 
[https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:UniversalLanguageSelector
 Universal Language Selector extension].",
-       "tux-session-expired": "You are no longer logged in. Please log in in a 
separate tab. Alternatively, make a copy of unsaved translations, log in, 
return to this page and enter your translations again."
+       "tux-session-expired": "You are no longer logged in. Please log in in a 
separate tab. Alternatively, make a copy of unsaved translations, log in, 
return to this page and enter your translations again.",
+       "tux-nojs": "This page requires JavaScript."
 }
diff --git a/i18n/core/qqq.json b/i18n/core/qqq.json
index e4ac5a4..aab8a23 100644
--- a/i18n/core/qqq.json
+++ b/i18n/core/qqq.json
@@ -391,5 +391,6 @@
        "translate-search-more-groups-info": "Information shown as number of 
message groups matching the query using\n[[Special:SearchTranslations]]\n* $1 - 
number of groups\nSee also:\n* {{msg-mw|Translate-search-more-languages-info}}",
        "translate-ulsdep-title": "Page title",
        "translate-ulsdep-body": "Error message in page body",
-       "tux-session-expired": "Warning shown to the user in a popup when 
translation could not be saved because the session is expired."
+       "tux-session-expired": "Warning shown to the user in a popup when 
translation could not be saved because the session is expired.",
+       "tux-nojs": "An error shown in Special:Translate."
 }
diff --git a/resources/css/ext.translate.special.translate.css 
b/resources/css/ext.translate.special.translate.css
index f0b53ad..2c6e667 100644
--- a/resources/css/ext.translate.special.translate.css
+++ b/resources/css/ext.translate.special.translate.css
@@ -217,3 +217,7 @@
        background-size: 25px;
        height: 28px;
 }
+
+.client-nojs .tux-messagetable-header {
+       display: none;
+}
diff --git a/specials/SpecialTranslate.php b/specials/SpecialTranslate.php
index 500e553..da833ce 100644
--- a/specials/SpecialTranslate.php
+++ b/specials/SpecialTranslate.php
@@ -447,6 +447,12 @@
        }
 
        protected function tuxSettingsForm() {
+               $nojs = Html::element(
+                       'noscript',
+                       array( 'class' => 'tux-nojs errorbox' ),
+                       $this->msg( 'tux-nojs' )->plain()
+               );
+
                $attrs = array( 'class' => 'row tux-editor-header' );
                $selectors = $this->tuxGroupSelector() .
                        $this->tuxLanguageSelector() .
@@ -454,7 +460,7 @@
                        $this->tuxWorkflowSelector() .
                        $this->tuxGroupWarning();
 
-               return Html::rawElement( 'div', $attrs, $selectors );
+               return Html::rawElement( 'div', $attrs, $selectors ) . $nojs;
        }
 
        protected function messageSelector() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I912ec299f05a123818c9b7ee361ec1b1aa2d88ae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[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