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: T76894
Change-Id: I0253a12a0a20cedc0456ee1ab501c48506e3b0eb
---
M ApiSportsTeams.php
M i18n/en.json
A i18n/qqq.json
3 files changed, 29 insertions(+), 3 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/ApiSportsTeams.php b/ApiSportsTeams.php
index 4ed0c34..a3d253f 100644
--- a/ApiSportsTeams.php
+++ b/ApiSportsTeams.php
@@ -66,6 +66,7 @@
}
/**
+ * @deprecated since MediaWiki core 1.25
* @return String: human-readable module description
*/
public function getDescription() {
@@ -84,17 +85,31 @@
);
}
- // Describe the parameter
+ /**
+ * Describe the parameter
+ *
+ * @deprecated since MediaWiki core 1.25
+ */
public function getParamDescription() {
return array_merge( parent::getParamDescription(), array(
'sportId' => 'Unique identifier (number) of the sport
in question'
) );
}
- // Get examples
+ /**
+ * Get Examples
+ *
+ * @deprecated since MediaWiki core 1.25
+ */
public function getExamples() {
return array(
'api.php?action=sportsteams&sportId=3' => 'Get the
names and teams under sport #3'
);
}
+
+ public function getExamplesMessages() {
+ return array(
+ 'action=sportsteams&sportId=3' =>
'apihelp-sportsteams-example-1'
+ );
+ }
}
\ No newline at end of file
diff --git a/i18n/en.json b/i18n/en.json
index 8b012e2..a5c2a7d 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -132,5 +132,8 @@
"sportsteams-signup-team": "Team",
"sportsteams-signup-thought": "Tell us a thought about that team",
"action-sportsteamsmanager": "add new networks",
- "right-sportsteamsmanager": "[[Special:SportsTeamsManager|Manage
networks]]"
+ "right-sportsteamsmanager": "[[Special:SportsTeamsManager|Manage
networks]]",
+ "apihelp-sportsteams-description": "API for fetching the teams for a given
sport from the database.",
+ "apihelp-sportsteams-param-sportId": "Unique identifier (number) of the
sport in question.",
+ "apihelp-sportsteams-example-1": "Get the names and teams under sport #3."
}
diff --git a/i18n/qqq.json b/i18n/qqq.json
new file mode 100644
index 0000000..aa388a6
--- /dev/null
+++ b/i18n/qqq.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": []
+ },
+ "apihelp-sportsteams-description":
"{{doc-apihelp-description|sportsteams}}",
+ "apihelp-sportsteams-param-sportId":
"{{doc-apihelp-param|sportsteams|sportId}}",
+ "apihelp-sportsteams-example-1": "{{doc-apihelp-example|sportsteams}}"
+}
--
To view, visit https://gerrit.wikimedia.org/r/181352
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0253a12a0a20cedc0456ee1ab501c48506e3b0eb
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SportsTeams
Gerrit-Branch: master
Gerrit-Owner: Unicornisaurous <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[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