1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Use locale setting when installing/enabling node

Fixes #3194
This commit is contained in:
Nick O'Leary 2021-10-14 10:57:11 +01:00
parent f030694ef4
commit e1d492813e
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -477,8 +477,17 @@ var RED = (function() {
RED.nodes.addNodeSet(m); RED.nodes.addNodeSet(m);
addedTypes = addedTypes.concat(m.types); addedTypes = addedTypes.concat(m.types);
RED.i18n.loadNodeCatalog(id, function() { RED.i18n.loadNodeCatalog(id, function() {
$.get('nodes/'+id, function(data) { var lang = localStorage.getItem("editor-language")||RED.i18n.detectLanguage();
appendNodeConfig(data); $.ajax({
headers: {
"Accept":"text/html",
"Accept-Language": lang
},
cache: false,
url: 'nodes/'+id,
success: function(data) {
appendNodeConfig(data);
}
}); });
}); });
}); });
@ -505,10 +514,19 @@ var RED = (function() {
typeList = "<ul><li>"+msg.types.map(RED.utils.sanitize).join("</li><li>")+"</li></ul>"; typeList = "<ul><li>"+msg.types.map(RED.utils.sanitize).join("</li><li>")+"</li></ul>";
RED.notify(RED._("palette.event.nodeEnabled", {count:msg.types.length})+typeList,"success"); RED.notify(RED._("palette.event.nodeEnabled", {count:msg.types.length})+typeList,"success");
} else { } else {
$.get('nodes/'+msg.id, function(data) { var lang = localStorage.getItem("editor-language")||RED.i18n.detectLanguage();
appendNodeConfig(data); $.ajax({
typeList = "<ul><li>"+msg.types.map(RED.utils.sanitize).join("</li><li>")+"</li></ul>"; headers: {
RED.notify(RED._("palette.event.nodeAdded", {count:msg.types.length})+typeList,"success"); "Accept":"text/html",
"Accept-Language": lang
},
cache: false,
url: 'nodes/'+msg.id,
success: function(data) {
appendNodeConfig(data);
typeList = "<ul><li>"+msg.types.map(RED.utils.sanitize).join("</li><li>")+"</li></ul>";
RED.notify(RED._("palette.event.nodeAdded", {count:msg.types.length})+typeList,"success");
}
}); });
} }
} }