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

Fix loading individual module catalog

This commit is contained in:
Nick O'Leary 2021-01-06 20:20:32 +00:00
parent 8a87f93741
commit 0284ef401e
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -406,10 +406,12 @@ var api = module.exports = {
var lang = opts.lang;
var prevLang = runtime.i18n.i.language;
// Trigger a load from disk of the language if it is not the default
return runtime.i18n.i.changeLanguage(lang, function(){
var catalog = runtime.i18n.i.getResourceBundle(lang, namespace);
runtime.i18n.i.changeLanguage(prevLang);
return catalog||{};
return new Promise(resolve => {
runtime.i18n.i.changeLanguage(lang, function() {
var catalog = runtime.i18n.i.getResourceBundle(lang, namespace);
runtime.i18n.i.changeLanguage(prevLang);
resolve(catalog||{});
});
});
},