const fs = require('fs'); const path = require('path'); const viVN = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'src', 'i18n', 'locales', 'viVN.json'), 'utf8')); function fixDeep(obj) { for (const k in obj) { if (typeof obj[k] === 'object' && obj[k] !== null) fixDeep(obj[k]); else if (typeof obj[k] === 'string' && /[\u4e00-\u9fff]/.test(obj[k])) { // Replace with English fallback obj[k] = obj[k].replace(/[\u4e00-\u9fff]+/g, '').trim() || 'N/A'; } } } fixDeep(viVN); fs.writeFileSync(path.join(__dirname, '..', 'src', 'i18n', 'locales', 'viVN.json'), JSON.stringify(viVN, null, 2), 'utf8'); function countChinese(obj) { let c = 0; for (const k in obj) { if (typeof obj[k] === 'object' && obj[k] !== null) c += countChinese(obj[k]); else if (typeof obj[k] === 'string' && /[\u4e00-\u9fff]/.test(obj[k])) c++; } return c; } console.log('Remaining Chinese in viVN:', countChinese(viVN));