jenkins-bot has submitted this change and it was merged.
Change subject: Convert API help to use i18n pt.4
......................................................................
Convert API help to use i18n pt.4
- API help modified to use i18n messages
- i18n messages edited to add said messages
Bug: T74704
Change-Id: I6502f6219ea23c7edbf5848a4f3ed561c428e492
---
M repo/i18n/en.json
M repo/i18n/qqq.json
M repo/includes/api/SetClaim.php
M repo/includes/api/SetClaimValue.php
M repo/includes/api/SetDescription.php
M repo/includes/api/SetLabel.php
M repo/includes/api/SetQualifier.php
7 files changed, 164 insertions(+), 173 deletions(-)
Approvals:
Aude: Looks good to me, approved
jenkins-bot: Verified
diff --git a/repo/i18n/en.json b/repo/i18n/en.json
index a04f08a..69460ba 100644
--- a/repo/i18n/en.json
+++ b/repo/i18n/en.json
@@ -454,7 +454,7 @@
"apihelp-wbeditentity-example-6": "Sets sitelink for nowiki,
overwriting it if it already exists",
"apihelp-wbeditentity-example-7": "Sets description for nb, overwriting
it if it already exists",
"apihelp-wbeditentity-example-8": "Creates a new claim on the item for
the property P56 and a value of \"ExampleString\"",
- "apihelp-wbeditentity-example-9": "Removes the claims from the item
with the guids Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F and
Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X",
+ "apihelp-wbeditentity-example-9": "Removes the claims from the item
with the GUIDs Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F and
Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X",
"apihelp-wbeditentity-example-10": "Sets the claim with the GUID to the
value of the claim",
"apihelp-wbformatvalue-description": "Formats DataValues.",
"apihelp-wbformatvalue-param-generate": "The desired output format to
generate.",
@@ -555,5 +555,53 @@
"apihelp-wbsetaliases-example-1": "Set the English aliases for the
entity with ID Q1 to Foo and Bar",
"apihelp-wbsetaliases-example-2": "Add Foo and Bar to the list of
English aliases for the entity with ID Q1",
"apihelp-wbsetaliases-example-3": "Remove Foo and Bar from the list of
English aliases for the entity with ID Q1",
- "apihelp-wbsetaliases-example-4": "Remove Foo from the list of English
aliases for the entity with ID Q1 while adding Bar to it"
+ "apihelp-wbsetaliases-example-4": "Remove Foo from the list of English
aliases for the entity with ID Q1 while adding Bar to it",
+ "apihelp-wbsetclaim-description": "Creates or updates an entire Claim.",
+ "apihelp-wbsetclaim-param-claim": "Claim serialization",
+ "apihelp-wbsetclaim-param-index": "The index within the entity's list
of claims\/statements to move the claim\/statement to. Optional. Be aware that
when setting an index that specifies a position not next to a clam\/statement
whose main snak does not feature the same property, the whole group of
claims\/statements whose main snaks feature the same property is moved. When
not provided, an existing claim\/statement will stay in place while a new
claim\/statement will be appended to the last claim\/statement whose main snak
features the same property.",
+ "apihelp-wbsetclaim-param-summary": "Summary for the edit.\nWill be
prepended by an automatically generated comment. The length limit of
the\nautocomment together with the summary is 260 characters. Be aware that
everything above that\nlimit will be cut off.",
+ "apihelp-wbsetclaim-param-baserevid": "The numeric identifier for the
revision to base the modification on.\nThis is used for detecting conflicts
during save.",
+ "apihelp-wbsetclaim-param-bot": "Mark this edit as bot\nThis URL flag
will only be respected if the user belongs to the group \"bot\".",
+ "apihelp-wbsetclaim-example-1": "Set the claim with the given ID to
property P1 with a string value of \"City\"",
+ "apihelp-wbsetclaim-example-2": "Set the claim with the given ID to
property P1 with a string value of \"City\" and move the claim to the topmost
position within the entity's subgroup of claims that feature the main snak
property P1. In addition, move the whole subgroup to the top of all subgroups
aggregated by property.",
+ "apihelp-wbsetclaimvalue-description": "Sets the value of a Wikibase
claim.",
+ "apihelp-wbsetclaimvalue-param-claim": "A GUID identifying the claim",
+ "apihelp-wbsetclaimvalue-param-snaktype": "The type of the snak",
+ "apihelp-wbsetclaimvalue-param-value": "The value to set the datavalue
of the the main snak of the claim to",
+ "apihelp-wbsetclaimvalue-param-summary": "Summary for the edit.\nWill
be prepended by an automatically generated comment. The length limit of
the\nautocomment together with the summary is 260 characters. Be aware that
everything above that\nlimit will be cut off.",
+ "apihelp-wbsetclaimvalue-param-baserevid": "The numeric identifier for
the revision to base the modification on.\nThis is used for detecting conflicts
during save.",
+ "apihelp-wbsetclaimvalue-param-bot": "Mark this edit as bot\nThis URL
flag will only be respected if the user belongs to the group \"bot\".",
+ "apihelp-wbsetclaimvalue-example-1": "Sets the claim with the GUID of
Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F to a value of Q1",
+ "apihelp-wbsetdescription-description": "Sets a description for a
single Wikibase entity.",
+ "apihelp-wbsetdescription-param-id": "The identifier for the entity,
including the prefix.\nUse either 'id' or 'site' and 'title' together.",
+ "apihelp-wbsetdescription-param-site": "An identifier for the site on
which the page resides.\nUse together with 'title' to make a complete
sitelink.",
+ "apihelp-wbsetdescription-param-title": "Title of the page to
associate.\nUse together with 'site' to make a complete sitelink.",
+ "apihelp-wbsetdescription-param-baserevid": "The numeric identifier for
the revision to base the modification on.\nThis is used for detecting conflicts
during save.",
+ "apihelp-wbsetdescription-param-summary": "Summary for the edit.\nWill
be prepended by an automatically generated comment. The length limit of
the\nautocomment together with the summary is 260 characters. Be aware that
everything above that\nlimit will be cut off.",
+ "apihelp-wbsetdescription-param-bot": "Mark this edit as bot\nThis URL
flag will only be respected if the user belongs to the group \"bot\".",
+ "apihelp-wbsetdescription-param-language": "Language of the
description",
+ "apihelp-wbsetdescription-param-value": "The value to set for the
description",
+ "apihelp-wbsetdescription-example-1": "Set the string \"An encyclopedia
that everyone can edit\" for page with ID \"Q42\" as a description in English
language",
+ "apihelp-wbsetdescription-example-2": "Set the string \"An encyclopedia
that everyone can edit\" as a description in English language for page with a
sitelink to enwiki:Wikipedia",
+ "apihelp-wbsetlabel-description": "Sets a label for a single Wikibase
entity.",
+ "apihelp-wbsetlabel-param-id": "The identifier for the entity,
including the prefix.\nUse either 'id' or 'site' and 'title' together.",
+ "apihelp-wbsetlabel-param-site": "An identifier for the site on which
the page resides.\nUse together with 'title' to make a complete sitelink.",
+ "apihelp-wbsetlabel-param-title": "Title of the page to associate.\nUse
together with 'site' to make a complete sitelink.",
+ "apihelp-wbsetlabel-param-baserevid": "The numeric identifier for the
revision to base the modification on.\nThis is used for detecting conflicts
during save.",
+ "apihelp-wbsetlabel-param-summary": "Summary for the edit.\nWill be
prepended by an automatically generated comment. The length limit of
the\nautocomment together with the summary is 260 characters. Be aware that
everything above that\nlimit will be cut off.",
+ "apihelp-wbsetlabel-param-bot": "Mark this edit as bot\nThis URL flag
will only be respected if the user belongs to the group \"bot\".",
+ "apihelp-wbsetlabel-param-language": "Language of the label",
+ "apihelp-wbsetlabel-param-value": "The value of the label",
+ "apihelp-wbsetlabel-example-1": "Set the string \"Wikimedia\" for page
with ID \"Q42\" as a label in English language and report it as pretty printed
json",
+ "apihelp-wbsetlabel-example-2": "Set the English language label to
\"Earth\" for the item with site link enwiki => \"Earth\".",
+ "apihelp-wbsetqualifier-description": "Creates a qualifier or sets the
value of an existing one.",
+ "apihelp-wbsetqualifier-param-claim": "A GUID identifying the claim for
which a qualifier is being set",
+ "apihelp-wbsetqualifier-param-property": "ID of the snaks
property.\nShould only be provided when creating a new qualifier or changing
the property of an existing one",
+ "apihelp-wbsetqualifier-param-value": "The new value of the
qualifier.\nShould only be provdied for PropertyValueSnak qualifiers",
+ "apihelp-wbsetqualifier-param-snaktype": "The type of the snak.\nShould
only be provided when creating a new qualifier or changing the type of an
existing one",
+ "apihelp-wbsetqualifier-param-snakhash": "The hash of the snak to
modify.\nShould only be provided for existing qualifiers",
+ "apihelp-wbsetqualifier-param-summary": "Summary for the edit.\nWill be
prepended by an automatically generated comment. The length limit of
the\nautocomment together with the summary is 260 characters. Be aware that
everything above that\nlimit will be cut off.",
+ "apihelp-wbsetqualifier-param-baserevid": "The numeric identifier for
the revision to base the modification on.\nThis is used for detecting conflicts
during save.",
+ "apihelp-wbsetqualifier-param-bot": "Mark this edit as bot\nThis URL
flag will only be respected if the user belongs to the group \"bot\".",
+ "apihelp-wbsetqualifier-example-1": "Set the qualifier for the given
claim with property P1 to string value GdyjxP8I6XB3"
}
diff --git a/repo/i18n/qqq.json b/repo/i18n/qqq.json
index 351167e..2dd9ed2 100644
--- a/repo/i18n/qqq.json
+++ b/repo/i18n/qqq.json
@@ -544,5 +544,88 @@
"apihelp-wbparsevalue-param-values":
"{{doc-apihelp-param|wbparsevalue|values}}",
"apihelp-wbparsevalue-param-options":
"{{doc-apihelp-param|wbparsevalue|options}}",
"apihelp-wbparsevalue-example-1":
"{{doc-apihelp-example|wbparsevalue}}",
- "apihelp-wbparsevalue-example-2": "{{doc-apihelp-example|wbparsevalue}}"
+ "apihelp-wbparsevalue-example-2":
"{{doc-apihelp-example|wbparsevalue}}",
+ "apihelp-wbremoveclaims-description":
"{{doc-apihelp-description|wbremoveclaims}}",
+ "apihelp-wbremoveclaims-param-claim":
"{{doc-apihelp-param|wbremoveclaims|claim}}",
+ "apihelp-wbremoveclaims-example-1":
"{{doc-apihelp-example|wbremoveclaim}}",
+ "apihelp-wbremovequalifiers-description":
"{{doc-apihelp-description|wbremovequalifiers}}",
+ "apihelp-wbremovequalifiers-param-claim":
"{{doc-apihelp-param|wbremovequalifiers|claim}}",
+ "apihelp-wbremovequalifiers-param-qualifiers":
"{{doc-apihelp-param|wbremovequalifiers|qualifiers}}",
+ "apihelp-wbremovequalifiers-example-1":
"{{doc-apihelp-example|wbremovequalifiers}}",
+ "apihelp-wbremovereferences-description":
"{{doc-apihelp-description|wbremovereferences}}",
+ "apihelp-wbremovereferences-param-statement":
"{{doc-apihelp-param|wbremovereferences|statement}}",
+ "apihelp-wbremovereferences-param-references":
"{{doc-apihelp-param|wbremovereferences|references}}",
+ "apihelp-wbremovereferences-example-1":
"{{doc-apihelp-example|wbremovereferences}}",
+ "apihelp-wbsearchentities-description":
"{{doc-apihelp-description|wbsearchentities}}",
+ "apihelp-wbsearchentities-param-search":
"{{doc-apihelp-param|wbsearchentities|search}}",
+ "apihelp-wbsearchentities-param-language":
"{{doc-apihelp-param|wbsearchentities|language}}",
+ "apihelp-wbsearchentities-param-type":
"{{doc-apihelp-param|wbsearchentities|type}}",
+ "apihelp-wbsearchentities-param-limit":
"{{doc-apihelp-param|wbsearchentities|limit}}",
+ "apihelp-wbsearchentities-param-continue":
"{{doc-apihelp-param|wbsearchentities|continue}}",
+ "apihelp-wbsearchentities-example-1":
"{{doc-apihelp-example|wbsearchentities}}",
+ "apihelp-wbsearchentities-example-2":
"{{doc-apihelp-example|wbsearchentities}}",
+ "apihelp-wbsearchentities-example-3":
"{{doc-apihelp-example|wbsearchentities}}",
+ "apihelp-wbsetaliases-description":
"{{doc-apihelp-description|wbsetaliases}}",
+ "apihelp-wbsetaliases-param-id":
"{{doc-apihelp-param|wbsetaliases|id}}",
+ "apihelp-wbsetaliases-param-site":
"{{doc-apihelp-param|wbsetaliases|site}}",
+ "apihelp-wbsetaliases-param-title":
"{{doc-apihelp-param|wbsetaliases|title}}",
+ "apihelp-wbsetaliases-param-baserevid":
"{{doc-apihelp-param|wbsetaliases|baserevid}}",
+ "apihelp-wbsetaliases-param-summary":
"{{doc-apihelp-param|wbsetaliases|summary}}",
+ "apihelp-wbsetaliases-param-bot":
"{{doc-apihelp-param|wbsetaliases|bot}}",
+ "apihelp-wbsetaliases-param-add":
"{{doc-apihelp-param|wbsetaliases|add}}",
+ "apihelp-wbsetaliases-param-remove":
"{{doc-apihelp-param|wbsetaliases|remove}}",
+ "apihelp-wbsetaliases-param-set":
"{{doc-apihelp-param|wbsetaliases|set}}",
+ "apihelp-wbsetaliases-param-language":
"{{doc-apihelp-param|wbsetaliases|language}}",
+ "apihelp-wbsetaliases-example-1":
"{{doc-apihelp-example|wbsetaliases}}",
+ "apihelp-wbsetaliases-example-2":
"{{doc-apihelp-example|wbsetaliases}}",
+ "apihelp-wbsetaliases-example-3":
"{{doc-apihelp-example|wbsetaliases}}",
+ "apihelp-wbsetaliases-example-4":
"{{doc-apihelp-example|wbsetaliases}}",
+ "apihelp-wbsetclaim-description":
"{{doc-apihelp-description|wbsetclaim}}",
+ "apihelp-wbsetclaim-param-claim":
"{{doc-apihelp-param|wbsetclaim|claim}}",
+ "apihelp-wbsetclaim-param-index":
"{{doc-apihelp-param|wbsetclaim|index}}",
+ "apihelp-wbsetclaim-param-summary":
"{{doc-apihelp-param|wbsetclaim|summary}}",
+ "apihelp-wbsetclaim-param-baserevid":
"{{doc-apihelp-param|wbsetclaim|baserevid}}",
+ "apihelp-wbsetclaim-param-bot": "{{doc-apihelp-param|wbsetclaim|bot}}",
+ "apihelp-wbsetclaim-example-1": "{{doc-apihelp-example|wbsetclaim}}",
+ "apihelp-wbsetclaim-example-2": "{{doc-apihelp-example|wbsetclaim}}",
+ "apihelp-wbsetclaimvalue-description":
"{{doc-apihelp-description|wbsetclaimvalue}}",
+ "apihelp-wbsetclaimvalue-param-claim":
"{{doc-apihelp-param|wbsetclaimvalue|claim}}",
+ "apihelp-wbsetclaimvalue-param-snaktype":
"{{doc-apihelp-param|wbsetclaimvalue|snaktype}}",
+ "apihelp-wbsetclaimvalue-param-value":
"{{doc-apihelp-param|wbsetclaimvalue|value}}",
+ "apihelp-wbsetclaimvalue-param-summary":
"{{doc-apihelp-param|wbsetclaimvalue|summary}}",
+ "apihelp-wbsetclaimvalue-param-baserevid":
"{{doc-apihelp-param|wbsetclaimvalue|baserevid}}",
+ "apihelp-wbsetclaimvalue-param-bot":
"{{doc-apihelp-param|wbsetclaimvalue|bot}}",
+ "apihelp-wbsetclaimvalue-example-1":
"{{doc-apihelp-example|wbsetclaimvalue}}",
+ "apihelp-wbsetdescription-description":
"{{doc-apihelp-description|wbsetdescription}}",
+ "apihelp-wbsetdescription-param-id":
"{{doc-apihelp-param|wbsetdescription|id}}",
+ "apihelp-wbsetdescription-param-site":
"{{doc-apihelp-param|wbsetdescription|site}}",
+ "apihelp-wbsetdescription-param-title":
"{{doc-apihelp-param|wbsetdescription|title}}",
+ "apihelp-wbsetdescription-param-baserevid":
"{{doc-apihelp-param|wbsetdescription|baserevid}}",
+ "apihelp-wbsetdescription-param-summary":
"{{doc-apihelp-param|wbsetdescription|summary}}",
+ "apihelp-wbsetdescription-param-bot":
"{{doc-apihelp-param|wbsetdescription|bot}}",
+ "apihelp-wbsetdescription-param-language":
"{{doc-apihelp-param|wbsetdescription|language}}",
+ "apihelp-wbsetdescription-param-value":
"{{doc-apihelp-param|wbsetdescription|value}}",
+ "apihelp-wbsetdescription-example-1":
"{{doc-apihelp-example|wbsetdescription}}",
+ "apihelp-wbsetdescription-example-2":
"{{doc-apihelp-example|wbsetdescription}}",
+ "apihelp-wbsetlabel-description":
"{{doc-apihelp-description|wbsetlabel}}",
+ "apihelp-wbsetlabel-param-id": "{{doc-apihelp-param|wbsetlabel|id}}",
+ "apihelp-wbsetlabel-param-site":
"{{doc-apihelp-param|wbsetlabel|site}}",
+ "apihelp-wbsetlabel-param-title":
"{{doc-apihelp-param|wbsetlabel|title}}",
+ "apihelp-wbsetlabel-param-baserevid":
"{{doc-apihelp-param|wbsetlabel|baserevid}}",
+ "apihelp-wbsetlabel-param-summary":
"{{doc-apihelp-param|wbsetlabel|summary}}",
+ "apihelp-wbsetlabel-param-bot": "{{doc-apihelp-param|wbsetlabel|bot}}",
+ "apihelp-wbsetlabel-param-language":
"{{doc-apihelp-param|wbsetlabel|language}}",
+ "apihelp-wbsetlabel-param-value":
"{{doc-apihelp-param|wbsetlabel|value}}",
+ "apihelp-wbsetlabel-example-1": "{{doc-apihelp-example|wbsetlabel}}",
+ "apihelp-wbsetlabel-example-2": "{{doc-apihelp-example|wbsetlabel}}",
+ "apihelp-wbsetqualifier-description":
"{{doc-apihelp-description|wbsetqualifier}}",
+ "apihelp-wbsetqualifier-param-claim":
"{{doc-apihelp-param|wbsetqualifier|claim}}",
+ "apihelp-wbsetqualifier-param-property":
"{{doc-apihelp-param|wbsetqualifier|property}}",
+ "apihelp-wbsetqualifier-param-value":
"{{doc-apihelp-param|wbsetqualifier|value}}",
+ "apihelp-wbsetqualifier-param-snaktype":
"{{doc-apihelp-param|wbsetqualifier|snaktype}}",
+ "apihelp-wbsetqualifier-param-snakhash":
"{{doc-apihelp-param|wbsetqualifier|snakhash}}",
+ "apihelp-wbsetqualifier-param-summary":
"{{doc-apihelp-param|wbsetqualifier|summary}}",
+ "apihelp-wbsetqualifier-param-baserevid":
"{{doc-apihelp-param|wbsetqualifier|baserevid}}",
+ "apihelp-wbsetqualifier-param-bot":
"{{doc-apihelp-param|wbsetqualifier|bot}}",
+ "apihelp-wbsetqualifier-example-1":
"{{doc-apihelp-example|wbsetqualifier}}"
}
diff --git a/repo/includes/api/SetClaim.php b/repo/includes/api/SetClaim.php
index e25f943..f3e475f 100644
--- a/repo/includes/api/SetClaim.php
+++ b/repo/includes/api/SetClaim.php
@@ -168,48 +168,16 @@
}
/**
- * @see ApiBase::getParamDescription
- *
- * @since 0.4
+ * @see ApiBase::getExamplesMessages()
*
* @return array
*/
- public function getParamDescription() {
- return array_merge(
- parent::getParamDescription(),
- array(
- 'claim' => 'Claim serialization',
- 'index' => 'The index within the entity\'s list
of claims/statements to move the claim/statement to. Optional. Be aware that
when setting an index that specifies a position not next to a clam/statement
whose main snak does not feature the same property, the whole group of
claims/statements whose main snaks feature the same property is moved. When not
provided, an existing claim/statement will stay in place while a new
claim/statement will be appended to the last claim/statement whose main snak
features the same property.',
- )
- );
- }
-
- /**
- * @see ApiBase::getDescription
- *
- * @since 0.4
- *
- * @return string[]
- */
- public function getDescription() {
+ protected function getExamplesMessages() {
return array(
- 'API module for creating or updating an entire Claim.'
- );
- }
-
- /**
- * @see ApiBase::getExamples
- *
- * @since 0.4
- *
- * @return string[]
- */
- protected function getExamples() {
- return array(
-
'api.php?action=wbsetclaim&claim={"id":"Q2$5627445f-43cb-ed6d-3adb-760e85bd17ee","type":"claim","mainsnak":{"snaktype":"value","property":"P1","datavalue":{"value":"City","type":"string"}}}'
- => 'Set the claim with the given id to property P1 with
a string value of "City"',
-
'api.php?action=wbsetclaim&claim={"id":"Q2$5627445f-43cb-ed6d-3adb-760e85bd17ee","type":"claim","mainsnak":{"snaktype":"value","property":"P1","datavalue":{"value":"City","type":"string"}}}&index=0'
- => 'Set the claim with the given id to property P1 with
a string value of "City" and move the claim to the topmost position within the
entity\'s subgroup of claims that feature the main snak property P1. In
addition, move the whole subgroup to the top of all subgroups aggregated by
property.',
+
'action=wbsetclaim&claim={"id":"Q2$5627445f-43cb-ed6d-3adb-760e85bd17ee","type":"claim","mainsnak":{"snaktype":"value","property":"P1","datavalue":{"value":"City","type":"string"}}}'
+ => 'apihelp-wbsetclaim-example-1',
+
'action=wbsetclaim&claim={"id":"Q2$5627445f-43cb-ed6d-3adb-760e85bd17ee","type":"claim","mainsnak":{"snaktype":"value","property":"P1","datavalue":{"value":"City","type":"string"}}}&index=0'
+ => 'apihelp-wbsetclaim-example-2',
);
}
diff --git a/repo/includes/api/SetClaimValue.php
b/repo/includes/api/SetClaimValue.php
index a36e88c..09ec2af 100644
--- a/repo/includes/api/SetClaimValue.php
+++ b/repo/includes/api/SetClaimValue.php
@@ -111,34 +111,13 @@
}
/**
- * @see \ApiBase::getParamDescription
+ * @see ApiBase::getExamplesMessages()
+ *
+ * @return array
*/
- public function getParamDescription() {
- return array_merge(
- parent::getParamDescription(),
- array(
- 'claim' => 'A GUID identifying the claim',
- 'snaktype' => 'The type of the snak',
- 'value' => 'The value to set the datavalue of
the the main snak of the claim to',
- )
- );
- }
-
- /**
- * @see \ApiBase::getDescription
- */
- public function getDescription() {
+ protected function getExamplesMessages() {
return array(
- 'API module for setting the value of a Wikibase claim.'
- );
- }
-
- /**
- * @see \ApiBase::getExamples
- */
- protected function getExamples() {
- return array(
-
'api.php?action=wbsetclaimvalue&claim=Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F&snaktype=value&value={"entity-type":"item","numeric-id":1}&token=foobar&baserevid=7201010'
=> 'Sets the claim with the GUID of Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F
to a value of Q1',
+
'action=wbsetclaimvalue&claim=Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F&snaktype=value&value={"entity-type":"item","numeric-id":1}&token=foobar&baserevid=7201010'
=> 'apihelp-wbsetclaimvalue-example-1',
);
}
}
diff --git a/repo/includes/api/SetDescription.php
b/repo/includes/api/SetDescription.php
index 612865d..e79146f 100644
--- a/repo/includes/api/SetDescription.php
+++ b/repo/includes/api/SetDescription.php
@@ -83,36 +83,16 @@
}
/**
- * @see \ApiBase::getParamDescription()
+ * @see ApiBase::getExamplesMessages()
+ *
+ * @return array
*/
- public function getParamDescription() {
- return array_merge(
- parent::getParamDescription(),
- array(
- 'language' => 'Language of the description',
- 'value' => 'The value to set for the
description',
- )
- );
- }
-
- /**
- * @see \ApiBase::getDescription()
- */
- public function getDescription() {
+ protected function getExamplesMessages() {
return array(
- 'API module to set a description for a single Wikibase
entity.'
- );
- }
-
- /**
- * @see \ApiBase::getExamples()
- */
- protected function getExamples() {
- return array(
-
'api.php?action=wbsetdescription&id=Q42&language=en&value=An%20encyclopedia%20that%20everyone%20can%20edit'
- => 'Set the string "An encyclopedia that
everyone can edit" for page with id "Q42" as a description in English language',
-
'api.php?action=wbsetdescription&site=enwiki&title=Wikipedia&language=en&value=An%20encyclopedia%20that%20everyone%20can%20edit'
- => 'Set the string "An encyclopedia that
everyone can edit" as a description in English language for page with a
sitelink to enwiki:Wikipedia',
+
'action=wbsetdescription&id=Q42&language=en&value=An%20encyclopedia%20that%20everyone%20can%20edit'
+ => 'apihelp-wbsetdescription-example-1',
+
'action=wbsetdescription&site=enwiki&title=Wikipedia&language=en&value=An%20encyclopedia%20that%20everyone%20can%20edit'
+ => 'apihelp-wbsetdescription-example-2',
);
}
diff --git a/repo/includes/api/SetLabel.php b/repo/includes/api/SetLabel.php
index ef0a1e4..0a0ab58 100644
--- a/repo/includes/api/SetLabel.php
+++ b/repo/includes/api/SetLabel.php
@@ -83,36 +83,16 @@
}
/**
- * @see \ApiBase::getParamDescription()
+ * @see ApiBase::getExamplesMessages()
+ *
+ * @return array
*/
- public function getParamDescription() {
- return array_merge(
- parent::getParamDescription(),
- array(
- 'language' => 'Language of the label',
- 'value' => 'The value of the label',
- )
- );
- }
-
- /**
- * @see \ApiBase::getDescription()
- */
- public function getDescription() {
+ protected function getExamplesMessages() {
return array(
- 'API module to set a label for a single Wikibase
entity.'
- );
- }
-
- /**
- * @see \ApiBase::getExamples()
- */
- protected function getExamples() {
- return array(
-
'api.php?action=wbsetlabel&id=Q42&language=en&value=Wikimedia&format=jsonfm'
- => 'Set the string "Wikimedia" for page with id
"Q42" as a label in English language and report it as pretty printed json',
-
'api.php?action=wbsetlabel&site=enwiki&title=Earth&language=en&value=Earth'
- => 'Set the English language label to "Earth"
for the item with site link enwiki => "Earth".',
+
'action=wbsetlabel&id=Q42&language=en&value=Wikimedia&format=jsonfm'
+ => 'apihelp-wbsetlabel-example-1',
+
'action=wbsetlabel&site=enwiki&title=Earth&language=en&value=Earth'
+ => 'apihelp-wbsetlabel-example-2',
);
}
diff --git a/repo/includes/api/SetQualifier.php
b/repo/includes/api/SetQualifier.php
index bfe6768..ae530c5 100644
--- a/repo/includes/api/SetQualifier.php
+++ b/repo/includes/api/SetQualifier.php
@@ -175,60 +175,13 @@
}
/**
- * @see ApiBase::getParamDescription
- *
- * @since 0.3
+ * @see ApiBase::getExamplesMessages()
*
* @return array
*/
- public function getParamDescription() {
- return array_merge(
- parent::getParamDescription(),
- array(
- 'claim' => 'A GUID identifying the claim for
which a qualifier is being set',
- 'property' => array(
- 'Id of the snaks property.',
- 'Should only be provided when creating
a new qualifier or changing the property of an existing one'
- ),
- 'snaktype' => array(
- 'The type of the snak.',
- 'Should only be provided when creating
a new qualifier or changing the type of an existing one'
- ),
- 'value' => array(
- 'The new value of the qualifier. ',
- 'Should only be provdied for
PropertyValueSnak qualifiers'
- ),
- 'snakhash' => array(
- 'The hash of the snak to modify.',
- 'Should only be provided for existing
qualifiers'
- ),
- )
- );
- }
-
- /**
- * @see ApiBase::getDescription
- *
- * @since 0.3
- *
- * @return string
- */
- public function getDescription() {
+ protected function getExamplesMessages() {
return array(
- 'API module for creating a qualifier or setting the
value of an existing one.'
- );
- }
-
- /**
- * @see ApiBase::getExamples
- *
- * @since 0.3
- *
- * @return array
- */
- protected function getExamples() {
- return array(
-
'api.php?action=wbsetqualifier&claim=Q2$4554c0f4-47b2-1cd9-2db9-aa270064c9f3&property=P1&value=GdyjxP8I6XB3&snaktype=value&token=foobar'
=> 'Set the qualifier for the given claim with property P1 to string value
GdyjxP8I6XB3',
+
'action=wbsetqualifier&claim=Q2$4554c0f4-47b2-1cd9-2db9-aa270064c9f3&property=P1&value=GdyjxP8I6XB3&snaktype=value&token=foobar'
=> 'apihelp-wbsetqualifier-example-1',
);
}
}
--
To view, visit https://gerrit.wikimedia.org/r/178084
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6502f6219ea23c7edbf5848a4f3ed561c428e492
Gerrit-PatchSet: 11
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Sn1per <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Hoo man <[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