From: Fomafix Date: Tue, 19 Apr 2016 16:32:50 +0000 (+0000) Subject: Special:Upload: Use user interface language for error message X-Git-Tag: 1.31.0-rc.0~862 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=e5b32029d0393d5044b40792985429eec8a37f76 Special:Upload: Use user interface language for error message This change adds the parameters errorformat=html and errorlang with the user interface language code to the API request. Bug: T133059 Change-Id: I75b3c9537a8805367d36a4e51453a9f9219c9555 --- diff --git a/resources/src/mediawiki.special/mediawiki.special.upload.js b/resources/src/mediawiki.special/mediawiki.special.upload.js index 5934278330..9bf62558dd 100644 --- a/resources/src/mediawiki.special/mediawiki.special.upload.js +++ b/resources/src/mediawiki.special/mediawiki.special.upload.js @@ -73,7 +73,9 @@ // If title is empty, user input is invalid, the API call will produce details about why titles: title ? title.getPrefixedText() : this.nameToCheck, prop: 'imageinfo', - iiprop: 'uploadwarning' + iiprop: 'uploadwarning', + errorformat: 'html', + errorlang: mw.config.get( 'wgUserLanguage' ) } ).done( function ( result ) { var resultOut = '', @@ -81,7 +83,7 @@ if ( page.imageinfo ) { resultOut = page.imageinfo[ 0 ].html; } else if ( page.invalidreason ) { - resultOut = mw.html.escape( page.invalidreason ); + resultOut = page.invalidreason.html; } uploadWarning.processResult( resultOut, uploadWarning.nameToCheck ); } ).always( function () {