侧边栏壁纸
  • 累计撰写 21 篇文章
  • 累计收到 29 条评论

AI:多语言查漏补缺计划

2026-5-5 / 0 评论 / 211 阅读

现状分析
已有 zh-CN.json / en.json 基础翻译文件,结构覆盖 nav/auth/common/base/erp/mes/qms/wms/finance/system/report
缺失键值:经营分析、健康检查、移动端模块、安装向导、部分看板图表文本
硬编码中文分布:reports/system/mobile/install/erp/mes/finance/qms/wms/base 等模块的组件模板与 TS 逻辑中
执行策略
按"先补翻译文件,再分批替换组件"的顺序推进,每次修改后及时编译验证。
Task 1: 补充翻译文件缺失键值
文件:frontend/src/assets/i18n/zh-CN.json、frontend/src/assets/i18n/en.json
补充内容:
report.businessAnalysis 经营分析相关(KPI名称、图表标题、TOP排名)
report.board 看板通用(刷新、全屏、TV模式、深色/浅色、面板标题)
system.health 健康检查(CPU/内存/磁盘/数据库/运行时长/系统信息)
system.audit 审计分析(今日操作/异常、7天趋势、风险行为)
system.perfMonitor 性能监控(API响应时间、慢查询、异常统计)
mobile 移动端(搜索占位符、搜索历史、清空、定位中、拍照、重拍、上班/下班打卡、上传中、今日记录、KPI卡片名、万单位)
install 安装向导(系统名称默认值、管理员名称默认值、提示文本)
common.status 扩展状态值(已过账/已作废/草稿/未结账等财务状态)
erp.crm 扩展(跟进方式:电话/拜访/邮件/微信/其他,商机/客户搜索占位符)
base.hr 扩展(招聘状态:招聘中/暂停/已关闭)
Task 2: reports 模块硬编码中文替换
文件清单:
report-business-analysis.component.ts(KPI卡片、图表标题、按钮)
board-production.component.ts(面板标题、图表图例/坐标轴)
board-warehouse.component.ts(同上)
board-quality.component.ts(同上)
board-finance.component.ts(同上)
report-dashboard.component.ts(数据大屏文本)
report-inventory.component.ts
report-inbound.component.ts
report-outbound.component.ts
report-purchase.component.ts
report-sale.component.ts
report-production.component.ts
report-quality.component.ts
report-finance.component.ts
改动要点:模板中所有中文文本改用 {{ 'key' | translate }} 或 instant;ECharts 配置中的 title、legend.data、xAxis.name、yAxis.name、series.name 改用翻译后的值
Task 3: system 模块硬编码中文替换
文件清单:
health-check.component.ts(状态标签、指标标签、磁盘/系统信息标题)
audit-analysis.component.ts(面板标题、tab标题、统计标签)
perf-monitor.component.ts(图表标题、列表列名)
online-user-list.component.ts
backup-list.component.ts
operation-log-list.component.ts
login-log-list.component.ts
sensitive-log-list.component.ts
scheduled-task-list.component.ts
notification-list.component.ts
notification-template-list.component.ts
notification-channel-list.component.ts
print-template-list.component.ts
barcode-rule-list.component.ts
barcode-generate.component.ts
workflow-definition-list.component.ts
workflow-instance-list.component.ts
workflow-task-list.component.ts
Task 4: mobile 模块硬编码中文替换
文件清单:
mobile-dashboard.component.ts(KPI名、图表图例、万单位格式化)
mobile-search.component.ts(占位符、结果提示、搜索历史、清空)
mobile-face-attendance.component.ts(标题、拍照、重拍、上班/下班打卡、上传中、今日记录)
mobile-job-center.component.ts
mobile-iqc.component.ts
mobile-ipqc.component.ts
mobile-oqc.component.ts
mobile-inspection.component.ts
mobile-stock-query.component.ts
mobile-trace.component.ts
mobile-todo.component.ts
mobile-done.component.ts
mobile-notification.component.ts
mobile-profile.component.ts
mobile-approval-detail.component.ts
mobile-workflow-instance.component.ts
mobile-layout.component.ts(底部导航tab名)
Task 5: install 模块硬编码中文替换
文件清单:
install.component.ts(表单默认值、提示文本)
Task 6: 业务模块(erp/mes/finance/qms/wms/base)硬编码中文替换
重点处理:
列表页:标题、搜索占位符、筛选占位符、表格列头、操作按钮文字、状态标签
表单页:卡片标题、字段标签、下拉选项(如跟进方式、招聘状态、凭证状态)、验证提示
弹窗:确认对话框文本
优先级:列表页 > 表单页 > 弹窗
Task 7: 全局零散硬编码替换
文件:
app.component.ts 中硬编码菜单 title(部分可能已用 translate,需检查)
shared 模块中的通用组件(如导入对话框、导出对话框、打印预览、列自定义弹窗)
approval-center 审批中心页面
profile 个人中心页面
Task 8: 编译验证
前端 ng build --configuration production 编译通过
检查是否有遗漏的 translate 管道使用错误(如未导入 TranslateModule)
注意事项
ECharts 图表文本在 ngOnInit 或数据加载后通过 this.translate.instant() 获取并赋值
移动端底部导航 tab 名需同步更新 mobile-layout.component.ts
表单下拉框选项(如 nb-option)中部分值是业务数据枚举,需确认是否应从数据字典读取;纯 UI 选项(如跟进方式)才需要翻译
对于 HTML 注释中的中文(如 ),可保留或替换为英文注释,不影响运行时
数字格式化中的中文单位(如 万)需补充翻译键值

评论一下?

OωO
取消