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

Change subject: Add i18n for API module help
......................................................................


Add i18n for API module help

MediaWiki core change I04b1a384 added support for i18n of API module
help. This takes advantage of that while still maintaining backwards
compatibility with earlier versions of MediaWiki.

Once support for MediaWiki before 1.25 is dropped, the methods marked
deprecated in this patch may be removed.

Change-Id: I67395aff48185f3e09da31b51a08aa2541fe6a17
---
M api/ApiSpamBlacklist.php
M i18n/en.json
M i18n/qqq.json
3 files changed, 44 insertions(+), 19 deletions(-)

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



diff --git a/api/ApiSpamBlacklist.php b/api/ApiSpamBlacklist.php
index dad9e8e..9c5ce3d 100644
--- a/api/ApiSpamBlacklist.php
+++ b/api/ApiSpamBlacklist.php
@@ -55,16 +55,25 @@
                );
        }
 
+       /**
+        * @deprecated since MediaWiki core 1.25
+        */
        public function getParamDescription() {
                return array(
                        'url' => 'A pipe-separated list of URLs to validate 
against the blacklist',
                );
        }
 
+       /**
+        * @deprecated since MediaWiki core 1.25
+        */
        public function getDescription() {
                return 'Validate one or more URLs against the SpamBlacklist.';
        }
 
+       /**
+        * @deprecated since MediaWiki core 1.25
+        */
        public function getExamples() {
                return array(
                        
'api.php?action=spamblacklist&url=http%3A%2F%2Fwww.example.com%2F%7Chttp%3A%2F%2Fwww.example.org%2F',
@@ -72,6 +81,16 @@
                );
        }
 
+       /**
+        * @see ApiBase::getExamplesMessages()
+        */
+       protected function getExamplesMessages() {
+               return array(
+                       
'action=spamblacklist&url=http://www.example.com/|http://www.example.org/'
+                               => 'apihelp-spamblacklist-example-1',
+               );
+       }
+
        public function getHelpUrls() {
                return array( 
'https://www.mediawiki.org/wiki/Extension:SpamBlacklist/API' );
        }
diff --git a/i18n/en.json b/i18n/en.json
index 3ba7bf0..1190a63 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -1,19 +1,22 @@
 {
-    "@metadata": {
-        "authors": []
-    },
-    "spam-blacklist": " #<!-- leave this line exactly as it is --> <pre>\n# 
External URLs matching this list will be blocked when added to a page.\n# This 
list affects only this wiki; refer also to the global blacklist.\n# For 
documentation see https://www.mediawiki.org/wiki/Extension:SpamBlacklist\n#\n# 
Syntax is as follows:\n#   * Everything from a \"#\" character to the end of 
the line is a comment\n#   * Every non-blank line is a regex fragment which 
will only match hosts inside URLs\n\n #</pre> <!-- leave this line exactly as 
it is -->",
-    "spam-whitelist": " #<!-- leave this line exactly as it is --> <pre>\n# 
External URLs matching this list will *not* be blocked even if they would\n# 
have been blocked by blacklist entries.\n#\n# Syntax is as follows:\n#   * 
Everything from a \"#\" character to the end of the line is a comment\n#   * 
Every non-blank line is a regex fragment which will only match hosts inside 
URLs\n\n #</pre> <!-- leave this line exactly as it is -->",
-    "email-blacklist": " #<!-- leave this line exactly as it is --> <pre>\n# 
Email addresses matching this list will be blocked from registering or sending 
emails\n# This list affects only this wiki; refer also to the global 
blacklist.\n# For documentation see 
https://www.mediawiki.org/wiki/Extension:SpamBlacklist\n#\n# Syntax is as 
follows:\n#   * Everything from a \"#\" character to the end of the line is a 
comment\n#   * Every non-blank line is a regex fragment which will only match 
hosts inside email addresses\n\n #</pre> <!-- leave this line exactly as it is 
-->",
-    "email-whitelist": " #<!-- leave this line exactly as it is --> <pre>\n# 
Email addresses matching this list will *not* be blocked even if they would\n# 
have been blocked by blacklist entries.\n#\n# Syntax is as follows:\n#   * 
Everything from a \"#\" character to the end of the line is a comment\n#   * 
Every non-blank line is a regex fragment which will only match hosts inside 
email addresses\n\n #</pre> <!-- leave this line exactly as it is -->",
-    "spam-blacklisted-email": "Blacklisted email address",
-    "spam-blacklisted-email-text": "Your email address is currently 
blacklisted from sending emails to other users.",
-    "spam-blacklisted-email-signup": "The given email address is currently 
blacklisted from use.",
-    "spam-invalid-lines": "The following spam blacklist {{PLURAL:$1|line is 
an|lines are}} invalid regular {{PLURAL:$1|expression|expressions}} and 
{{PLURAL:$1|needs|need}} to be corrected before saving the page:",
-    "spam-blacklist-desc": "Regex-based anti-spam tool allowing to blacklist 
URLs in pages and email addresses for registered users",
-    "log-name-spamblacklist": "Spam blacklist log",
-    "log-description-spamblacklist": "These events track spam blacklist hits.",
-    "logentry-spamblacklist-hit": "{{GENDER:$2|$1}} caused a spam blacklist 
hit on $3 by attempting to add $4.",
-    "right-spamblacklistlog": "View the spam blacklist log",
-    "action-spamblacklistlog": "view the spam blacklist log"
-}
\ No newline at end of file
+       "@metadata": {
+               "authors": []
+       },
+       "spam-blacklist": " #<!-- leave this line exactly as it is --> <pre>\n# 
External URLs matching this list will be blocked when added to a page.\n# This 
list affects only this wiki; refer also to the global blacklist.\n# For 
documentation see https://www.mediawiki.org/wiki/Extension:SpamBlacklist\n#\n# 
Syntax is as follows:\n#   * Everything from a \"#\" character to the end of 
the line is a comment\n#   * Every non-blank line is a regex fragment which 
will only match hosts inside URLs\n\n #</pre> <!-- leave this line exactly as 
it is -->",
+       "spam-whitelist": " #<!-- leave this line exactly as it is --> <pre>\n# 
External URLs matching this list will *not* be blocked even if they would\n# 
have been blocked by blacklist entries.\n#\n# Syntax is as follows:\n#   * 
Everything from a \"#\" character to the end of the line is a comment\n#   * 
Every non-blank line is a regex fragment which will only match hosts inside 
URLs\n\n #</pre> <!-- leave this line exactly as it is -->",
+       "email-blacklist": " #<!-- leave this line exactly as it is --> 
<pre>\n# Email addresses matching this list will be blocked from registering or 
sending emails\n# This list affects only this wiki; refer also to the global 
blacklist.\n# For documentation see 
https://www.mediawiki.org/wiki/Extension:SpamBlacklist\n#\n# Syntax is as 
follows:\n#   * Everything from a \"#\" character to the end of the line is a 
comment\n#   * Every non-blank line is a regex fragment which will only match 
hosts inside email addresses\n\n #</pre> <!-- leave this line exactly as it is 
-->",
+       "email-whitelist": " #<!-- leave this line exactly as it is --> 
<pre>\n# Email addresses matching this list will *not* be blocked even if they 
would\n# have been blocked by blacklist entries.\n#\n# Syntax is as follows:\n# 
  * Everything from a \"#\" character to the end of the line is a comment\n#   
* Every non-blank line is a regex fragment which will only match hosts inside 
email addresses\n\n #</pre> <!-- leave this line exactly as it is -->",
+       "spam-blacklisted-email": "Blacklisted email address",
+       "spam-blacklisted-email-text": "Your email address is currently 
blacklisted from sending emails to other users.",
+       "spam-blacklisted-email-signup": "The given email address is currently 
blacklisted from use.",
+       "spam-invalid-lines": "The following spam blacklist {{PLURAL:$1|line is 
an|lines are}} invalid regular {{PLURAL:$1|expression|expressions}} and 
{{PLURAL:$1|needs|need}} to be corrected before saving the page:",
+       "spam-blacklist-desc": "Regex-based anti-spam tool allowing to 
blacklist URLs in pages and email addresses for registered users",
+       "log-name-spamblacklist": "Spam blacklist log",
+       "log-description-spamblacklist": "These events track spam blacklist 
hits.",
+       "logentry-spamblacklist-hit": "{{GENDER:$2|$1}} caused a spam blacklist 
hit on $3 by attempting to add $4.",
+       "right-spamblacklistlog": "View the spam blacklist log",
+       "action-spamblacklistlog": "view the spam blacklist log",
+       "apihelp-spamblacklist-description": "Validate one or more URLs against 
the SpamBlacklist.",
+       "apihelp-spamblacklist-param-url": "URLs to validate against the 
blacklist.",
+       "apihelp-spamblacklist-example-1": "Check two URLs against the 
blacklist"
+}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 61a755e..6757c11 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -22,5 +22,8 @@
        "log-description-spamblacklist": "Description of spam blacklist log",
        "logentry-spamblacklist-hit": "Log entry that is created when a user 
adds a link that is blacklisted on the spam 
blacklist.\n\n{{logentry}}\nAdditional parameters:\n* $4 - the URL the user 
tried to add",
        "right-spamblacklistlog": "{{doc-right|spamblacklistlog}}",
-       "action-spamblacklistlog": "{{doc-action|spamblacklistlog}}"
+       "action-spamblacklistlog": "{{doc-action|spamblacklistlog}}",
+       "apihelp-spamblacklist-description": 
"{{doc-apihelp-description|spamblacklist}}",
+       "apihelp-spamblacklist-param-url": 
"{{doc-apihelp-param|spamblacklist|url}}",
+       "apihelp-spamblacklist-example-1": 
"{{doc-apihelp-example|spamblacklist}}"
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I67395aff48185f3e09da31b51a08aa2541fe6a17
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SpamBlacklist
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to