mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Move module message catalogs under runtime api
This commit is contained in:
@@ -83,7 +83,6 @@ module.exports = {
|
||||
// Locales
|
||||
var locales = require("./locales");
|
||||
locales.init(runtimeAPI);
|
||||
editorApp.get('/locales/nodes',locales.getAllNodes,apiUtil.errorHandler);
|
||||
editorApp.get(/locales\/(.+)\/?$/,locales.get,apiUtil.errorHandler);
|
||||
|
||||
// Library
|
||||
|
@@ -38,20 +38,5 @@ module.exports = {
|
||||
});
|
||||
i18n.i.setLng(prevLang);
|
||||
|
||||
},
|
||||
getAllNodes: function(req,res) {
|
||||
var lngs = req.query.lng;
|
||||
var opts = {
|
||||
user: req.user
|
||||
}
|
||||
runtimeAPI.nodes.getNodeList(opts).then(function(nodeList) {
|
||||
var result = {};
|
||||
nodeList.forEach(function(n) {
|
||||
if (n.module !== "node-red") {
|
||||
result[n.id] = i18n.catalog(n.id,lngs)||{};
|
||||
}
|
||||
});
|
||||
res.json(result);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user