This commit is contained in:
Julian Lam
2016-09-02 09:39:13 -04:00
parent 416186a2b6
commit bb80dc360e
2 changed files with 4 additions and 6 deletions

View File

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

View File

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