diff --git a/extension.json b/extension.json index 9ac2f1c054..70040bb6d7 100644 --- a/extension.json +++ b/extension.json @@ -775,6 +775,8 @@ "visualeditor-pagetranslationwarning", "visualeditor-recreate", "visualeditor-redirect-description", + "visualeditor-loaderror-revidconflict", + "visualeditor-loaderror-wrongmode", "visualeditor-saveerror", "visualeditor-serializeerror" ], diff --git a/i18n/ve-mw/en.json b/i18n/ve-mw/en.json index 2d11b947a5..18a30879cf 100644 --- a/i18n/ve-mw/en.json +++ b/i18n/ve-mw/en.json @@ -389,6 +389,8 @@ "visualeditor-section-body-placeholder": "New section", "visualeditor-section-title-placeholder": "Subject", "visualeditor-serializeerror": "Error loading data from server: $1.", + "visualeditor-loaderror-revidconflict": "Revision IDs returned by the server do not match (document: $1, metadata: $2).", + "visualeditor-loaderror-wrongmode": "Tried to load the editor in wrong mode (data type: \"$1\", editor mode: \"$2\").", "visualeditor-settings-tool": "Page settings", "visualeditor-special-characters-group-other": "Often used", "visualeditor-template-tools-definition.json": "null", diff --git a/i18n/ve-mw/qqq.json b/i18n/ve-mw/qqq.json index 80f70b858d..c03a664f70 100644 --- a/i18n/ve-mw/qqq.json +++ b/i18n/ve-mw/qqq.json @@ -407,6 +407,8 @@ "visualeditor-section-body-placeholder": "Placeholder for surface when adding a new section", "visualeditor-section-title-placeholder": "Placeholder for title input when adding a new section\n{{Identical|Subject}}", "visualeditor-serializeerror": "Text shown when the editor fails to load the wikitext for saving.\n\nParameters:\n* $1 is an error message, in English.", + "visualeditor-loaderror-revidconflict": "Error message shown when loading the editor.\n\nParameters:\n* $1 and $2: revision IDs, as numbers", + "visualeditor-loaderror-wrongmode": "Error message shown when loading the editor.\n\nParameters:\n* $1 and $2: names for editing modes (not translateable)", "visualeditor-settings-tool": "Text of tool in the toolbar the lets users set specific page settings.\n{{Identical|Page settings}}", "visualeditor-special-characters-group-other": "Label of the special character group shown if the wiki has visualeditor-quick-access-characters.json set up.", "visualeditor-template-tools-definition.json": "{{ignored}}\n\nJSON object mapping context items to templates. See ve.ui.MWDefinedTransclusionContextItem.js.", diff --git a/modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js index 3c7709ed54..24be8e6800 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js @@ -348,12 +348,13 @@ ve.init.mw.ArticleTarget.prototype.loadSuccess = function ( response ) { if ( !data || typeof data.content !== 'string' ) { this.loadFail( 've-api', { errors: [ { code: 've-api', - html: 'No HTML content in response from server' + html: mw.message( 'api-clientside-error-invalidresponse' ).parse() } ] } ); } else if ( response.veMode && response.veMode !== this.getDefaultMode() ) { this.loadFail( 've-mode', { errors: [ { code: 've-mode', - html: 'Tried to load "' + response.veMode + '" data into "' + this.getDefaultMode() + '" editor' + html: mw.message( 'visualeditor-loaderror-wrongmode', + response.veMode, this.getDefaultMode() ).parse() } ] } ); } else { this.track( 'trace.parseResponse.enter' ); @@ -403,7 +404,7 @@ ve.init.mw.ArticleTarget.prototype.parseMetadata = function ( response ) { if ( !data ) { this.loadFail( 've-api', { errors: [ { code: 've-api', - html: 'No metadata content in response from server' + html: mw.message( 'api-clientside-error-invalidresponse' ).parse() } ] } ); return false; } @@ -434,7 +435,8 @@ ve.init.mw.ArticleTarget.prototype.parseMetadata = function ( response ) { // Retried already, just error the second time. this.loadFail( 've-api', { errors: [ { code: 've-api', - html: 'Revision IDs (doc=' + docRevId + ',api=' + this.revid + ') returned by server do not match' + html: mw.message( 'visualeditor-loaderror-revidconflict', + String( docRevId ), String( this.revid ) ).parse() } ] } ); } else { this.retriedRevIdConflict = true;