"api-error-unknownerror": "Unknown error: \"$1\".",
"api-error-uploaddisabled": "Uploading is disabled on this wiki.",
"api-error-verification-error": "This file might be corrupt, or have the wrong extension.",
+ "api-error-was-deleted": "A file of this name has been previously uploaded and subsequently deleted.",
"duration-seconds": "$1 {{PLURAL:$1|second|seconds}}",
"duration-minutes": "$1 {{PLURAL:$1|minute|minutes}}",
"duration-hours": "$1 {{PLURAL:$1|hour|hours}}",
"api-error-unknownerror": "API error message that can be used for client side localisation of API errors.\n\nParameters:\n* $1 - an unknown error message\n{{Identical|Unknown error}}",
"api-error-uploaddisabled": "API error message that can be used for client side localisation of API errors.",
"api-error-verification-error": "The word \"extension\" refers to the part behind the last dot in a file name, that by convention gives a hint about the kind of data format which a files contents are in.",
+ "api-error-was-deleted": "API error message that can be used for client side localisation of API errors.",
"duration-seconds": "Used as duration. Parameters:\n* $1 - number of seconds\n{{Related|Duration}}\n{{Identical|Second}}",
"duration-minutes": "Used as duration. Parameters:\n* $1 - number of minutes\n{{Related|Duration}}\n{{Identical|Minute}}",
"duration-hours": "Used as duration. Parameters:\n* $1 - number of hours\n{{Related|Duration}}",
'api-error-unknown-error',
'api-error-uploaddisabled',
'api-error-verification-error',
+ 'api-error-was-deleted',
'fileexists',
'filepageexists',
'filename-bad-prefix',
'filename-thumb-name',
'badfilename',
+ 'protectedpagetext',
'api-error-blacklisted', // HACK
],
],
);
}
- message = mw.message( 'api-error-' + error.code );
- if ( !message.exists() ) {
- message = mw.message( 'api-error-unknownerror', JSON.stringify( stateDetails ) );
+ if ( error.code === 'protectedpage' ) {
+ message = mw.message( 'protectedpagetext' );
+ } else {
+ message = mw.message( 'api-error-' + error.code );
+ if ( !message.exists() ) {
+ message = mw.message( 'api-error-unknownerror', JSON.stringify( stateDetails ) );
+ }
}
return new OO.ui.Error(
$( '<p>' ).append( message.parseDom() ),
$( '<p>' ).msg( 'fileexists', 'File:' + warnings.exists ),
{ recoverable: false }
);
+ } else if ( warnings[ 'exists-normalized' ] !== undefined ) {
+ return new OO.ui.Error(
+ $( '<p>' ).msg( 'fileexists', 'File:' + warnings[ 'exists-normalized' ] ),
+ { recoverable: false }
+ );
} else if ( warnings[ 'page-exists' ] !== undefined ) {
return new OO.ui.Error(
$( '<p>' ).msg( 'filepageexists', 'File:' + warnings[ 'page-exists' ] ),
$( '<p>' ).msg( 'api-error-duplicate-archive', 1 ),
{ recoverable: false }
);
+ } else if ( warnings[ 'was-deleted' ] !== undefined ) {
+ return new OO.ui.Error(
+ $( '<p>' ).msg( 'api-error-was-deleted' ),
+ { recoverable: false }
+ );
} else if ( warnings.badfilename !== undefined ) {
// Change the name if the current name isn't acceptable
// TODO This might not really be the best place to do this