Translate error message
[MAILPOET-929]
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
function requestFailed(xhr) {
|
function requestFailed(errorMessage, xhr) {
|
||||||
if (xhr.responseJSON) {
|
if (xhr.responseJSON) {
|
||||||
return xhr.responseJSON;
|
return xhr.responseJSON;
|
||||||
}
|
}
|
||||||
var message = "An error has happened while performing a request, the server has responded with response code "
|
var message = errorMessage.replace("%d", xhr.status);
|
||||||
+ xhr.status;
|
|
||||||
return {
|
return {
|
||||||
errors: [
|
errors: [
|
||||||
{
|
{
|
||||||
@@ -75,7 +74,7 @@ define('ajax', ['mailpoet', 'jquery', 'underscore'], function(MailPoet, jQuery,
|
|||||||
'json'
|
'json'
|
||||||
).then(function(data) {
|
).then(function(data) {
|
||||||
return data;
|
return data;
|
||||||
}, requestFailed);
|
}, _.partial(requestFailed, MailPoet.I18n.t('ajaxFailedErrorMessage')));
|
||||||
|
|
||||||
// clear options
|
// clear options
|
||||||
this.options = {};
|
this.options = {};
|
||||||
|
@@ -55,6 +55,9 @@ jQuery('.toplevel_page_mailpoet-newsletters.menu-top-last')
|
|||||||
'mailpoet.js'
|
'mailpoet.js'
|
||||||
)%>
|
)%>
|
||||||
|
|
||||||
|
<%= localize({
|
||||||
|
'ajaxFailedErrorMessage': __('An error has happened while performing a request, the server has responded with response code %d'),
|
||||||
|
}) %>
|
||||||
<% block translations %><% endblock %>
|
<% block translations %><% endblock %>
|
||||||
|
|
||||||
<% block after_translations %><% endblock %>
|
<% block after_translations %><% endblock %>
|
||||||
|
Reference in New Issue
Block a user