v1.18.x
Julian Lam 9 years ago
parent 416186a2b6
commit bb80dc360e

@ -313,8 +313,10 @@
callback(data); callback(data);
}; };
if (err) { if (err && err.code === 'ENOENT') {
winston.error('[translator] Could not load `' + filename + '`: ' + err.message + '. Skipping...'); data = {};
} else if (err) {
winston.error('[translator] Error while loading language file: ' + err.message);
return callback({}); return callback({});
} }

@ -253,7 +253,6 @@ module.exports = function(Plugins) {
}).filter(Boolean).forEach(function(key) { }).filter(Boolean).forEach(function(key) {
Plugins.customLanguages[key] = _.defaults(Plugins.customLanguages[key] || {}, data); Plugins.customLanguages[key] = _.defaults(Plugins.customLanguages[key] || {}, data);
}); });
fallbackMap[path.basename(pathToLang, '.json')] = path.join(pathToFolder, pluginData.defaultLang, path.basename(pathToLang));
} }
next(); next();
@ -263,9 +262,6 @@ module.exports = function(Plugins) {
return callback(err); return callback(err);
} }
// do I need this either?
_.extendOwn(Plugins.customLanguageFallbacks, fallbackMap);
callback(); callback();
}); });
}); });

Loading…
Cancel
Save