mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-11-24 07:23:30 +00:00
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
This commit is contained in:
parent
108014ad6d
commit
48c47e1cf0
|
@ -88,10 +88,16 @@ class ApiQueryGadgetCategories extends ApiQueryBase {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since MediaWiki core 1.25
|
||||
*/
|
||||
public function getDescription() {
|
||||
return 'Returns a list of gadget categories';
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since MediaWiki core 1.25
|
||||
*/
|
||||
public function getParamDescription() {
|
||||
return array(
|
||||
'prop' => array(
|
||||
|
@ -104,6 +110,9 @@ class ApiQueryGadgetCategories extends ApiQueryBase {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since MediaWiki core 1.25
|
||||
*/
|
||||
public function getExamples() {
|
||||
$params = $this->getAllowedParams();
|
||||
$allProps = implode( '|', $params['prop'][ApiBase::PARAM_TYPE] );
|
||||
|
@ -116,7 +125,15 @@ class ApiQueryGadgetCategories extends ApiQueryBase {
|
|||
);
|
||||
}
|
||||
|
||||
public function getVersion() {
|
||||
return __CLASS__ . ': $Id$';
|
||||
/**
|
||||
* @see ApiBase::getExamplesMessages()
|
||||
*/
|
||||
protected function getExamplesMessages() {
|
||||
return array(
|
||||
'action=query&list=gadgetcategories'
|
||||
=> 'apihelp-query+gadgetcategories-example-1',
|
||||
'action=query&list=gadgetcategories&gcnames=foo|bar&gcprop=name|title|members'
|
||||
=> 'apihelp-query+gadgetcategories-example-2',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,10 +186,16 @@ class ApiQueryGadgets extends ApiQueryBase {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since MediaWiki core 1.25
|
||||
*/
|
||||
public function getDescription() {
|
||||
return 'Returns a list of gadgets used on this wiki';
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since MediaWiki core 1.25
|
||||
*/
|
||||
public function getParamDescription() {
|
||||
return array(
|
||||
'prop' => array(
|
||||
|
@ -205,6 +211,9 @@ class ApiQueryGadgets extends ApiQueryBase {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since MediaWiki core 1.25
|
||||
*/
|
||||
public function getExamples() {
|
||||
$params = $this->getAllowedParams();
|
||||
$allProps = implode( '|', $params['prop'][ApiBase::PARAM_TYPE] );
|
||||
|
@ -222,7 +231,23 @@ class ApiQueryGadgets extends ApiQueryBase {
|
|||
);
|
||||
}
|
||||
|
||||
public function getVersion() {
|
||||
return __CLASS__ . ': $Id$';
|
||||
/**
|
||||
* @see ApiBase::getExamplesMessages()
|
||||
*/
|
||||
protected function getExamplesMessages() {
|
||||
$params = $this->getAllowedParams();
|
||||
$allProps = implode( '|', $params['prop'][ApiBase::PARAM_TYPE] );
|
||||
return array(
|
||||
'action=query&list=gadgets&gaprop=id|desc'
|
||||
=> 'apihelp-query+gadgets-example-1',
|
||||
"action=query&list=gadgets&gaprop=$allProps"
|
||||
=> 'apihelp-query+gadgets-example-2',
|
||||
'action=query&list=gadgets&gacategories=foo'
|
||||
=> 'apihelp-query+gadgets-example-3',
|
||||
'action=query&list=gadgets&gaids=foo|bar&gaprop=id|desc|metadata'
|
||||
=> 'apihelp-query+gadgets-example-4',
|
||||
'action=query&list=gadgets&gaenabledonly'
|
||||
=> 'apihelp-query+gadgets-example-5',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
60
i18n/en.json
60
i18n/en.json
|
@ -1,23 +1,39 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Daniel Kinzler, brightbyte.de"
|
||||
]
|
||||
},
|
||||
"gadgets-desc": "Lets users select custom [[Special:Gadgets|CSS and JavaScript gadgets]] in their [[Special:Preferences#mw-prefsection-gadgets|preferences]]",
|
||||
"prefs-gadgets": "Gadgets",
|
||||
"gadgets-prefstext": "Below is a list of special gadgets you can enable for your account.\nThese gadgets are mostly based on JavaScript, so JavaScript has to be enabled in your browser for them to work.\nNote that these gadgets will have no effect on this preferences page.\n\nAlso note that these special gadgets are not part of the MediaWiki software, and are usually developed and maintained by users on your local wiki.\nLocal administrators can edit the [[MediaWiki:Gadgets-definition|definitions]] and [[Special:Gadgets|descriptions]] of available gadgets.",
|
||||
"gadgets": "Gadgets",
|
||||
"gadgets-definition": "",
|
||||
"gadgets-title": "Gadgets",
|
||||
"gadgets-pagetext": "Below is a list of special gadgets users can enable on their [[Special:Preferences#mw-prefsection-gadgets|preferences page]], as defined by the [[MediaWiki:Gadgets-definition|definitions]].\nThis overview provides easy access to the system message pages that define each gadget's description and code.",
|
||||
"gadgets-uses": "Uses",
|
||||
"gadgets-required-rights": "Requires the following {{PLURAL:$2|right|rights}}:\n\n$1",
|
||||
"gadgets-required-skins": "Available on the {{PLURAL:$2|$1 skin|following skins: $1}}.",
|
||||
"gadgets-default": "Enabled for everyone by default.",
|
||||
"gadgets-export": "Export",
|
||||
"gadgets-export-title": "Gadget export",
|
||||
"gadgets-not-found": "Gadget \"$1\" not found.",
|
||||
"gadgets-export-text": "To export the $1 gadget, click on \"{{int:gadgets-export-download}}\" button, save the downloaded file,\ngo to Special:Import on destination wiki and upload it. Then add the following to MediaWiki:Gadgets-definition page:\n<pre>$2</pre>\nYou must have appropriate permissions on destination wiki (including the right to edit system messages) and import from file uploads must be enabled.",
|
||||
"gadgets-export-download": "Download"
|
||||
}
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Daniel Kinzler, brightbyte.de"
|
||||
]
|
||||
},
|
||||
"gadgets-desc": "Lets users select custom [[Special:Gadgets|CSS and JavaScript gadgets]] in their [[Special:Preferences#mw-prefsection-gadgets|preferences]]",
|
||||
"prefs-gadgets": "Gadgets",
|
||||
"gadgets-prefstext": "Below is a list of special gadgets you can enable for your account.\nThese gadgets are mostly based on JavaScript, so JavaScript has to be enabled in your browser for them to work.\nNote that these gadgets will have no effect on this preferences page.\n\nAlso note that these special gadgets are not part of the MediaWiki software, and are usually developed and maintained by users on your local wiki.\nLocal administrators can edit the [[MediaWiki:Gadgets-definition|definitions]] and [[Special:Gadgets|descriptions]] of available gadgets.",
|
||||
"gadgets": "Gadgets",
|
||||
"gadgets-definition": "",
|
||||
"gadgets-title": "Gadgets",
|
||||
"gadgets-pagetext": "Below is a list of special gadgets users can enable on their [[Special:Preferences#mw-prefsection-gadgets|preferences page]], as defined by the [[MediaWiki:Gadgets-definition|definitions]].\nThis overview provides easy access to the system message pages that define each gadget's description and code.",
|
||||
"gadgets-uses": "Uses",
|
||||
"gadgets-required-rights": "Requires the following {{PLURAL:$2|right|rights}}:\n\n$1",
|
||||
"gadgets-required-skins": "Available on the {{PLURAL:$2|$1 skin|following skins: $1}}.",
|
||||
"gadgets-default": "Enabled for everyone by default.",
|
||||
"gadgets-export": "Export",
|
||||
"gadgets-export-title": "Gadget export",
|
||||
"gadgets-not-found": "Gadget \"$1\" not found.",
|
||||
"gadgets-export-text": "To export the $1 gadget, click on \"{{int:gadgets-export-download}}\" button, save the downloaded file,\ngo to Special:Import on destination wiki and upload it. Then add the following to MediaWiki:Gadgets-definition page:\n<pre>$2</pre>\nYou must have appropriate permissions on destination wiki (including the right to edit system messages) and import from file uploads must be enabled.",
|
||||
"gadgets-export-download": "Download",
|
||||
"apihelp-query+gadgetcategories-description": "Returns a list of gadget categories.",
|
||||
"apihelp-query+gadgetcategories-param-prop": "What gadget category information to get:\n;name:Internal category name.\n;title:Category title.\n;members:Number of gadgets in category.",
|
||||
"apihelp-query+gadgetcategories-param-names": "Names of categories to retrieve.",
|
||||
"apihelp-query+gadgetcategories-example-1": "Get a list of existing gadget categories",
|
||||
"apihelp-query+gadgetcategories-example-2": "Get all information about categories named \"foo\" and \"bar\"",
|
||||
"apihelp-query+gadgets-description": "Returns a list of gadgets used on this wiki.",
|
||||
"apihelp-query+gadgets-param-prop": "What gadget information to get:\n;id:Internal gadget ID.\n;metadata:The gadget metadata.\n;desc:Gadget description transformed into HTML (can be slow, use only if really needed).",
|
||||
"apihelp-query+gadgets-param-categories": "Gadgets from what categories to retrieve.",
|
||||
"apihelp-query+gadgets-param-ids": "IDs of gadgets to retrieve.",
|
||||
"apihelp-query+gadgets-param-allowedonly": "List only gadgets allowed to current user.",
|
||||
"apihelp-query+gadgets-param-enabledonly": "List only gadgets enabled by current user.",
|
||||
"apihelp-query+gadgets-example-1": "Get a list of gadgets along with their descriptions",
|
||||
"apihelp-query+gadgets-example-2": "Get a list of gadgets with all possible properties",
|
||||
"apihelp-query+gadgets-example-3": "Get a list of gadgets belonging to category \"foo\"",
|
||||
"apihelp-query+gadgets-example-4": "Get information about gadgets \"foo\" and \"bar\"",
|
||||
"apihelp-query+gadgets-example-5": "Get a list of gadgets enabled by current user"
|
||||
}
|
||||
|
|
|
@ -29,5 +29,21 @@
|
|||
"gadgets-export-title": "Used as page title. Example: [[Special:Gadgets/export/editbuttons]]",
|
||||
"gadgets-not-found": "Used as error message. Parameters:\n* $1 - gadget name",
|
||||
"gadgets-export-text": "Used as page description in [[Special:Gadgets]].\n\nRefers to {{msg-mw|Gadgets-export-download}}.\n\nSee example: [[Special:Gadgets/export/editbuttons]]\n\nFollowed by the \"Export\" form.\n\nParameters:\n* $1 - gadget name\n* $2 - gadget definition (code)",
|
||||
"gadgets-export-download": "Use the verb for this message. Submit button.\n{{Identical|Download}}"
|
||||
"gadgets-export-download": "Use the verb for this message. Submit button.\n{{Identical|Download}}",
|
||||
"apihelp-query+gadgetcategories-description": "{{doc-apihelp-description|query+gadgetcategories}}",
|
||||
"apihelp-query+gadgetcategories-param-prop": "{{doc-apihelp-param|query+gadgetcategories|prop}}",
|
||||
"apihelp-query+gadgetcategories-param-names": "{{doc-apihelp-param|query+gadgetcategories|names}}",
|
||||
"apihelp-query+gadgetcategories-example-1": "{{doc-apihelp-example|query+gadgetcategories}}",
|
||||
"apihelp-query+gadgetcategories-example-2": "{{doc-apihelp-example|query+gadgetcategories}}",
|
||||
"apihelp-query+gadgets-description": "{{doc-apihelp-description|query+gadgets}}",
|
||||
"apihelp-query+gadgets-param-prop": "{{doc-apihelp-param|query+gadgets|prop}}",
|
||||
"apihelp-query+gadgets-param-categories": "{{doc-apihelp-param|query+gadgets|categories}}",
|
||||
"apihelp-query+gadgets-param-ids": "{{doc-apihelp-param|query+gadgets|ids}}",
|
||||
"apihelp-query+gadgets-param-allowedonly": "{{doc-apihelp-param|query+gadgets|allowedonly}}",
|
||||
"apihelp-query+gadgets-param-enabledonly": "{{doc-apihelp-param|query+gadgets|enabledonly}}",
|
||||
"apihelp-query+gadgets-example-1": "{{doc-apihelp-example|query+gadgets}}",
|
||||
"apihelp-query+gadgets-example-2": "{{doc-apihelp-example|query+gadgets}}",
|
||||
"apihelp-query+gadgets-example-3": "{{doc-apihelp-example|query+gadgets}}",
|
||||
"apihelp-query+gadgets-example-4": "{{doc-apihelp-example|query+gadgets}}",
|
||||
"apihelp-query+gadgets-example-5": "{{doc-apihelp-example|query+gadgets}}"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue