diff --git a/extension.json b/extension.json index 9f92ff7366..8c7eb9bb81 100644 --- a/extension.json +++ b/extension.json @@ -272,6 +272,10 @@ "ext.visualEditor.track", "mediawiki.api" ], + "messages": [ + "visualeditor-loaderror-title", + "visualeditor-loaderror-message" + ], "targets": [ "desktop", "mobile" diff --git a/modules/ve-mw/i18n/en.json b/modules/ve-mw/i18n/en.json index 30ad5ae6be..b0a4271aaa 100644 --- a/modules/ve-mw/i18n/en.json +++ b/modules/ve-mw/i18n/en.json @@ -245,6 +245,8 @@ "visualeditor-linkinspector-illegal-title": "Invalid page title", "visualeditor-linknodeinspector-add-label": "Add label", "visualeditor-linknodeinspector-title": "Simple link", + "visualeditor-loaderror-message": "Error loading data from server: $1.", + "visualeditor-loaderror-title": "The editor could not load", "visualeditor-loadwarning": "Error loading data from server: $1. Would you like to retry?", "visualeditor-loadwarning-token": "Error loading edit token from server: $1. Would you like to retry?", "visualeditor-mainnamespacepagelink": "Project:Main namespace", diff --git a/modules/ve-mw/i18n/qqq.json b/modules/ve-mw/i18n/qqq.json index b3a5a51904..fdea5443dc 100644 --- a/modules/ve-mw/i18n/qqq.json +++ b/modules/ve-mw/i18n/qqq.json @@ -254,6 +254,8 @@ "visualeditor-linkinspector-illegal-title": "Warning that the entered text is not a valid page title.", "visualeditor-linknodeinspector-add-label": "Label of button that converts an auto-numbered, external, labelless link into a labeled external link", "visualeditor-linknodeinspector-title": "Title of inspector for editing auto-numbered, external, labelless links.\n\nSee also:\n* {{msg-mw|Visualeditor-annotationbutton-linknode-tooltip}}", + "visualeditor-loaderror-message": "Text shown in a message box when the editor fails to load properly due to a RESTBase call failing.\n\nParameters:\n* $1 - an error message", + "visualeditor-loaderror-title": "Text shown as the title of a message box when the editor fails to load properly for some reason.", "visualeditor-loadwarning": "Text (JavaScript confirm()) shown when the editor fails to load properly.\n\nParameters:\n* $1 - the error message from the server, in English. e.g. \"parsoidserver-http-err\"", "visualeditor-loadwarning-token": "Text (JavaScript confirm()) shown when the editor fails to load properly.\n\nParameters:\n* $1 - the error message from the server.", "visualeditor-mainnamespacepagelink": "Name of a page describing the main namespace (NS0) in this project.\n{{doc-important|Do not translate \"Project\"; it is automatically converted to the wiki's project namespace.}}", diff --git a/modules/ve-mw/init/ve.init.mw.TargetLoader.js b/modules/ve-mw/init/ve.init.mw.TargetLoader.js index 54e084c7d8..10149d0aee 100644 --- a/modules/ve-mw/init/ve.init.mw.TargetLoader.js +++ b/modules/ve-mw/init/ve.init.mw.TargetLoader.js @@ -144,7 +144,9 @@ // Page does not exist, so let the user start with a blank document. return $.Deferred().resolve( '' ).promise(); } else { - mw.log.warn( 'One of the load requests failed (unhandled).' ); + window.alert( mw.msg( 'visualeditor-loaderror-message', 'HTTP ' + response.status ) ); + + mw.log.warn( 'RESTBase load failed: ' + response.statusText ); } } );