From ff7327720d4c792639d9bdd0d37c242c2936a9f2 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 6 Aug 2015 09:38:57 +0200 Subject: [PATCH] API: Use message-per-value for apihelp-query+search-param-prop Use message-per-value for message apihelp-query+search-param-prop to allow smaller strings for translation. 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: Id2088213f4577c8cb88e479e8fca0e6bd3d619f4 --- includes/api/ApiQuerySearch.php | 5 +++-- includes/api/i18n/en.json | 15 ++++++++++++++- includes/api/i18n/qqq.json | 15 ++++++++++++++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index 349e7fa651..65fd727773 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -316,18 +316,19 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { 'size', 'wordcount', 'timestamp', - 'score', 'snippet', 'titlesnippet', 'redirecttitle', 'redirectsnippet', 'sectiontitle', 'sectionsnippet', - 'hasrelated', 'isfilematch', 'categorysnippet', + 'score', // deprecated + 'hasrelated', // deprecated ), ApiBase::PARAM_ISMULTI => true, + ApiBase::PARAM_HELP_MSG_PER_VALUE => array(), ), 'offset' => array( ApiBase::PARAM_DFLT => 0, diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json index ae7a9c6818..a510af3a80 100644 --- a/includes/api/i18n/en.json +++ b/includes/api/i18n/en.json @@ -914,7 +914,20 @@ "apihelp-query+search-param-namespace": "Search only within these namespaces.", "apihelp-query+search-param-what": "Which type of search to perform.", "apihelp-query+search-param-info": "Which metadata to return.", - "apihelp-query+search-param-prop": "Which properties to return:\n;size:Adds the size of the page in bytes.\n;wordcount:Adds the word count of the page.\n;timestamp:Adds the timestamp of when the page was last edited.\n;snippet:Adds a parsed snippet of the page.\n;titlesnippet:Adds a parsed snippet of the page title.\n;redirectsnippet:Adds a parsed snippet of the redirect title.\n;redirecttitle:Adds the title of the matching redirect.\n;sectionsnippet:Adds a parsed snippet of the matching section title.\n;sectiontitle:Adds the title of the matching section.\n;categorysnippet:Adds a parsed snippet of the matching category.\n;isfilematch:Adds a boolean indicating if the search matched file content.\n;score:Deprecated and ignored.\n;hasrelated:Deprecated and ignored.", + "apihelp-query+search-param-prop": "Which properties to return:", + "apihelp-query+search-paramvalue-prop-size": "Adds the size of the page in bytes.", + "apihelp-query+search-paramvalue-prop-wordcount": "Adds the word count of the page.", + "apihelp-query+search-paramvalue-prop-timestamp": "Adds the timestamp of when the page was last edited.", + "apihelp-query+search-paramvalue-prop-snippet": "Adds a parsed snippet of the page.", + "apihelp-query+search-paramvalue-prop-titlesnippet": "Adds a parsed snippet of the page title.", + "apihelp-query+search-paramvalue-prop-redirectsnippet": "Adds a parsed snippet of the redirect title.", + "apihelp-query+search-paramvalue-prop-redirecttitle": "Adds the title of the matching redirect.", + "apihelp-query+search-paramvalue-prop-sectionsnippet": "Adds a parsed snippet of the matching section title.", + "apihelp-query+search-paramvalue-prop-sectiontitle": "Adds the title of the matching section.", + "apihelp-query+search-paramvalue-prop-categorysnippet": "Adds a parsed snippet of the matching category.", + "apihelp-query+search-paramvalue-prop-isfilematch": "Adds a boolean indicating if the search matched file content.", + "apihelp-query+search-paramvalue-prop-score": "Deprecated and ignored.", + "apihelp-query+search-paramvalue-prop-hasrelated": "Deprecated and ignored.", "apihelp-query+search-param-limit": "How many total pages to return.", "apihelp-query+search-param-interwiki": "Include interwiki results in the search, if available.", "apihelp-query+search-param-backend": "Which search backend to use, if not the default.", diff --git a/includes/api/i18n/qqq.json b/includes/api/i18n/qqq.json index 95562d8f1d..63d65642f6 100644 --- a/includes/api/i18n/qqq.json +++ b/includes/api/i18n/qqq.json @@ -845,7 +845,20 @@ "apihelp-query+search-param-namespace": "{{doc-apihelp-param|query+search|namespace}}", "apihelp-query+search-param-what": "{{doc-apihelp-param|query+search|what}}", "apihelp-query+search-param-info": "{{doc-apihelp-param|query+search|info}}", - "apihelp-query+search-param-prop": "{{doc-apihelp-param|query+search|prop}}", + "apihelp-query+search-param-prop": "{{doc-apihelp-param|query+search|prop|paramvalues=1}}", + "apihelp-query+search-paramvalue-prop-size": "{{doc-apihelp-paramvalue|query+search|prop|size}}", + "apihelp-query+search-paramvalue-prop-wordcount": "{{doc-apihelp-paramvalue|query+search|prop|wordcount}}", + "apihelp-query+search-paramvalue-prop-timestamp": "{{doc-apihelp-paramvalue|query+search|prop|timestamp}}", + "apihelp-query+search-paramvalue-prop-snippet": "{{doc-apihelp-paramvalue|query+search|prop|snippet}}", + "apihelp-query+search-paramvalue-prop-titlesnippet": "{{doc-apihelp-paramvalue|query+search|prop|titlesnippet}}", + "apihelp-query+search-paramvalue-prop-redirectsnippet": "{{doc-apihelp-paramvalue|query+search|prop|redirectsnippet}}", + "apihelp-query+search-paramvalue-prop-redirecttitle": "{{doc-apihelp-paramvalue|query+search|prop|redirecttitle}}", + "apihelp-query+search-paramvalue-prop-sectionsnippet": "{{doc-apihelp-paramvalue|query+search|prop|sectionsnippet}}", + "apihelp-query+search-paramvalue-prop-sectiontitle": "{{doc-apihelp-paramvalue|query+search|prop|sectiontitle}}", + "apihelp-query+search-paramvalue-prop-categorysnippet": "{{doc-apihelp-paramvalue|query+search|prop|categorysnippet}}", + "apihelp-query+search-paramvalue-prop-isfilematch": "{{doc-apihelp-paramvalue|query+search|prop|isfilematch}}", + "apihelp-query+search-paramvalue-prop-score": "{{doc-apihelp-paramvalue|query+search|prop|score}}", + "apihelp-query+search-paramvalue-prop-hasrelated": "{{doc-apihelp-paramvalue|query+search|prop|hasrelated}}", "apihelp-query+search-param-limit": "{{doc-apihelp-param|query+search|limit}}", "apihelp-query+search-param-interwiki": "{{doc-apihelp-param|query+search|interwiki}}", "apihelp-query+search-param-backend": "{{doc-apihelp-param|query+search|backend}}", -- 2.20.1