if ( error.message ) {
return this.upload.getApi()
.then( function ( api ) {
- return api.loadMessagesIfMissing( [ error.message.key ] ).then( function () {
- if ( !mw.message( error.message.key ).exists() ) {
- return $.Deferred().reject();
- }
- return new OO.ui.Error(
- $( '<p>' ).msg( error.message.key, error.message.params || [] ),
- { recoverable: false }
- );
- } );
+ // 'amenableparser' will expand templates and parser functions server-side.
+ // We still do the rest of wikitext parsing here (throught jqueryMsg).
+ return api.loadMessagesIfMissing( [ error.message.key ], { amenableparser: true } )
+ .then( function () {
+ if ( !mw.message( error.message.key ).exists() ) {
+ return $.Deferred().reject();
+ }
+ return new OO.ui.Error(
+ $( '<p>' ).msg( error.message.key, error.message.params || [] ),
+ { recoverable: false }
+ );
+ } );
} )
.then( null, function () {
// We failed when loading the error message, or it doesn't actually exist, fall back