Spec v1.2, Logosmental-based design direction and tokens, pnpm monorepo (apps/demo, packages/data|features|i18n|db/seed), student + admin screens in 4 locales, simulated ArifPay checkout on the real order state machine, artifact inline/check tools, domain rule checks and UI audit fixes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
14 lines
785 B
JavaScript
14 lines
785 B
JavaScript
// Fails when a locale catalog is missing keys that en.json has (§12). Usage: node tools/i18n-check.mjs
|
||
import fs from 'fs';
|
||
const dir = 'packages/i18n/messages';
|
||
const flat = (o, p = '') => Object.entries(o).flatMap(([k, v]) => (typeof v === 'object' ? flat(v, p + k + '.') : [p + k]));
|
||
const en = new Set(flat(JSON.parse(fs.readFileSync(`${dir}/en.json`, 'utf8'))));
|
||
let bad = 0;
|
||
for (const loc of ['am', 'om', 'ti']) {
|
||
const keys = new Set(flat(JSON.parse(fs.readFileSync(`${dir}/${loc}.json`, 'utf8'))));
|
||
const missing = [...en].filter((k) => !keys.has(k));
|
||
if (missing.length) { bad++; console.error(`${loc}: missing ${missing.length} keys`, missing.slice(0, 20)); }
|
||
}
|
||
console.log(bad ? 'i18n: FAIL' : `i18n: OK (${en.size} keys × 4 locales)`);
|
||
process.exit(bad ? 1 : 0);
|