diff --git a/red/api/locales.js b/red/api/locales.js index ece50f25a..eb28094b1 100644 --- a/red/api/locales.js +++ b/red/api/locales.js @@ -16,30 +16,12 @@ var fs = require('fs'); var path = require('path'); var i18n; -var supportedLangs = []; - -var apiLocalDir = path.resolve(path.join(__dirname,"locales")); - -var initSupportedLangs = function() { - fs.readdir(apiLocalDir, function(err,files) { - if(!err) { - supportedLangs = files; - } - }); -} function determineLangFromHeaders(acceptedLanguages){ var lang = i18n.defaultLang; acceptedLanguages = acceptedLanguages || []; - for (var i=0;i= 1) { + lang = acceptedLanguages[0]; } return lang; } @@ -47,7 +29,6 @@ function determineLangFromHeaders(acceptedLanguages){ module.exports = { init: function(runtime) { i18n = runtime.i18n; - initSupportedLangs(); }, get: function(req,res) { var namespace = req.params[0];