Merge pull request #2969 from benjiwheeler/make-translations

fix "make translations" command
This commit is contained in:
Benjamin Wheeler 2019-05-13 17:08:23 -04:00 committed by GitHub
commit b2d5bbcb93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,7 +106,9 @@ for ( var l in languages ) {
l + '.json'
);
fs.accessSync(langTranslations);
if (l !== 'en') {
generalLocales[l] = JSON.parse(fs.readFileSync(langTranslations, 'utf8'));
}
} catch (err) {
// just use english
generalLocales[l] = generalLocales['en'];
@ -228,8 +230,11 @@ async.forEachLimit(views, 5, function (view, cb) {
}
}
try {
// don't overwrite english view strings
if (isoCode !== 'en') {
viewLocales[isoCode] = merge({}, generalLocales[isoCode], JSON.parse(data));
defaults(viewLocales[isoCode], viewLocales['en']);
}
} catch (e) {
return cb(e);
}