Files
his/healthlink-his-ui/scripts/fix_last3.cjs
chenqi 24dc16b8d1 refactor(ybmock): 重构医保模拟接口并更新国际化配置
- 将医保模拟接口从通用路由改为具体功能路由
- 新增签到、取消门诊登记、预结算等功能接口
- 统一返回格式为 code/message/result 结构
- 移除旧版医保接口路由兼容处理
- 更新前端国际化配置文件中的医保相关词条
- 删除重复的无数据提示词条并补充新的字段翻译
- 移除药房模块独立词条合并至通用配置中
- 新增住院管理模块的完整国际化词条配置
2026-06-26 16:06:15 +08:00

34 lines
1.3 KiB
JavaScript

const fs = require('fs');
const path = require('path');
const enUS = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'src', 'i18n', 'locales', 'enUS.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') {
if (obj[k].includes('该套餐由') && obj[k].includes('创建')) {
obj[k] = 'Package created by "{creator}", no permission to delete';
}
if (obj[k].includes('请先在') && obj[k].includes('诊疗项目')) {
obj[k] = 'Please add items in System > Catalog > Treatment Items first';
}
if (obj[k].includes('确定要删除套餐') && obj[k].includes('无法恢复')) {
obj[k] = 'Delete package "{name}"? Cannot be undone.';
}
}
}
}
fixDeep(enUS);
fs.writeFileSync(path.join(__dirname, '..', 'src', 'i18n', 'locales', 'enUS.json'), JSON.stringify(enUS, 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 enUS:', countChinese(enUS));