mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
added defaultLang support, #4655
This commit is contained in:
@@ -238,6 +238,16 @@ module.exports = function(Plugins) {
|
||||
_.extendOwn(Plugins.customLanguages[route], data);
|
||||
|
||||
if (pluginData.defaultLang && pathToLang.endsWith(pluginData.defaultLang + '/' + path.basename(pathToLang))) {
|
||||
console.log(Plugins.languageCodes);
|
||||
Plugins.languageCodes.map(function(code) {
|
||||
if (pluginData.defaultLang !== code) {
|
||||
return code + '/' + path.basename(pathToLang);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}).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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user