Anomie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/321461
Change subject: Update for API error i18n
......................................................................
Update for API error i18n
See Iae0e2ce3.
Change-Id: I981d9ce115a194623a0e82a1ea4d7a3959b5cb24
---
M ApiShortenUrl.php
M i18n/en.json
M i18n/qqq.json
3 files changed, 9 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UrlShortener
refs/changes/61/321461/1
diff --git a/ApiShortenUrl.php b/ApiShortenUrl.php
index f45300b..31575c9 100644
--- a/ApiShortenUrl.php
+++ b/ApiShortenUrl.php
@@ -14,7 +14,11 @@
global $wgUrlShortenerReadOnly;
if ( $wgUrlShortenerReadOnly ) {
- $this->dieUsage( 'No new short urls may be created',
'urlshortener-disabled' );
+ if ( is_callable( [ $this, 'dieWithError' ] ) ) {
+ $this->dieWithError(
'apierror-urlshortener-disabled' );
+ } else {
+ $this->dieUsage( 'No new short urls may be
created', 'urlshortener-disabled' );
+ }
}
$params = $this->extractRequestParams();
diff --git a/i18n/en.json b/i18n/en.json
index d519683..e2e8f78 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -24,5 +24,6 @@
"urlshortener-disabled": "Creating new short URLs is temporarily
disabled.",
"apihelp-shortenurl-description": "Shorten a long URL into a shorter
one.",
"apihelp-shortenurl-param-url": "URL to be shortened.",
- "apihelp-shortenurl-example-1": "Get the short URL for
<kbd><nowiki>https://en.wikipedia.org/wiki/Arctica</nowiki></kbd>."
+ "apihelp-shortenurl-example-1": "Get the short URL for
<kbd><nowiki>https://en.wikipedia.org/wiki/Arctica</nowiki></kbd>.",
+ "apierror-urlshortener-disabled": "No new short urls may be created"
}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 4ff39e4..866ad74 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -25,5 +25,6 @@
"urlshortener-disabled": "Error message shown when the extension is
configured in read-only mode.",
"apihelp-shortenurl-description":
"{{doc-apihelp-description|shortenurl}}",
"apihelp-shortenurl-param-url": "{{doc-apihelp-param|shortenurl|url}}",
- "apihelp-shortenurl-example-1": "{{doc-apihelp-example|shortenurl}}"
+ "apihelp-shortenurl-example-1": "{{doc-apihelp-example|shortenurl}}",
+ "apierror-urlshortener-disabled": "{{doc-apierror}}"
}
--
To view, visit https://gerrit.wikimedia.org/r/321461
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I981d9ce115a194623a0e82a1ea4d7a3959b5cb24
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UrlShortener
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits