more logs and stable
MODIFY
test/I18nChecker.ts
test/I18nChecker.ts
@@ -9,9 +9,10 @@ class I18nChecker {
const contentEN = await fs.readFile('./src/assets/i18n/en.json', 'utf8');
const otherLanguages = Constants.SUPPORTED_LANGUAGES.filter((lang) => (lang !== 'en') ? lang : null);
const otherFiles = otherLanguages.map((language) => language + '.json');
+ try {
const parsedContentEN = JSON.parse(contentEN);
-
for (const file of otherFiles) {
+ try {
const contentOtherLanguage = await fs.readFile('./src/assets/i18n/' + file, 'utf8');
const parsedContentOtherLanguage = JSON.parse(contentOtherLanguage);
const added = addedDiff(parsedContentEN, parsedContentOtherLanguage);
@@ -24,6 +25,17 @@ class I18nChecker {
console.log('Deleted in language ' + file);
console.log(deleted);
}
+ if (Object.keys(added).length === 0 && Object.keys(deleted).length === 0) {
+ console.log('No issue found for: ' + file);
+ }
+ } catch (err) {
+ console.log('File not found or with wrong format: ' + file);
+ continue;
+ }
+ }
+ } catch (err) {
+ console.log('English file not found.');
+ throw err;
}
}
}

more logs and stable