jenkins-bot has submitted this change and it was merged.
Change subject: Add i18n for API module help
......................................................................
Add i18n for API module help
Bug: T76888
Change-Id: I1c7b3333f76a9c1808273c45bcc3f95847f36199
---
M ApiPollNY.php
M i18n/en.json
M i18n/qqq.json
3 files changed, 56 insertions(+), 6 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ApiPollNY.php b/ApiPollNY.php
index 1cc38f5..f61cbc6 100644
--- a/ApiPollNY.php
+++ b/ApiPollNY.php
@@ -211,7 +211,7 @@
}
/**
- * @return String: human-readable module description
+ * @deprecated since MediaWiki core 1.25
*/
public function getDescription() {
return 'PollNY API - includes both user and admin functions';
@@ -244,7 +244,9 @@
);
}
- // Describe the parameter
+ /**
+ * @deprecated since MediaWiki core 1.25
+ */
public function getParamDescription() {
return array_merge( parent::getParamDescription(), array(
'what' => 'What to do?',
@@ -256,7 +258,9 @@
) );
}
- // Get examples
+ /**
+ * @deprecated since MediaWiki core 1.25
+ */
public function getExamples() {
return array(
'api.php?action=pollny&what=delete&pollID=66' =>
'Deletes the poll #66',
@@ -267,4 +271,24 @@
'api.php?action=pollny&what=vote&pollID=33&choiceID=4'
=> 'Votes (answers) the poll #33 with the 4th choice',
);
}
-}
\ No newline at end of file
+
+ /**
+ * @see ApiBase::getExamplesMessages()
+ */
+ protected function getExamplesMessages() {
+ return array(
+ 'action=pollny&what=delete&pollID=66'
+ => 'apihelp-pollny-example-1',
+ 'action=pollny&what=getPollResults&pollID=666'
+ => 'apihelp-pollny-example-2',
+ 'action=pollny&what=getRandom'
+ => 'apihelp-pollny-example-3',
+
'action=pollny&what=titleExists&pageName=Is%20PollNY%20awesome%3F'
+ => 'apihelp-pollny-example-4',
+ 'action=pollny&what=updateStatus&pollID=47&status=1'
+ => 'apihelp-pollny-example-5',
+ 'action=pollny&what=vote&pollID=33&choiceID=4'
+ => 'apihelp-pollny-example-6'
+ );
+ }
+}
diff --git a/i18n/en.json b/i18n/en.json
index ba654bb..3f4e5dc 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -91,5 +91,18 @@
"poll-time-minutes": "{{PLURAL:$1|one minute|$1 minutes}}",
"poll-time-seconds": "{{PLURAL:$1|one second|$1 seconds}}",
"specialpages-group-poll": "Polls",
- "right-polladmin": "Administer polls"
+ "right-polladmin": "Administer polls",
+ "apihelp-pollny-description": "PollNY API - includes both user and admin
functions.",
+ "apihelp-pollny-param-what": "What to do?",
+ "apihelp-pollny-param-choiceID": "Same as clicking the <choiceID>th choice
via the GUI; only used when what=vote.",
+ "apihelp-pollny-param-pageName": "Title to check for (only used when
what=titleExists); should be URL-encoded.",
+ "apihelp-pollny-param-pollID": "Poll ID of the poll that is being
deleted/updated/voted for.",
+ "apihelp-pollny-param-pageID": "Page ID (only used when
what=getPollResults).",
+ "apihelp-pollny-param-status": "New status of the poll (when
what=updateStatus); possible values are 0 (=closed), 1 and 2 (=flagged).",
+ "apihelp-pollny-example-1": "Deletes the poll #66",
+ "apihelp-pollny-example-2": "Gets the results of the poll #666",
+ "apihelp-pollny-example-3": "Gets a random poll to which the current user
hasn't answered yet",
+ "apihelp-pollny-example-4": "Checks if there is already a poll with the
title \"Is PollNY awesome?\"",
+ "apihelp-pollny-example-5": "Sets the status of the poll #47 to 1 (=open);
possible status values are 0 (=closed), 1 and 2 (=flagged)",
+ "apihelp-pollny-example-6": "Votes (answers) the poll #33 with the 4th
choice"
}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b502890..e1104ed 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -93,5 +93,18 @@
"poll-time-minutes": "Used as <code>$1</code> in the following
messages:\n* {{msg-mw|Poll-ago}}\n* {{msg-mw|Poll-time-ago}}\nParameters:\n* $1
- number of minutes\n{{Related|Poll-time}}\n{{Identical|Minute}}",
"poll-time-seconds": "Used as <code>$1</code> in the following
messages:\n* {{msg-mw|Poll-ago}}\n* {{msg-mw|Poll-time-ago}}\nParameters:\n* $1
- number of seconds\n{{Related|Poll-time}}\n{{Identical|Second}}",
"specialpages-group-poll": "{{doc-special-group}}\n{{Identical|Poll}}",
- "right-polladmin": "{{doc-right|polladmin}}"
+ "right-polladmin": "{{doc-right|polladmin}}",
+ "apihelp-pollny-description": "{{doc-apihelp-description|pollny}}",
+ "apihelp-pollny-param-what": "{{doc-apihelp-param|pollny|what}}",
+ "apihelp-pollny-param-choiceID":
"{{doc-apihelp-param|pollny|choiceID}}",
+ "apihelp-pollny-param-pageName":
"{{doc-apihelp-param|pollny|pageName}}",
+ "apihelp-pollny-param-pollID": "{{doc-apihelp-param|pollny|pollID}}",
+ "apihelp-pollny-param-pageID": "{{doc-apihelp-param|pollny|pageID}}",
+ "apihelp-pollny-param-status": "{{doc-apihelp-param|pollny|status}}",
+ "apihelp-pollny-example-1": "{{doc-apihelp-example|pollny}}",
+ "apihelp-pollny-example-2": "{{doc-apihelp-example|pollny}}",
+ "apihelp-pollny-example-3": "{{doc-apihelp-example|pollny}}",
+ "apihelp-pollny-example-4": "{{doc-apihelp-example|pollny}}",
+ "apihelp-pollny-example-5": "{{doc-apihelp-example|pollny}}",
+ "apihelp-pollny-example-6": "{{doc-apihelp-example|pollny}}"
}
--
To view, visit https://gerrit.wikimedia.org/r/180776
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1c7b3333f76a9c1808273c45bcc3f95847f36199
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PollNY
Gerrit-Branch: master
Gerrit-Owner: M4tx <[email protected]>
Gerrit-Reviewer: Legoktm <[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