From 446b83bd18bef68a097125e629943f7ecc1009c3 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 2 Jul 2015 20:29:32 +0200 Subject: [PATCH] API: Use message-per-value for apihelp-query+revisions+base-param-prop Use message-per-value for message apihelp-query+revisions+base-param-prop to allow smaller strings for translation and to add a parameter for the contentmodel for prop=parsetree, as already done for action=parse&prop=parsetree. Each prop in a message also will show up a new parameter on the help page without the adjust of the translation (but than in english instead of fully skip it). Change-Id: I8aaa061cb59ec788f8f8e09e8088ba1064e3aa1e --- includes/api/ApiQueryRevisionsBase.php | 16 ++++++++++++++++ includes/api/i18n/en.json | 15 ++++++++++++++- includes/api/i18n/qqq.json | 15 ++++++++++++++- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiQueryRevisionsBase.php b/includes/api/ApiQueryRevisionsBase.php index 76da0db826..d57dc3ccd9 100644 --- a/includes/api/ApiQueryRevisionsBase.php +++ b/includes/api/ApiQueryRevisionsBase.php @@ -441,6 +441,22 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase { 'parsetree', ), ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-prop', + ApiBase::PARAM_HELP_MSG_PER_VALUE => array( + 'ids' => 'apihelp-query+revisions+base-paramvalue-prop-ids', + 'flags' => 'apihelp-query+revisions+base-paramvalue-prop-flags', + 'timestamp' => 'apihelp-query+revisions+base-paramvalue-prop-timestamp', + 'user' => 'apihelp-query+revisions+base-paramvalue-prop-user', + 'userid' => 'apihelp-query+revisions+base-paramvalue-prop-userid', + 'size' => 'apihelp-query+revisions+base-paramvalue-prop-size', + 'sha1' => 'apihelp-query+revisions+base-paramvalue-prop-sha1', + 'contentmodel' => 'apihelp-query+revisions+base-paramvalue-prop-contentmodel', + 'comment' => 'apihelp-query+revisions+base-paramvalue-prop-comment', + 'parsedcomment' => 'apihelp-query+revisions+base-paramvalue-prop-parsedcomment', + 'content' => 'apihelp-query+revisions+base-paramvalue-prop-content', + 'tags' => 'apihelp-query+revisions+base-paramvalue-prop-tags', + 'parsetree' => array( 'apihelp-query+revisions+base-paramvalue-prop-parsetree', + CONTENT_MODEL_WIKITEXT ), + ), ), 'limit' => array( ApiBase::PARAM_TYPE => 'limit', diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json index c0633bc5a8..bf7354c020 100644 --- a/includes/api/i18n/en.json +++ b/includes/api/i18n/en.json @@ -888,7 +888,20 @@ "apihelp-query+revisions-example-first5-after": "Get first 5 revisions of the Main Page made after 2006-05-01.", "apihelp-query+revisions-example-first5-not-localhost": "Get first 5 revisions of the Main Page that were not made by anonymous user 127.0.0.1.", "apihelp-query+revisions-example-first5-user": "Get first 5 revisions of the Main Page that were made by the user MediaWiki default.", - "apihelp-query+revisions+base-param-prop": "Which properties to get for each revision:\n;ids:The ID of the revision.\n;flags:Revision flags (minor).\n;timestamp:The timestamp of the revision.\n;user:User that made the revision.\n;userid:User ID of the revision creator.\n;size:Length (bytes) of the revision.\n;sha1:SHA-1 (base 16) of the revision.\n;contentmodel:Content model ID of the revision.\n;comment:Comment by the user for the revision.\n;parsedcomment:Parsed comment by the user for the revision.\n;content:Text of the revision.\n;tags:Tags for the revision.\n;parsetree:The XML parse tree of revision content.", + "apihelp-query+revisions+base-param-prop": "Which properties to get for each revision:", + "apihelp-query+revisions+base-paramvalue-prop-ids": "The ID of the revision.", + "apihelp-query+revisions+base-paramvalue-prop-flags": "Revision flags (minor).", + "apihelp-query+revisions+base-paramvalue-prop-timestamp": "The timestamp of the revision.", + "apihelp-query+revisions+base-paramvalue-prop-user": "User that made the revision.", + "apihelp-query+revisions+base-paramvalue-prop-userid": "User ID of the revision creator.", + "apihelp-query+revisions+base-paramvalue-prop-size": "Length (bytes) of the revision.", + "apihelp-query+revisions+base-paramvalue-prop-sha1": "SHA-1 (base 16) of the revision.", + "apihelp-query+revisions+base-paramvalue-prop-contentmodel": "Content model ID of the revision.", + "apihelp-query+revisions+base-paramvalue-prop-comment": "Comment by the user for the revision.", + "apihelp-query+revisions+base-paramvalue-prop-parsedcomment": "Parsed comment by the user for the revision.", + "apihelp-query+revisions+base-paramvalue-prop-content": "Text of the revision.", + "apihelp-query+revisions+base-paramvalue-prop-tags": "Tags for the revision.", + "apihelp-query+revisions+base-paramvalue-prop-parsetree": "The XML parse tree of revision content (requires content model $1).", "apihelp-query+revisions+base-param-limit": "Limit how many revisions will be returned.", "apihelp-query+revisions+base-param-expandtemplates": "Expand templates in revision content (requires $1prop=content).", "apihelp-query+revisions+base-param-generatexml": "Generate XML parse tree for revision content (requires $1prop=content; replaced by $1prop=parsetree).", diff --git a/includes/api/i18n/qqq.json b/includes/api/i18n/qqq.json index cb5b9a5083..56ccf4632b 100644 --- a/includes/api/i18n/qqq.json +++ b/includes/api/i18n/qqq.json @@ -820,7 +820,20 @@ "apihelp-query+revisions-example-first5-after": "{{doc-apihelp-example|query+revisions}}", "apihelp-query+revisions-example-first5-not-localhost": "{{doc-apihelp-example|query+revisions}}", "apihelp-query+revisions-example-first5-user": "{{doc-apihelp-example|query+revisions}}", - "apihelp-query+revisions+base-param-prop": "{{doc-apihelp-param|query+revisions+base|prop|description=the \"prop\" parameter to revision querying modules|noseealso=1}}", + "apihelp-query+revisions+base-param-prop": "{{doc-apihelp-param|query+revisions+base|prop|description=the \"prop\" parameter to revision querying modules|noseealso=1|paramvalues=1}}", + "apihelp-query+revisions+base-paramvalue-prop-ids": "{{doc-apihelp-paramvalue|query+revisions+base|prop|ids}}", + "apihelp-query+revisions+base-paramvalue-prop-flags": "{{doc-apihelp-paramvalue|query+revisions+base|prop|flags}}", + "apihelp-query+revisions+base-paramvalue-prop-timestamp": "{{doc-apihelp-paramvalue|query+revisions+base|prop|timestamp}}", + "apihelp-query+revisions+base-paramvalue-prop-user": "{{doc-apihelp-paramvalue|query+revisions+base|prop|user}}", + "apihelp-query+revisions+base-paramvalue-prop-userid": "{{doc-apihelp-paramvalue|query+revisions+base|prop|userid}}", + "apihelp-query+revisions+base-paramvalue-prop-size": "{{doc-apihelp-paramvalue|query+revisions+base|prop|size}}", + "apihelp-query+revisions+base-paramvalue-prop-sha1": "{{doc-apihelp-paramvalue|query+revisions+base|prop|sha1}}", + "apihelp-query+revisions+base-paramvalue-prop-contentmodel": "{{doc-apihelp-paramvalue|query+revisions+base|prop|contentmodel}}", + "apihelp-query+revisions+base-paramvalue-prop-comment": "{{doc-apihelp-paramvalue|query+revisions+base|prop|comment}}", + "apihelp-query+revisions+base-paramvalue-prop-parsedcomment": "{{doc-apihelp-paramvalue|query+revisions+base|prop|parsedcomment}}", + "apihelp-query+revisions+base-paramvalue-prop-content": "{{doc-apihelp-paramvalue|query+revisions+base|prop|content}}", + "apihelp-query+revisions+base-paramvalue-prop-tags": "{{doc-apihelp-paramvalue|query+revisions+base|prop|tags}}", + "apihelp-query+revisions+base-paramvalue-prop-parsetree": "{{doc-apihelp-paramvalue|query+revisions+base|prop|parsetree|params=* $1 - Value of the constant CONTENT_MODEL_WIKITEXT|paramstart=2}}", "apihelp-query+revisions+base-param-limit": "{{doc-apihelp-param|query+revisions+base|limit|description=the \"limit\" parameter to revision querying modules|noseealso=1}}", "apihelp-query+revisions+base-param-expandtemplates": "{{doc-apihelp-param|query+revisions+base|expandtemplates|description=the \"expandtemplates\" parameter to revision querying modules|noseealso=1}}", "apihelp-query+revisions+base-param-generatexml": "{{doc-apihelp-param|query+revisions+base|generatexml|description=the \"generatexml\" parameter to revision querying modules|noseealso=1}}", -- 2.20.1