Show current locale in error message in localize-ftl. Fix #4302

This commit is contained in:
Tom Najdek 2024-07-01 11:08:41 +02:00
parent 4866c467dc
commit 76caebdd8a
No known key found for this signature in database
GPG key ID: EEC61A7B4C667D77

View file

@ -75,11 +75,17 @@ async function getFTL() {
} }
} }
const ftl = JSONToFtl(Object.fromEntries(translated), baseFTL); try {
const outFtlPath = join(getLocaleDir(locale), sourceFileBaseName + '.ftl'); const ftl = JSONToFtl(Object.fromEntries(translated), baseFTL);
await fs.outputFile(outFtlPath, ftl); const outFtlPath = join(getLocaleDir(locale), sourceFileBaseName + '.ftl');
onProgress(`${locale}/${sourceFileBaseName}.ftl`, null, 'localize'); await fs.outputFile(outFtlPath, ftl);
count++; onProgress(`${locale}/${sourceFileBaseName}.ftl`, null, 'localize');
count++;
}
catch (e) {
e.message = `Failed to localize "${locale}": ${e.message}`;
throw e;
}
} }
} }