Plugin `defaultLang` defaults to `en-GB`

v1.18.x
Peter Jaszkowiak 8 years ago
parent 7c88a55153
commit df77890c2a

@ -143,12 +143,13 @@ function getTranslationTree(callback) {
// 4. old plugin defaultLang (en_US) // 4. old plugin defaultLang (en_US)
async.eachLimit(plugins, 10, function (pluginData, call) { async.eachLimit(plugins, 10, function (pluginData, call) {
var pluginLanguages = path.join(__dirname, '../../node_modules/', pluginData.id, pluginData.languages); var pluginLanguages = path.join(__dirname, '../../node_modules/', pluginData.id, pluginData.languages);
var defaultLang = pluginData.defaultLang || 'en-GB';
async.some([ async.some([
lang, lang,
lang.replace('-', '_').replace('-x-', '@'), lang.replace('-', '_').replace('-x-', '@'),
pluginData.defaultLang.replace('_', '-').replace('@', '-x-'), defaultLang.replace('_', '-').replace('@', '-x-'),
pluginData.defaultLang.replace('-', '_').replace('-x-', '@'), defaultLang.replace('-', '_').replace('-x-', '@'),
], function (language, next) { ], function (language, next) {
fs.readFile(path.join(pluginLanguages, language, ns + '.json'), function (err, buffer) { fs.readFile(path.join(pluginLanguages, language, ns + '.json'), function (err, buffer) {
if (err) { if (err) {

Loading…
Cancel
Save