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

Fix i18n api changes in runtime/nodes

This commit is contained in:
Nick O'Leary 2018-09-18 10:31:44 +01:00
parent 2aae76c9bc
commit d34ebd4d1b
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

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