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

Fixed acceptedLanguage typo

This commit is contained in:
Allen Boone 2015-06-05 16:18:01 -04:00 committed by Nick O'Leary
parent 409fa49234
commit a6974371b0
2 changed files with 2 additions and 2 deletions

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 = i18n.determineLangFromHeaders(req.acceptedLanguages); var lang = i18n.determineLangFromHeaders(req.acceptedLanguages || []);
var prevLang = i18n.i.lng(); var prevLang = i18n.i.lng();
i18n.i.setLng(lang, function(){ i18n.i.setLng(lang, function(){
var catalog = i18n.catalog(namespace,lang); var catalog = i18n.catalog(namespace,lang);

View File

@ -125,7 +125,7 @@ function determineLangFromHeaders(acceptedLanguages){
lang = acceptedLanguages[i]; lang = acceptedLanguages[i];
break; break;
// check the language without the country code // check the language without the country code
} else if (supportedLangs.indexOf(acceptedLangs[i].split("-")[0]) !== -1) { } else if (supportedLangs.indexOf(acceptedLanguages[i].split("-")[0]) !== -1) {
lang = acceptedLanguages[i].split("-")[0]; lang = acceptedLanguages[i].split("-")[0];
break; break;
} }