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 ApiQueryGlobalUsage.php
M i18n/en.json
M i18n/qqq.json
3 files changed, 52 insertions(+), 24 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ApiQueryGlobalUsage.php b/ApiQueryGlobalUsage.php
index a5148d8..1b578e8 100644
--- a/ApiQueryGlobalUsage.php
+++ b/ApiQueryGlobalUsage.php
@@ -125,11 +125,17 @@
                                ApiBase :: PARAM_MAX => ApiBase :: LIMIT_BIG1,
                                ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2
                        ),
-                       'continue' => null,
+                       'continue' => array(
+                               /** @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',
+                       ),
                        'filterlocal' => false,
                );
        }
 
+       /**
+        * @deprecated since MediaWiki core 1.25
+        */
        public function getParamDescription() {
                return array(
                        'prop' => array(
@@ -144,10 +150,16 @@
                );
        }
 
+       /**
+        * @deprecated since MediaWiki core 1.25
+        */
        public function getDescription() {
                return 'Returns global image usage for a certain image';
        }
 
+       /**
+        * @deprecated since MediaWiki core 1.25
+        */
        public function getExamples() {
                return array(
                        "Get usage of File:Example.jpg:",
@@ -155,8 +167,14 @@
                );
        }
 
-       public function getVersion() {
-               return __CLASS__ . ': $Id$';
+       /**
+        * @see ApiBase::getExamplesMessages()
+        */
+       protected function getExamplesMessages() {
+               return array(
+                       'action=query&prop=globalusage&titles=File:Example.jpg'
+                               => 'apihelp-query+globalusage-example-1',
+               );
        }
 
        public function getCacheMode( $params ) {
diff --git a/i18n/en.json b/i18n/en.json
index 5241c6b..dcc55af 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -1,22 +1,27 @@
 {
-    "@metadata": {
-        "authors": [
-            "Bryan Tong Minh"
-        ]
-    },
-    "globalusage": "Global file usage",
-    "globalusage-for": "Global usage for \"$1\"",
-    "globalusage-desc": "[[Special:GlobalUsage|Special page]] to view global 
file usage",
-    "globalusage-ok": "Search",
-    "globalusage-text": "Search global file usage",
-    "globalusage-no-results": "[[:$1]] is not used on other wikis.",
-    "globalusage-on-wiki": "Usage on $2",
-    "globalusage-of-file": "The following other wikis use this file:",
-    "globalusage-more": "View [[{{#Special:GlobalUsage}}/$1|more global 
usage]] of this file.",
-    "globalusage-filterlocal": "Do not show local usage",
-    "mostgloballylinkedfiles": "Most globally linked files",
-    "mostgloballylinkedfiles-summary": "List of files that have been embedded 
the highest number of times across all wikis. For the equivalent list that 
takes into account only usages on {{SITENAME}}, see 
[[{{#special:MostLinkedFiles}}]].",
-    "globallywantedfiles": "Globally wanted files",
-    "globallywantedfiles-summary": "List of files that have been embedded the 
highest number of times across all wikis despite not existing. For the 
equivalent list that takes into account only usages on {{SITENAME}}, see 
[[{{#special:WantedFiles}}]].",
-    "globallywantedfiles-foreign-repo": "<strong>Warning:</strong> This wiki 
uses a foreign file repository. Files from the foreign repository that are in 
use will show up on this list as struck out blue links despite the fact that 
they exist."
+       "@metadata": {
+               "authors": [
+                       "Bryan Tong Minh"
+               ]
+       },
+       "globalusage": "Global file usage",
+       "globalusage-for": "Global usage for \"$1\"",
+       "globalusage-desc": "[[Special:GlobalUsage|Special page]] to view 
global file usage",
+       "globalusage-ok": "Search",
+       "globalusage-text": "Search global file usage",
+       "globalusage-no-results": "[[:$1]] is not used on other wikis.",
+       "globalusage-on-wiki": "Usage on $2",
+       "globalusage-of-file": "The following other wikis use this file:",
+       "globalusage-more": "View [[{{#Special:GlobalUsage}}/$1|more global 
usage]] of this file.",
+       "globalusage-filterlocal": "Do not show local usage",
+       "mostgloballylinkedfiles": "Most globally linked files",
+       "mostgloballylinkedfiles-summary": "List of files that have been 
embedded the highest number of times across all wikis. For the equivalent list 
that takes into account only usages on {{SITENAME}}, see 
[[{{#special:MostLinkedFiles}}]].",
+       "globallywantedfiles": "Globally wanted files",
+       "globallywantedfiles-summary": "List of files that have been embedded 
the highest number of times across all wikis despite not existing. For the 
equivalent list that takes into account only usages on {{SITENAME}}, see 
[[{{#special:WantedFiles}}]].",
+       "globallywantedfiles-foreign-repo": "<strong>Warning:</strong> This 
wiki uses a foreign file repository. Files from the foreign repository that are 
in use will show up on this list as struck out blue links despite the fact that 
they exist.",
+       "apihelp-query+globalusage-description": "Returns global image usage 
for a certain image.",
+       "apihelp-query+globalusage-param-prop": "Which properties to 
return:\n;url:Adds url.\n;pageid:Adds page ID.\n;namespace:Adds namespace ID.",
+       "apihelp-query+globalusage-param-limit": "How many links to return.",
+       "apihelp-query+globalusage-param-filterlocal": "Filter local usage of 
the file.",
+       "apihelp-query+globalusage-example-1": "Get usage of 
[[:File:Example.jpg]]"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 82640ef..406b28d 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -29,5 +29,10 @@
        "mostgloballylinkedfiles-summary": "Summary for 
[[Special:MostGloballyLinkedFiles]].\n\n\"Global\" refers to the fact that this 
takes into account all the wikis in the current wiki family and not just the 
current wiki.\n\nThis is similar to {{msg-mw|Mostimages-summary}}, but for the 
global special page.",
        "globallywantedfiles": "{{doc-special|GloballyWantedFiles}}\nName of 
the the special that lists non-existent files with most usages across all 
wikis. Global refers to the usage (all wikis, not just current wiki). This is 
similar to {{msg-mw|wantedfiles}}, but for the global special page.",
        "globallywantedfiles-summary": "Summary of 
[[Special:GloballyWantedFiles]].\n\n\"Global\" refers to the fact that this 
takes into account all the wikis in the wiki family, not just the current wiki. 
This is similar to {{msg-mw|wantedfiles-summary}} or 
{{msg-mw|wantedfilestext-cat}}, but for the global special page.",
-       "globallywantedfiles-foreign-repo": "Warning shown on top of 
Special:GloballyWantedFiles (Between the {{msg-mw|perfcachedts}} and 
{{msg-mw|showingresultsinrange}} messages) if the wiki has a foreign repository 
enabled."
+       "globallywantedfiles-foreign-repo": "Warning shown on top of 
Special:GloballyWantedFiles (Between the {{msg-mw|perfcachedts}} and 
{{msg-mw|showingresultsinrange}} messages) if the wiki has a foreign repository 
enabled.",
+       "apihelp-query+globalusage-description": 
"{{doc-apihelp-description|query+globalusage}}",
+       "apihelp-query+globalusage-param-prop": 
"{{doc-apihelp-param|query+globalusage|prop}}",
+       "apihelp-query+globalusage-param-limit": 
"{{doc-apihelp-param|query+globalusage|limit}}",
+       "apihelp-query+globalusage-param-filterlocal": 
"{{doc-apihelp-param|query+globalusage|filterlocal}}",
+       "apihelp-query+globalusage-example-1": 
"{{doc-apihelp-example|query+globalusage}}"
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/169823
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I67395aff48185f3e09da31b51a08aa2541fe6a17
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GlobalUsage
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Legoktm <[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

Reply via email to