mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Don't try to use the template engine's gettext on Javascript variables, as it won't work as the templates are evaluated before any JS is executed.
This commit is contained in:
parent
4f8b018b39
commit
37699a9820
@ -211,8 +211,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
msg = S('{{ _(' + err.errormsg + ')}}').value();
|
||||
alertify.error("{{ _('" + err.errormsg + "') }}");
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
@ -151,13 +151,18 @@ function($, _, S, pgAdmin, pgBrowser, Alertify) {
|
||||
t.unload(i);
|
||||
t.setInode(i);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
Alertify.error(res.errormsg);
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
msg = S('{{ _(' + err.errormsg + ')}}').value();
|
||||
Alertify.error("{{ _('" + err.errormsg + "') }}");
|
||||
Alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
|
@ -87,7 +87,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
type:'DELETE',
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
alertify.success("{{ _('" + res.info + "') }}");
|
||||
alertify.success(res.info);
|
||||
d = t.itemData(i);
|
||||
t.removeIcon(i);
|
||||
d.connected = false;
|
||||
@ -99,13 +99,18 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
}
|
||||
obj.trigger('server-disconnected', obj, i, d);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
alertify.error(res.errormsg);
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
msg = S('{{ _(' + err.errormsg + ')}}').value();
|
||||
alertify.error("{{ _('" + err.errormsg + "') }}");
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
|
Loading…
Reference in New Issue
Block a user