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

Change subject: Convert API module to use i18n help/documentation.
......................................................................


Convert API module to use i18n help/documentation.

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.

Bug: T76892
Change-Id: I0425f1f2e9eb0de896595b67d30624c304d074ce
---
M api/ApiQuizGame.php
M api/ApiQuizGameVote.php
M i18n/en.json
M i18n/qqq.json
4 files changed, 52 insertions(+), 4 deletions(-)

Approvals:
  Wctaiwan: Looks good to me, but someone else must approve
  Jack Phoenix: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/api/ApiQuizGame.php b/api/ApiQuizGame.php
index 5f2ca82..6447cd3 100644
--- a/api/ApiQuizGame.php
+++ b/api/ApiQuizGame.php
@@ -275,6 +275,7 @@
        }
 
        /**
+        * @deprecated since MediaWiki core 1.25
         * @return String: the description string for this module
         */
        public function getDescription() {
@@ -305,6 +306,7 @@
         * Get the human-readable descriptions of all the parameters that this
         * module accepts/requires.
         *
+        * @deprecated since MediaWiki core 1.25
         * @return Array
         */
        public function getParamDescription() {
@@ -316,10 +318,20 @@
                );
        }
 
+       /**
+        * @deprecated since MediaWiki core 1.25
+        */
        public function getExamples() {
                return array(
                        
'api.php?action=quizgame&quizaction=flagItem&comment=Inappropriate%20question&id=30&key=ThisObviouslyIsntARealKey',
                        
'api.php?action=quizgame&quizaction=deleteItem&id=30&key=YetAnotherExampleKey',
                );
        }
+
+       public function getExamplesMessages() {
+               return array(
+                       
'action=quizgame&quizaction=flagItem&comment=Inappropriate%20question&id=30&key=ThisObviouslyIsntARealKey'
 => 'apihelp-quizgame-example-1',
+                       
'action=quizgame&quizaction=deleteItem&id=30&key=YetAnotherExampleKey' => 
'apihelp-quizgame-example-2',
+               );
+       }
 }
diff --git a/api/ApiQuizGameVote.php b/api/ApiQuizGameVote.php
index a27dae7..759055c 100644
--- a/api/ApiQuizGameVote.php
+++ b/api/ApiQuizGameVote.php
@@ -173,6 +173,7 @@
        }
 
        /**
+        * @deprecated since MediaWiki core 1.25
         * @return String: the description string for this module
         */
        public function getDescription() {
@@ -204,6 +205,7 @@
         * Get the human-readable descriptions of all the parameters that this
         * module accepts/requires.
         *
+        * @deprecated since MediaWiki core 1.25
         * @return Array
         */
        public function getParamDescription() {
@@ -215,10 +217,18 @@
                );
        }
 
+       /**
+        * @deprecated since MediaWiki core 1.25
+        */
        public function getExamples() {
                return array(
-                       
'api.php?action=quizgamevote&answer=3&id=245&key=ThisObviouslyIsntARealKey',
-                       
'api.php?action=quizgamevote&answer=6&id=30&id=364&key=YetAnotherExampleKey',
+                       
'api.php?action=quizgamevote&answer=3&id=245&key=ThisObviouslyIsntARealKey'
+               );
+       }
+
+       public function getExamplesMessages() {
+               return array(
+                       
'action=quizgamevote&answer=3&id=245&key=ThisObviouslyIsntARealKey' => 
'apihelp-quizgamevote-example-1'
                );
        }
 }
diff --git a/i18n/en.json b/i18n/en.json
index 97a301d..597f2c3 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -133,5 +133,18 @@
     "logentry-quiz-unflag": "$1 unflagged [[Special:QuizGameHome/$4|quiz 
question #$4]]",
     "logentry-quiz-unprotect": "$1 unprotected [[Special:QuizGameHome/$4|quiz 
question #$4]]",
     "quizgame-images-category": "QuizGame images",
-    "right-quizadmin": "Administrate question games"
+    "right-quizadmin": "Administrate question games",
+    "apihelp-quizgame-description": "Question Game API for administrative 
actions.",
+    "apihelp-quizgame-param-comment": "Reason for flagging (used only in 
flagItem).",
+    "apihelp-quizgame-param-id": "Quiz ID number.",
+    "apihelp-quizgame-param-key": "MD5 hash of the salt and the quiz ID 
number.",
+    "apihelp-quizgame-param-quizaction": "What to do + the word \"Item\", i.e. 
deleteItem.",
+    "apihelp-quizgame-example-1": "Flag a quiz.",
+    "apihelp-quizgame-example-2": "Delete a quiz.",
+    "apihelp-quizgamevote-description": "Question Game API for voting.",
+    "apihelp-quizgamevote-param-answer": "Numeric answer ID.",
+    "apihelp-quizgamevote-param-id": "Quiz ID number.",
+    "apihelp-quizgamevote-param-key": "MD5 hash of the salt and the quiz ID 
number.",
+    "apihelp-quizgamevote-param-points": "How many points are given out for 
the correct answer.",
+    "apihelp-quizgamevote-example-1": "Vote."
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index d0ed3b5..0bb2de2 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -125,5 +125,18 @@
     "logentry-quiz-unflag": "Log action; $1 is the username, $4 is the 
question ID number",
     "logentry-quiz-unprotect": "Log action; $1 is the username, $4 is the 
question ID number",
     "quizgame-images-category": "Category where all images uploaded via 
Special:QuestionGameUpload will be placed into",
-    "right-quizadmin": "Description of the \"quizgame\" user right, shown on 
[[Special:ListGroupRights]]"
+    "right-quizadmin": "Description of the \"quizgame\" user right, shown on 
[[Special:ListGroupRights]]",
+    "apihelp-quizgame-description": "{{doc-apihelp-description|quizgame}}",
+    "apihelp-quizgame-param-comment": "{{doc-apihelp-param|quizgame|comment}}",
+    "apihelp-quizgame-param-id": "{{doc-apihelp-param|quizgame|id}}",
+    "apihelp-quizgame-param-key": "{{doc-apihelp-param|quizgame|key}}",
+    "apihelp-quizgame-param-quizaction": 
"{{doc-apihelp-param|quizgame|quizaction}}",
+    "apihelp-quizgame-example-1": "{{doc-apihelp-example|quizgame}}",
+    "apihelp-quizgame-example-2": "{{doc-apihelp-example|quizgame}}",
+    "apihelp-quizgamevote-description": 
"{{doc-apihelp-description|quizgamevote}}",
+    "apihelp-quizgamevote-param-answer": 
"{{doc-apihelp-param|quizgamevote|answer}}",
+    "apihelp-quizgamevote-param-id": "{{doc-apihelp-param|quizgamevote|id}}",
+    "apihelp-quizgamevote-param-key": "{{doc-apihelp-param|quizgamevote|key}}",
+    "apihelp-quizgamevote-param-points": 
"{{doc-apihelp-param|quizgamevote|points}}",
+    "apihelp-quizgamevote-example-1": "{{doc-apihelp-example|quizgamevote}}"
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0425f1f2e9eb0de896595b67d30624c304d074ce
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/QuizGame
Gerrit-Branch: master
Gerrit-Owner: Unicornisaurous <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: Unicornisaurous <[email protected]>
Gerrit-Reviewer: Wctaiwan <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to