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

Merge pull request #3225 from node-red/i18n-fix

Fix loading non-default language files leaving runtime in wrong locale
This commit is contained in:
Nick O'Leary 2021-10-25 16:06:12 +01:00 committed by GitHub
commit fb153757b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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(){
var catalog = loadResource(lang, namespace);
res.json(catalog||{});
i18n.i.changeLanguage(prevLang, function() {
var catalog = loadResource(lang, namespace);
res.json(catalog||{});
});
});
i18n.i.changeLanguage(prevLang);
}
}