From bc151d5ef8ed6b356e6e33dbd89e081a815e42aa Mon Sep 17 00:00:00 2001 From: Cori Hudson Date: Tue, 20 Sep 2022 16:56:10 -0400 Subject: [PATCH] fix: fix some errors with validation and error output --- scripts/tx-pull-editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tx-pull-editor.js b/scripts/tx-pull-editor.js index 77c1d014..3cb0c528 100644 --- a/scripts/tx-pull-editor.js +++ b/scripts/tx-pull-editor.js @@ -54,6 +54,7 @@ const pullTranslations = async function () { const values = await batchMap(Object.keys(locales), CONCURRENCY_LIMIT, getLocaleData); const source = values.find(elt => elt.locale === 'en').translations; values.forEach(function (translation) { + validateTranslations({locale: translation.locale, translations: translation.translations}, source); // if translation has message & description, we only want the message let txs = {}; for (const key of Object.keys(translation.translations)) { @@ -64,7 +65,6 @@ const pullTranslations = async function () { txs[key] = tx; } } - validateTranslations({locale: translation.locale, translations: txs}, source); const file = JSON.stringify(txs, null, 4); fs.writeFileSync( `${OUTPUT_DIR}/${translation.locale}.json`, @@ -72,7 +72,7 @@ const pullTranslations = async function () { ); }); } catch (err) { - process.stdout.write(err); + process.stdout.write(err.message); process.exit(1); } };