(en)
| 19 | const SOURCE = 'en.json'; |
| 20 | |
| 21 | function buildEnSchema(en) { |
| 22 | // Returns Map<section, Set<key>> reflecting en.json's structure. |
| 23 | const schema = new Map(); |
| 24 | for (const sectionName of Object.keys(en)) { |
| 25 | const section = en[sectionName]; |
| 26 | if (typeof section !== 'object' || section === null) continue; |
| 27 | schema.set(sectionName, new Set(Object.keys(section))); |
| 28 | } |
| 29 | return schema; |
| 30 | } |
| 31 | |
| 32 | function cleanLocale(filePath, enSchema) { |
| 33 | const data = JSON.parse(fs.readFileSync(filePath, 'utf8')); |