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:
Brad Jorsch 2014-10-29 14:20:55 -04:00
parent 3aa849fb8c
commit a9e4c40fe5
3 changed files with 18 additions and 6 deletions

View file

@ -121,6 +121,9 @@ class ApiQueryPageImages extends ApiQueryBase {
$this->getResult()->addValue( array( 'query', 'pages' ), $pageId, $vals );
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getDescription() {
return 'Returns information about images on the page such as thumbnail and presence of photos.';
}
@ -145,10 +148,15 @@ class ApiQueryPageImages extends ApiQueryBase {
),
'continue' => array(
ApiBase::PARAM_TYPE => 'integer',
/** @todo Once support for MediaWiki < 1.25 is dropped, just use ApiBase::PARAM_HELP_MSG directly */
constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' => 'api-help-param-continue',
),
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getParamDescription() {
return array(
'prop' => array( 'What information to return',
@ -160,8 +168,4 @@ class ApiQueryPageImages extends ApiQueryBase {
'continue' => 'When more results are available, use this to continue',
);
}
public function getVersion() {
return '';
}
}

View file

@ -4,5 +4,9 @@
},
"pageimages-desc": "Collects information about images used on page",
"pageimages-blacklist": "",
"pageimages-info-label": "Page image"
"pageimages-info-label": "Page image",
"apihelp-query+pageimages-description": "Returns information about images on the page, such as thumbnail and presence of photos.",
"apihelp-query+pageimages-param-prop": "Which information to return:\n;thumbnail:URL and dimensions of image associated with page, if any.\n;name:Image title.",
"apihelp-query+pageimages-param-thumbsize": "Maximum thumbnail dimension.",
"apihelp-query+pageimages-param-limit": "Properties of how many pages to return."
}

View file

@ -6,5 +6,9 @@
},
"pageimages-desc": "{{desc|name=Page Images|url=http://www.mediawiki.org/wiki/Extension:PageImages}}",
"pageimages-blacklist": "List of images. They will never be selected as page images",
"pageimages-info-label": "Label for the page image field on the action=info page.\n\nSee [{{canonicalurl:w:Main Page|action=info}} example]."
"pageimages-info-label": "Label for the page image field on the action=info page.\n\nSee [{{canonicalurl:w:Main Page|action=info}} example].",
"apihelp-query+pageimages-description": "{{doc-apihelp-description|query+pageimages}}",
"apihelp-query+pageimages-param-prop": "{{doc-apihelp-param|query+pageimages|prop}}",
"apihelp-query+pageimages-param-thumbsize": "{{doc-apihelp-param|query+pageimages|thumbsize}}",
"apihelp-query+pageimages-param-limit": "{{doc-apihelp-param|query+pageimages|limit}}"
}