mirror of
https://github.com/scratchfoundation/scratch-l10n.git
synced 2024-12-22 05:32:34 -05:00
fix: fix some errors with validation and error output
This commit is contained in:
parent
2a3edf29f5
commit
bc151d5ef8
1 changed files with 2 additions and 2 deletions
|
@ -54,6 +54,7 @@ const pullTranslations = async function () {
|
||||||
const values = await batchMap(Object.keys(locales), CONCURRENCY_LIMIT, getLocaleData);
|
const values = await batchMap(Object.keys(locales), CONCURRENCY_LIMIT, getLocaleData);
|
||||||
const source = values.find(elt => elt.locale === 'en').translations;
|
const source = values.find(elt => elt.locale === 'en').translations;
|
||||||
values.forEach(function (translation) {
|
values.forEach(function (translation) {
|
||||||
|
validateTranslations({locale: translation.locale, translations: translation.translations}, source);
|
||||||
// if translation has message & description, we only want the message
|
// if translation has message & description, we only want the message
|
||||||
let txs = {};
|
let txs = {};
|
||||||
for (const key of Object.keys(translation.translations)) {
|
for (const key of Object.keys(translation.translations)) {
|
||||||
|
@ -64,7 +65,6 @@ const pullTranslations = async function () {
|
||||||
txs[key] = tx;
|
txs[key] = tx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
validateTranslations({locale: translation.locale, translations: txs}, source);
|
|
||||||
const file = JSON.stringify(txs, null, 4);
|
const file = JSON.stringify(txs, null, 4);
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
`${OUTPUT_DIR}/${translation.locale}.json`,
|
`${OUTPUT_DIR}/${translation.locale}.json`,
|
||||||
|
@ -72,7 +72,7 @@ const pullTranslations = async function () {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
process.stdout.write(err);
|
process.stdout.write(err.message);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue