Format all messages.json files in preparation for larger changes
This commit is contained in:
parent
db155b9752
commit
0ba23d4b62
77 changed files with 429741 additions and 574491 deletions
|
@ -49,14 +49,12 @@ const en: LocaleMessagesType = readJsonSync(
|
|||
const locales = readdirSync(join(BASE_DIR, ''));
|
||||
|
||||
console.log();
|
||||
console.log('Re-adding placeholders to non-en locales');
|
||||
console.log('Deleting placeholders for all locales');
|
||||
locales.forEach((locale: string) => {
|
||||
if (locale === 'en') {
|
||||
return;
|
||||
}
|
||||
const target = resolve(join(BASE_DIR, locale, 'messages.json'));
|
||||
if (!existsSync(target)) {
|
||||
throw new Error(`File not found for ${locale}: ${target}`);
|
||||
console.warn(`File not found for ${locale}: ${target}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const messages: LocaleMessagesType = readJsonSync(target);
|
||||
|
@ -65,13 +63,17 @@ locales.forEach((locale: string) => {
|
|||
return;
|
||||
}
|
||||
|
||||
messages[key].placeholders = en[key].placeholders;
|
||||
delete messages[key].placeholders;
|
||||
});
|
||||
|
||||
console.log(`Writing ${target}`);
|
||||
writeFileSync(target, `${JSON.stringify(messages, null, 4)}\n`);
|
||||
});
|
||||
|
||||
execSync('yarn format', {
|
||||
stdio: [null, process.stdout, process.stderr],
|
||||
});
|
||||
|
||||
if (failed) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue