Gerrit Patch Uploader has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/284220

Change subject: Special:Upload: Use user interface language for error message
......................................................................

Special:Upload: Use user interface language for error message

This change also changes the error messages on exceptions in API calls from
English to the content language when no uselang parameter is present.

Bug: T133059
Change-Id: I75b3c9537a8805367d36a4e51453a9f9219c9555
---
M includes/title/MalformedTitleException.php
M resources/src/mediawiki.special/mediawiki.special.upload.js
2 files changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/20/284220/1

diff --git a/includes/title/MalformedTitleException.php 
b/includes/title/MalformedTitleException.php
index 799961a..59b010c 100644
--- a/includes/title/MalformedTitleException.php
+++ b/includes/title/MalformedTitleException.php
@@ -44,9 +44,9 @@
                $this->errorMessageParameters = $errorMessageParameters;
 
                // Supply something useful for Exception::getMessage() to 
return.
-               $enMsg = wfMessage( $errorMessage, $errorMessageParameters );
-               $enMsg->inLanguage( 'en' )->useDatabase( false );
-               parent::__construct( $enMsg->text() );
+               $Msg = wfMessage( $errorMessage, $errorMessageParameters );
+               $Msg->useDatabase( false );
+               parent::__construct( $Msg->text() );
        }
 
        /**
diff --git a/resources/src/mediawiki.special/mediawiki.special.upload.js 
b/resources/src/mediawiki.special/mediawiki.special.upload.js
index 49af809..4369e5d 100644
--- a/resources/src/mediawiki.special/mediawiki.special.upload.js
+++ b/resources/src/mediawiki.special/mediawiki.special.upload.js
@@ -70,7 +70,8 @@
                                // 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',
+                               uselang: mw.config.get( 'wgUserLanguage' )
                        } ).done( function ( result ) {
                                var
                                        resultOut = '',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I75b3c9537a8805367d36a4e51453a9f9219c9555
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <gerritpatchuploa...@gmail.com>

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

Reply via email to