mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 01:25:52 -05:00
Merge pull request #2969 from benjiwheeler/make-translations
fix "make translations" command
This commit is contained in:
commit
b2d5bbcb93
1 changed files with 9 additions and 4 deletions
|
@ -106,7 +106,9 @@ for ( var l in languages ) {
|
||||||
l + '.json'
|
l + '.json'
|
||||||
);
|
);
|
||||||
fs.accessSync(langTranslations);
|
fs.accessSync(langTranslations);
|
||||||
|
if (l !== 'en') {
|
||||||
generalLocales[l] = JSON.parse(fs.readFileSync(langTranslations, 'utf8'));
|
generalLocales[l] = JSON.parse(fs.readFileSync(langTranslations, 'utf8'));
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// just use english
|
// just use english
|
||||||
generalLocales[l] = generalLocales['en'];
|
generalLocales[l] = generalLocales['en'];
|
||||||
|
@ -228,8 +230,11 @@ async.forEachLimit(views, 5, function (view, cb) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
// don't overwrite english view strings
|
||||||
|
if (isoCode !== 'en') {
|
||||||
viewLocales[isoCode] = merge({}, generalLocales[isoCode], JSON.parse(data));
|
viewLocales[isoCode] = merge({}, generalLocales[isoCode], JSON.parse(data));
|
||||||
defaults(viewLocales[isoCode], viewLocales['en']);
|
defaults(viewLocales[isoCode], viewLocales['en']);
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return cb(e);
|
return cb(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue