jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/321452 )

Change subject: Update for API error i18n
......................................................................


Update for API error i18n

See Iae0e2ce3. Since TemplateData master requires core master, this just
depends on the master patch instead of trying to maintain BC.

Depends-On: Iae0e2ce3bd42dd4776a9779664086119ac188412
Change-Id: Iebe8557affd5ecf206814e7fdef5d8656417dadb
---
M api/ApiTemplateData.php
M i18n/en.json
M i18n/qqq.json
3 files changed, 9 insertions(+), 8 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified
  Jforrester: Looks good to me, but someone else must approve



diff --git a/api/ApiTemplateData.php b/api/ApiTemplateData.php
index 82eed13..d66ae1f 100644
--- a/api/ApiTemplateData.php
+++ b/api/ApiTemplateData.php
@@ -19,11 +19,9 @@
         */
        public function getCustomPrinter() {
                if ( $this->getMain()->getVal( 'format' ) === null ) {
-                       $this->setWarning(
-                               "The default output format will change to 
jsonfm in the future." .
-                               " Please specify format=json explicitly."
+                       $this->addDeprecation(
+                               'apiwarn-templatedata-deprecation-format', 
'action=templatedata&!format'
                        );
-                       $this->logFeatureUsage( 'action=templatedata&!format' );
                        return $this->getMain()->createPrinterByName( 'json' );
                }
                return null;
@@ -46,7 +44,7 @@
                if ( is_null( $params['lang'] ) ) {
                        $langCode = false;
                } elseif ( !Language::isValidCode( $params['lang'] ) ) {
-                       $this->dieUsage( 'Invalid language code for parameter 
lang', 'invalidlang' );
+                       $this->dieWithError( [ 'apierror-invalidlang', 'lang' ] 
);
                } else {
                        $langCode = $params['lang'];
                }
@@ -78,9 +76,8 @@
                        $status = $tdb->getStatus();
 
                        if ( !$status->isOK() ) {
-                               $this->dieUsage(
-                                       'Page #' . intval( $row->pp_page ) . ' 
templatedata contains invalid data: '
-                                               . $status->getMessage(), 
'templatedata-corrupt'
+                               $this->dieWithError(
+                                       [ 'apierror-templatedata-corrupt', 
intval( $row->pp_page ), $status->getMessage() ]
                                );
                        }
 
diff --git a/i18n/en.json b/i18n/en.json
index 8f59418..46bac4a 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -10,6 +10,8 @@
        "apihelp-templatedata-description": "Fetch data stored by the 
TemplateData extension.",
        "apihelp-templatedata-example-1": "Return data for [[Template:Stub]] 
and [[Template:Example]]",
        "apihelp-templatedata-param-lang": "Return localized values in this 
language. By default all available translations are returned.",
+       "apierror-templatedata-corrupt": "Page #$1 templatedata contains 
invalid data: $2",
+       "apiwarn-templatedata-deprecation-format": "The default output format 
will change to <kbd>jsonfm</kbd> in the future. Please specify 
<kbd>format=json</kbd> explicitly.",
        "templatedata-desc": "Implement data storage for template parameters 
(using JSON)",
        "templatedata-doc-desc-empty": "No description.",
        "templatedata-doc-format-inline": "This template prefers inline 
formatting of parameters.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 23ddc0b..3aca464 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -20,6 +20,8 @@
        "apihelp-templatedata-description": 
"{{doc-apihelp-description|templatedata}}",
        "apihelp-templatedata-example-1": 
"{{doc-apihelp-example|templatedata}}",
        "apihelp-templatedata-param-lang": 
"{{doc-apihelp-param|templatedata|lang}}",
+       "apierror-templatedata-corrupt": "{{doc-apierror}}\n\nParameters:\n* $1 
- Page ID number\n* $2 - Localized message with further information.",
+       "apiwarn-templatedata-deprecation-format": "{{doc-apierror}}",
        "templatedata-desc": "{{desc|name=Template 
Data|url=https://www.mediawiki.org/wiki/Extension:TemplateData}}";,
        "templatedata-doc-desc-empty": "Displayed when a template has no 
description (should be a valid sentence).\n{{Identical|No description}}",
        "templatedata-doc-format-inline": "Use inline formatting of the 
template parameters in wikitext.",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iebe8557affd5ecf206814e7fdef5d8656417dadb
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/TemplateData
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Gergő Tisza <gti...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to