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

Pick up desired language from query string

This commit is contained in:
Nick O'Leary 2015-05-26 14:34:56 +01:00
parent 9058bf615c
commit f5fc8f763f

View File

@ -19,7 +19,7 @@ module.exports = {
get: function(req,res) { get: function(req,res) {
var namespace = req.params[0]; var namespace = req.params[0];
namespace = namespace.replace(/\.json$/,""); namespace = namespace.replace(/\.json$/,"");
var lang = "en-US"; // TODO: determine requested lang var lang = req.query["lang"]||"en-US"; // TODO: determine requested lang
var catalog = i18n.catalog(namespace,lang); var catalog = i18n.catalog(namespace,lang);
res.json(catalog||{}); res.json(catalog||{});
} }