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

Fix loading non-default language files leaving runtime in wrong locale

This commit is contained in:
Nick O'Leary 2021-10-25 15:58:07 +01:00
parent 2d4ca7cec0
commit 4f175fc93e
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -48,9 +48,10 @@ module.exports = {
var prevLang = i18n.i.language;
// Trigger a load from disk of the language if it is not the default
i18n.i.changeLanguage(lang, function(){
i18n.i.changeLanguage(prevLang, function() {
var catalog = loadResource(lang, namespace);
res.json(catalog||{});
});
i18n.i.changeLanguage(prevLang);
});
}
}