Show current locale in error message in localize-ftl. Fix #4302
This commit is contained in:
parent
4866c467dc
commit
76caebdd8a
1 changed files with 11 additions and 5 deletions
|
@ -75,11 +75,17 @@ async function getFTL() {
|
|||
}
|
||||
}
|
||||
|
||||
const ftl = JSONToFtl(Object.fromEntries(translated), baseFTL);
|
||||
const outFtlPath = join(getLocaleDir(locale), sourceFileBaseName + '.ftl');
|
||||
await fs.outputFile(outFtlPath, ftl);
|
||||
onProgress(`${locale}/${sourceFileBaseName}.ftl`, null, 'localize');
|
||||
count++;
|
||||
try {
|
||||
const ftl = JSONToFtl(Object.fromEntries(translated), baseFTL);
|
||||
const outFtlPath = join(getLocaleDir(locale), sourceFileBaseName + '.ftl');
|
||||
await fs.outputFile(outFtlPath, ftl);
|
||||
onProgress(`${locale}/${sourceFileBaseName}.ftl`, null, 'localize');
|
||||
count++;
|
||||
}
|
||||
catch (e) {
|
||||
e.message = `Failed to localize "${locale}": ${e.message}`;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue