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:
parent
409fa49234
commit
a6974371b0
@ -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);
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user