From f0b4cb608ae582d38e7d9504dc76fed9c92f3dc7 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 3 Jun 2015 21:00:23 +0100 Subject: [PATCH] Return locale specific node help --- red/api/nodes.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/red/api/nodes.js b/red/api/nodes.js index a71bc4413..03a95a6ec 100644 --- a/red/api/nodes.js +++ b/red/api/nodes.js @@ -17,6 +17,7 @@ var redNodes = require("../nodes"); var comms = require("../comms"); var server = require("../server"); var log = require("../log"); +var i18n = require("../i18n"); var settings = require("../settings"); @@ -26,8 +27,9 @@ module.exports = { log.audit({event: "nodes.list.get"},req); res.json(redNodes.getNodeList()); } else { + var lang = i18n.determineLangFromHeaders(req.acceptedLanguages); log.audit({event: "nodes.configs.get"},req); - res.send(redNodes.getNodeConfigs()); + res.send(redNodes.getNodeConfigs(lang)); } }, @@ -121,7 +123,8 @@ module.exports = { res.send(404); } } else { - result = redNodes.getNodeConfig(id); + var lang = i18n.determineLangFromHeaders(req.acceptedLanguages); + result = redNodes.getNodeConfig(id,lang); if (result) { log.audit({event: "nodes.config.get",id:id},req); res.send(result);