jenkins-bot has submitted this change and it was merged.
Change subject: Add i18n for API module help
......................................................................
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
---
M i18n/en.json
M i18n/qqq.json
M includes/api/ApiMobileView.php
3 files changed, 63 insertions(+), 2 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
Jdlrobson: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/i18n/en.json b/i18n/en.json
index ca2491a..3abef62 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -330,5 +330,27 @@
"tag-mobile_web_edit-description": "Edit made from mobile web site",
"skinname-minerva": "Minerva",
"mobile-frontend-pageaction-edit-tooltip": "Edit the lead section of
this page.",
- "mobile-frontend-pageaction-upload-tooltip": "Upload a lead photo to
this page."
+ "mobile-frontend-pageaction-upload-tooltip": "Upload a lead photo to
this page.",
+ "apihelp-mobileview-description": "Returns data needed for mobile
views.",
+ "apihelp-mobileview-param-page": "Title of page to process.",
+ "apihelp-mobileview-param-redirect": "Whether redirects should be
followed.",
+ "apihelp-mobileview-param-sections": "Pipe-separated list of section
numbers for which to return text. \"all\" can be used to return for all. Ranges
in format \"1-4\" mean get sections 1,2,3,4. Ranges without second number, e.g.
\"1-\" means get all until the end. \"references\" can be used to specify that
all sections containing references should be returned.",
+ "apihelp-mobileview-param-prop": "Which information to get:\n;text:HTML
of selected sections.\n;sections:Information about all sections on
page.\n;normalizedtitle:Normalized page title.\n;lastmodified:ISO 8601
timestamp for when the page was last modified, e.g.
\"2014-04-13T22:42:14Z\".\n;lastmodifiedby:Information about the user who
modified the page last.\n;revision:Return the current revision ID of the
page.\n;protection:Information about protection level.\n;editable:Whether the
current user can edit this page. This includes all factors for logged-in users
but not blocked status for anons.\n;languagecount:Number of languages that the
page is available in.\n;hasvariants:Whether or not the page is available in
other language variants.\n;displaytitle:The rendered title of the page, with
{{DISPLAYTITLE}} and such applied.\n;pageprops:Page
properties.",
+ "apihelp-mobileview-param-prop-withimages": "Which information to
get:\n;text:HTML of selected sections.\n;sections:Information about all
sections on page.\n;normalizedtitle:Normalized page title.\n;lastmodified:ISO
8601 timestamp for when the page was last modified, e.g.
\"2014-04-13T22:42:14Z\".\n;lastmodifiedby:Information about the user who
modified the page last.\n;revision:Return the current revision ID of the
page.\n;protection:Information about protection level.\n;editable:Whether the
current user can edit this page. This includes all factors for logged-in users
but not blocked status for anons.\n;languagecount:Number of languages that the
page is available in.\n;hasvariants:Whether or not the page is available in
other language variants.\n;displaytitle:The rendered title of the page, with
{{DISPLAYTITLE}} and such applied.\n;pageprops:Page
properties.\n;image:Information about an image associated with this
page.\n;thumb:Thumbnail of an image associated with this page.",
+ "apihelp-mobileview-param-sectionprop": "What information about
sections to get.",
+ "apihelp-mobileview-param-pageprops": "What page properties to return,
a pipe (\"|\") separated list or \"*\" for all properties.",
+ "apihelp-mobileview-param-variant": "Convert content into this language
variant.",
+ "apihelp-mobileview-param-noimages": "Return HTML without images.",
+ "apihelp-mobileview-param-noheadings": "Don't include headings in
output.",
+ "apihelp-mobileview-param-notransform": "Don't transform HTML into
mobile-specific version.",
+ "apihelp-mobileview-param-onlyrequestedsections": "Return only
requested sections even with $1prop=sections.",
+ "apihelp-mobileview-param-offset": "Pretend all text result is one
string, and return the substring starting at this point.",
+ "apihelp-mobileview-param-maxlen": "Pretend all text result is one
string, and limit result to this length.",
+ "apihelp-mobileview-param-thumbnail": "'Maximum thumbnail dimensions.",
+ "apihelp-mobileview-example-1": "Get information about section 0 of
[[Doom metal]]",
+ "apihelp-mobileview-example-2": "Get information about section 0 and
sections containing references of [[Candlemass]]",
+ "apihelp-mobileview-example-3": "Get information about sections 1 and
later and sections containing references of [[Candlemass]]",
+ "apihelp-parse-param-mobileformat": "Return parse output in a format
suitable for mobile devices.",
+ "apihelp-parse-param-noimages": "Disable images in mobile output.",
+ "apihelp-parse-param-mainpage": "Apply mobile main page
transformations."
}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index c5d4529..8130054 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -357,5 +357,27 @@
"tag-mobile_web_edit-description": "Short change tag description. for
edits coming directly from the mobile website.\n\nSee also:\n*
{{msg-mw|Tag-mobile web edit}}",
"skinname-minerva": "{{optional}}",
"mobile-frontend-pageaction-edit-tooltip": "Tooltip that appears when
you hover over the edit icon at the top of the page in the page action bar.",
- "mobile-frontend-pageaction-upload-tooltip": "Tooltip that appears when
you hover over the upload icon at the top of the page in the page action bar."
+ "mobile-frontend-pageaction-upload-tooltip": "Tooltip that appears when
you hover over the upload icon at the top of the page in the page action bar.",
+ "apihelp-mobileview-description":
"{{doc-apihelp-description|mobileview}}",
+ "apihelp-mobileview-param-page":
"{{doc-apihelp-param|mobileview|page}}",
+ "apihelp-mobileview-param-redirect":
"{{doc-apihelp-param|mobileview|redirect}}",
+ "apihelp-mobileview-param-sections":
"{{doc-apihelp-param|mobileview|sections}}",
+ "apihelp-mobileview-param-prop":
"{{doc-apihelp-param|mobileview|prop}}",
+ "apihelp-mobileview-param-prop-withimages":
"{{doc-apihelp-param|mobileview|prop|info=Used instead of
{{msg-mw|apihelp-mobileview-param-prop|notext=1}} when the PageImages extension
is installed.}}",
+ "apihelp-mobileview-param-sectionprop":
"{{doc-apihelp-param|mobileview|sectionprop}}",
+ "apihelp-mobileview-param-pageprops":
"{{doc-apihelp-param|mobileview|pageprops}}",
+ "apihelp-mobileview-param-variant":
"{{doc-apihelp-param|mobileview|variant}}",
+ "apihelp-mobileview-param-noimages":
"{{doc-apihelp-param|mobileview|noimages}}",
+ "apihelp-mobileview-param-noheadings":
"{{doc-apihelp-param|mobileview|noheadings}}",
+ "apihelp-mobileview-param-notransform":
"{{doc-apihelp-param|mobileview|notransform}}",
+ "apihelp-mobileview-param-onlyrequestedsections":
"{{doc-apihelp-param|mobileview|onlyrequestedsections}}",
+ "apihelp-mobileview-param-offset":
"{{doc-apihelp-param|mobileview|offset}}",
+ "apihelp-mobileview-param-maxlen":
"{{doc-apihelp-param|mobileview|maxlen}}",
+ "apihelp-mobileview-param-thumbnail":
"{{doc-apihelp-param|mobileview|thumbnail}}",
+ "apihelp-mobileview-example-1": "{{doc-apihelp-example|mobileview}}",
+ "apihelp-mobileview-example-2": "{{doc-apihelp-example|mobileview}}",
+ "apihelp-mobileview-example-3": "{{doc-apihelp-example|mobileview}}",
+ "apihelp-parse-param-mobileformat":
"{{doc-apihelp-param|parse|mobileformat}}",
+ "apihelp-parse-param-noimages": "{{doc-apihelp-param|parse|noimages}}",
+ "apihelp-parse-param-mainpage": "{{doc-apihelp-param|parse|mainpage}}"
}
diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php
index 70fffc0..0c17505 100644
--- a/includes/api/ApiMobileView.php
+++ b/includes/api/ApiMobileView.php
@@ -741,6 +741,7 @@
/**
* Get the description for Api parameters.
+ * @deprecated since MediaWiki core 1.25
* @return array
*/
public function getParamDescription() {
@@ -794,6 +795,7 @@
/**
* Get description of this Api.
+ * @deprecated since MediaWiki core 1.25
* @return string
*/
public function getDescription() {
@@ -802,6 +804,7 @@
/**
* Returns some Api request examples for mobile Api.
+ * @deprecated since MediaWiki core 1.25
* @return array
*/
public function getExamples() {
@@ -813,6 +816,20 @@
}
/**
+ * @see ApiBase::getExamplesMessages()
+ */
+ protected function getExamplesMessages() {
+ return array(
+ 'action=mobileview&page=Doom_metal§ions=0'
+ => 'apihelp-mobileview-example-1',
+
'action=mobileview&page=Candlemass§ions=0|references'
+ => 'apihelp-mobileview-example-2',
+
'action=mobileview&page=Candlemass§ions=1-|references'
+ => 'apihelp-mobileview-example-3',
+ );
+ }
+
+ /**
* Returns the Help URL for this Api
* @return string
*/
--
To view, visit https://gerrit.wikimedia.org/r/169828
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I67395aff48185f3e09da31b51a08aa2541fe6a17
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: MaxSem <[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