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/ApiListBetaFeatures.php
3 files changed, 58 insertions(+), 33 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 5afcde0..575adce 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -1,24 +1,27 @@
 {
-    "@metadata": {
-        "authors": [
-            "Mark Holmquist <[email protected]>"
-        ]
-    },
-    "mw-ui-feature-discuss": "discussion",
-    "mw-ui-feature-info": "information",
-    "mw-ui-feature-user-count": "{{PLURAL:$1|One user is|$1 users are|0=No 
users are}} trying this feature.",
-    "mw-ui-feature-requirements-betafeatures": "This feature requires the 
following {{PLURAL:$1|feature|features}} to be enabled:",
-    "mw-ui-feature-requirements-browser": "The following {{PLURAL:$1|browser 
is|browsers are}} not supported:",
-    "mw-ui-feature-requirements-javascript": "This feature requires 
JavaScript.",
-    "mw-ui-feature-requirements-skins": "This feature only works with 
{{PLURAL:$1|the following skin|the following skins}}:",
-    "prefs-betafeatures": "Beta features",
-    "betafeatures-desc": "Lets user enable or disable features on the wiki 
that are still not ready for prime-time",
-    "betafeatures-toplink": "Beta",
-    "betafeatures-auto-enroll": "Automatically enable all new beta features",
-    "betafeatures-section-desc": "Here {{PLURAL:$1|is a new feature|are some 
new features}} we're considering for {{SITENAME}}. Please try 
{{PLURAL:$1|it|them}} out and give us your thoughts, so we can improve 
{{PLURAL:$1|it|them}} based on your feedback.",
-    "betafeatures-test-check-field": "blah blah blah",
-    "betafeatures-test-feature-field": "This is a test feature - it should not 
show up.",
-    "betafeatures-tooltip": "Introducing Beta Features! This new preferences 
section lets you test and give feedback about new features before we launch 
them as default behavior. Try out something new now!",
-    "betafeatures-extension-type": "Beta features",
-    "tooltip-pt-betafeatures": "Beta features"
+       "@metadata": {
+               "authors": [
+                       "Mark Holmquist <[email protected]>"
+               ]
+       },
+       "apihelp-query+betafeatures-description": "List all BetaFeatures",
+       "apihelp-query+betafeatures-example-1": "Get all available beta 
features and show how many users have enabled them",
+       "apihelp-query+betafeatures-param-counts": "Whether to fetch how many 
users have enabled a certain preference.",
+       "betafeatures-auto-enroll": "Automatically enable all new beta 
features",
+       "betafeatures-desc": "Lets user enable or disable features on the wiki 
that are still not ready for prime-time",
+       "betafeatures-extension-type": "Beta features",
+       "betafeatures-section-desc": "Here {{PLURAL:$1|is a new feature|are 
some new features}} we're considering for {{SITENAME}}. Please try 
{{PLURAL:$1|it|them}} out and give us your thoughts, so we can improve 
{{PLURAL:$1|it|them}} based on your feedback.",
+       "betafeatures-test-check-field": "blah blah blah",
+       "betafeatures-test-feature-field": "This is a test feature - it should 
not show up.",
+       "betafeatures-tooltip": "Introducing Beta Features! This new 
preferences section lets you test and give feedback about new features before 
we launch them as default behavior. Try out something new now!",
+       "betafeatures-toplink": "Beta",
+       "mw-ui-feature-discuss": "discussion",
+       "mw-ui-feature-info": "information",
+       "mw-ui-feature-requirements-betafeatures": "This feature requires the 
following {{PLURAL:$1|feature|features}} to be enabled:",
+       "mw-ui-feature-requirements-browser": "The following 
{{PLURAL:$1|browser is|browsers are}} not supported:",
+       "mw-ui-feature-requirements-javascript": "This feature requires 
JavaScript.",
+       "mw-ui-feature-requirements-skins": "This feature only works with 
{{PLURAL:$1|the following skin|the following skins}}:",
+       "mw-ui-feature-user-count": "{{PLURAL:$1|One user is|$1 users are|0=No 
users are}} trying this feature.",
+       "prefs-betafeatures": "Beta features",
+       "tooltip-pt-betafeatures": "Beta features"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index cd174cf..d5e9f34 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -8,21 +8,24 @@
                        "Liuxinyu970226"
                ]
        },
-       "mw-ui-feature-discuss": "Used as link text for the link which points 
to discussion of a feature.\n{{Identical|Discussion}}",
-       "mw-ui-feature-info": "Used as link text for the link which points to 
information about a feature.\n{{Identical|Information}}",
-       "mw-ui-feature-user-count": "Used to show how many users have enabled a 
particular feature on the site.\n\nParameters:\n* $1 - number of users",
-       "mw-ui-feature-requirements-betafeatures": "Error message shown when 
other features are required and not enabled.\n\nFollowed by list of 
features.\n\nParameters:\n* $1 - number of features in list",
-       "mw-ui-feature-requirements-browser": "Error message shown when the 
browser is not supported.\n\nFollowed by list of browsers.\n\nParameters:\n* $1 
- number of browsers in list",
-       "mw-ui-feature-requirements-javascript": "Error message shown when the 
feature requires JavaScript.",
-       "mw-ui-feature-requirements-skins": "Error message shown when the skin 
is not supported.\n\nFollowed by list of skins.\n\nParameters:\n* $1 - number 
of skins in list",
-       "prefs-betafeatures": "Used as section title for beta features in 
[[Special:Preferences]].\n{{Identical|Beta feature}}",
-       "betafeatures-desc": "{{desc|name=Beta 
Features|url=http://www.mediawiki.org/wiki/Extension:BetaFeatures}}";,
-       "betafeatures-toplink": "Used as link text. The link points to 
[[Special:Preferences]] but takes the user directly to the \"Beta\" 
section.\n\nSee example: 
[[mw:Special:Preferences#mw-prefsection-editing|mw:Special:Preferences]]\n\n{{Identical|Beta}}",
+       "apihelp-query+betafeatures-description": 
"{{doc-apihelp-description|query+betafeatures}}",
+       "apihelp-query+betafeatures-example-1": 
"{{doc-apihelp-example|query+betafeatures}}",
+       "apihelp-query+betafeatures-param-counts": 
"{{doc-apihelp-param|query+betafeatures|counts}}",
        "betafeatures-auto-enroll": "Label for a checkbox that automatically 
enrolls the user in all the experiments happening on the wiki.\n\nDescription 
for this checkbox is:\n* {{msg-mw|Betafeatures-auto-enroll-desc}}",
+       "betafeatures-desc": "{{desc|name=Beta 
Features|url=http://www.mediawiki.org/wiki/Extension:BetaFeatures}}";,
+       "betafeatures-extension-type": "Section header on 
[[Special:Version]].\n{{Identical|Beta feature}}",
        "betafeatures-section-desc": "Used as description for the checkbox in 
[[Special:Preferences]].\n\nFollowed by the checkbox which has the label 
{{msg-mw|Betafeatures-auto-enroll}}.\n\nParameters:\n* $1 - number of beta 
features",
        "betafeatures-test-check-field": "Used as label for the checkbox, used 
to test the extension.\n\nThe description for this checkbox is 
{{msg-mw|Betafeatures-test-feature-field}}.",
        "betafeatures-test-feature-field": "Used as description for the 
checkbox, used to test the extension.\n\nThe label for the checkbox is 
{{msg-mw|Betafeatures-test-check-field}}.",
        "betafeatures-tooltip": "A tooltip meant to advertise the existence of 
the BetaFeatures preferences page the first time a user sees it. Only shown 
once, meant to be a call to action. \"Introducing\" is jargon meaning \"we are 
explaining you\", you can avoid translating it in your language if it doesn't 
fit.",
-       "betafeatures-extension-type": "Section header on 
[[Special:Version]].\n{{Identical|Beta feature}}",
+       "betafeatures-toplink": "Used as link text. The link points to 
[[Special:Preferences]] but takes the user directly to the \"Beta\" 
section.\n\nSee example: 
[[mw:Special:Preferences#mw-prefsection-editing|mw:Special:Preferences]]\n\n{{Identical|Beta}}",
+       "mw-ui-feature-discuss": "Used as link text for the link which points 
to discussion of a feature.\n{{Identical|Discussion}}",
+       "mw-ui-feature-info": "Used as link text for the link which points to 
information about a feature.\n{{Identical|Information}}",
+       "mw-ui-feature-requirements-betafeatures": "Error message shown when 
other features are required and not enabled.\n\nFollowed by list of 
features.\n\nParameters:\n* $1 - number of features in list",
+       "mw-ui-feature-requirements-browser": "Error message shown when the 
browser is not supported.\n\nFollowed by list of browsers.\n\nParameters:\n* $1 
- number of browsers in list",
+       "mw-ui-feature-requirements-javascript": "Error message shown when the 
feature requires JavaScript.",
+       "mw-ui-feature-requirements-skins": "Error message shown when the skin 
is not supported.\n\nFollowed by list of skins.\n\nParameters:\n* $1 - number 
of skins in list",
+       "mw-ui-feature-user-count": "Used to show how many users have enabled a 
particular feature on the site.\n\nParameters:\n* $1 - number of users",
+       "prefs-betafeatures": "Used as section title for beta features in 
[[Special:Preferences]].\n{{Identical|Beta feature}}",
        "tooltip-pt-betafeatures": "Tooltip shown when hovering over the  
{{msg-mw|betafeatures-toplink}} link in your personal toolbox (upper right 
side)\n{{Identical|Beta feature}}"
 }
diff --git a/includes/ApiListBetaFeatures.php b/includes/ApiListBetaFeatures.php
index 7306153..88d9dd8 100644
--- a/includes/ApiListBetaFeatures.php
+++ b/includes/ApiListBetaFeatures.php
@@ -65,23 +65,42 @@
                );
        }
 
+       /**
+        * @deprecated since MediaWiki core 1.25
+        */
        public function getParamDescription() {
                return array(
                        'counts' => 'Whether to fetch how many users have 
enabled a certain preference.',
                );
        }
 
+       /**
+        * @deprecated since MediaWiki core 1.25
+        */
        public function getDescription() {
                return 'List all BetaFeatures';
        }
 
 
+       /**
+        * @deprecated since MediaWiki core 1.25
+        */
        public function getExamples() {
                return array(
                        'api.php?action=query&list=betafeatures&bfcounts=' => 
'Get all available betafeatures and show how many users have enabled them'
                );
        }
 
+       /**
+        * @see ApiBase::getExamplesMessages()
+        */
+       protected function getExamplesMessages() {
+               return array(
+                       'action=query&list=betafeatures&bfcounts='
+                               => 'apihelp-query+betafeatures-example-1',
+               );
+       }
+
        public function getHelpUrls() {
                return 
'https://www.mediawiki.org/wiki/Extension:BetaFeatures/API';
        }

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

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