From 39947675d2fbba46ec0bc4476316150fa12758be Mon Sep 17 00:00:00 2001 From: argszero Date: Mon, 21 Sep 2026 19:09:19 +0800 Subject: [PATCH] chore(i18n): drop 23 keys that no consumer can reach The reachability gate added by the preceding PR in this series finds 59 (key, class) pairs that no consumer can reach. Delete the 23 that are unambiguously dead and, in the same commit, remove their sunset-list entries, so the list stays exactly equal to the computed unreachable set (59 -> 36 pairs). Nothing observable changes: none of the 23 keys is referenced by any T(...) call, data-i18n* attribute or other consumer in the UI corpus. - ui/js/i18n.js: 23 keys removed from each pack (46 lines = 811 - 788) - src/i18n_pack.rs: matching 23 sunset-list entries removed; ZH_KEY_COUNT / EN_KEY_COUNT recalibrated from the gate's own report - ui/index.html: cache-bust token for js/i18n.js bumped --- src/i18n_pack.rs | 27 ++------------------------- ui/index.html | 2 +- ui/js/i18n.js | 46 ---------------------------------------------- 3 files changed, 3 insertions(+), 72 deletions(-) diff --git a/src/i18n_pack.rs b/src/i18n_pack.rs index fa7ba8b..e8917ba 100644 --- a/src/i18n_pack.rs +++ b/src/i18n_pack.rs @@ -99,8 +99,8 @@ const EN_END: &str = "\n };"; /// /// ⚠️ `T_LITERAL_COUNT` 是 `T("…")` **调用点**总数,不是键数,也不是去重后的键数 —— /// 三个集合各不相同(坑 99);说「这个数不该变」之前先确认它在数哪个集合。 -const ZH_KEY_COUNT: usize = 811; -const EN_KEY_COUNT: usize = 811; +const ZH_KEY_COUNT: usize = 788; +const EN_KEY_COUNT: usize = 788; const STATIC_ATTR_COUNT: usize = 332; const STATIC_ATTR_DISTINCT: usize = 307; const T_LITERAL_COUNT: usize = 537; @@ -897,26 +897,6 @@ fn pack_values(region: &str) -> (BTreeMap, usize) { /// - `weak-should-wire` 代码手工拼了更优文案,专键存在但没人用 /// - `host-decision` 宿主裁定族,⛔ 勿自修 const UNREACHABLE_PACK_KEYS: &[(&str, &str)] = &[ - ("admin.emp.dept.unassigned", "dup-sibling"), - ("admin.emp.status.near", "dup-sibling"), - ("admin.emp.status.normal", "dup-sibling"), - ("common.calls", "dup-sibling"), - ("common.copy", "dup-sibling"), - ("common.month", "dup-sibling"), - ("common.people", "dup-sibling"), - ("common.rename", "dup-sibling"), - ("mk.count", "dup-sibling"), - ("share.stats.listings.sub", "dup-sibling"), - ("share.stats.used.sub", "dup-sibling"), - ("admin.emp.stats.members.sub.mock", "zero-mock"), - ("admin.emp.stats.members.sub.mock2", "zero-mock"), - ("admin.org.demo", "zero-mock"), - ("admin.raise.demo", "zero-mock"), - ("ops.demo", "zero-mock"), - ("ops.stats.in.sub.mock", "zero-mock"), - ("ops.stats.keys.sub.mock", "zero-mock"), - ("ops.stats.out.sub.mock", "zero-mock"), - ("ops.stats.users.sub.mock", "zero-mock"), ("admin.emp.col.empty", "old-design"), ("admin.emp.col.quota", "old-design"), ("admin.emp.col.remain", "old-design"), @@ -951,9 +931,6 @@ const UNREACHABLE_PACK_KEYS: &[(&str, &str)] = &[ ("login.email.ph", "neutral-literal"), ("settings.prefs.lang.en", "neutral-literal"), ("settings.prefs.lang.zh", "neutral-literal"), - ("login.forgot", "composite"), - ("wallet.withdraw.disabled", "composite"), - ("tx.col.key", "rename"), ("admin.emp.dept.ok.unassigned", "weak-should-wire"), ("admin.usage.unit.points", "host-decision"), ]; diff --git a/ui/index.html b/ui/index.html index 91d68bf..6d8002d 100644 --- a/ui/index.html +++ b/ui/index.html @@ -854,7 +854,7 @@

使用模型

- + diff --git a/ui/js/i18n.js b/ui/js/i18n.js index f943349..0f33314 100644 --- a/ui/js/i18n.js +++ b/ui/js/i18n.js @@ -60,7 +60,6 @@ "login.or": "或", "login.guest": "先逛逛市场", "login.foot": "还没有账号?注册 · 找回密码", - "login.forgot": "找回密码", "login.tip": "已对接后端 API · 登录后进入真实数据界面 · 管理员账号登录可见「管理视图」", "login.logging": "登录中…", "login.submit": "登 录", @@ -128,16 +127,11 @@ "common.save": "保存", "common.edit": "编辑", "common.delete": "删除", - "common.copy": "复制", - "common.rename": "改名", "common.close": "关闭", "common.retry": "重试", "common.search": "搜索", "common.all": "全部", "common.points": "点", - "common.people": "人", - "common.calls": "次", - "common.month": "本月", "common.unnamed": "未命名", "common.unassigned": "未分配", "common.none": "—", @@ -201,7 +195,6 @@ "mk.cap.vision": "读图", "mk.cap.vision.title": "支持图片输入(vision)", "mk.cap.peak": "高峰计价", - "mk.count": "{n} 个在售 key", "mk.recent": "最近使用", "mk.recent.clear": "清空", "mk.recent.clear.title": "清空最近使用记录", @@ -266,11 +259,9 @@ "share.day.5": "周五", "share.day.6": "周六", "share.day.7": "周日", "share.allDay": "全天", "share.stats.listings": "上架中", - "share.stats.listings.sub": "{n} 个历史", "share.stats.earnings": "累计收益", "share.stats.earnings.sub": "全部 key", "share.stats.used": "已用量", - "share.stats.used.sub": "{n} 点总额度", "share.stats.newthis": "本月新增", "share.stats.newthis.sub": "多个模型", "share.stats.newthis.none": "本月还没有上架", @@ -348,7 +339,6 @@ "wallet.raise.err.reason": "请填写申请原因", "wallet.raise.ok": "已提交申请 +{amt} 点,等待管理员审批", "wallet.raise.fail": "提交失败", - "wallet.withdraw.disabled": "提现暂不支持", /* ---- 交易记录 ---- */ "tx.tab.all": "全部", @@ -384,7 +374,6 @@ "tx.col.type": "类型", "tx.col.user": "用户", "tx.col.model": "模型", - "tx.col.key": "Key", "tx.col.apiKeyName": "api-key 名称", "tx.col.input": "输入(非缓存)", "tx.col.cached": "输入(缓存)", @@ -578,15 +567,10 @@ "admin.emp.stats.quota.sub": "月", "admin.emp.stats.used.sub": "{p}% 消耗率", "admin.emp.stats.remain.sub": "按成员分配", - "admin.emp.stats.members.sub.mock": "{d} 个部门 · 未分配 {n} 人", - "admin.emp.stats.members.sub.mock2": "{d} 个部门", "admin.emp.role.admin": " · 管理员", "admin.emp.role.ops": " · 运营者", - "admin.emp.dept.unassigned": "未分配", "admin.emp.dept.change": "改部门", "admin.emp.topup": "充值", - "admin.emp.status.near": "接近限额", - "admin.emp.status.normal": "正常", "admin.emp.topup.ok": "已给 {name} 充值 {amt} 点", "admin.emp.topup.fail": "充值失败", "admin.emp.topup.err": "请输入正整数点数金额", @@ -596,7 +580,6 @@ "admin.emp.dept.fail": "调整失败", "admin.raise.title": "加额申请", "admin.raise.sub": "(成员申请 → 管理员批准 / 驳回)", - "admin.raise.demo": "⚠ 演示数据 — 加额审批后端待 P2-C 补齐", "admin.raise.col.member": "成员", "admin.raise.col.amount": "申请点数", "admin.raise.col.reason": "原因", @@ -646,7 +629,6 @@ "admin.org.empty": "没有匹配的部门", "admin.org.empty.sub": "试试调整搜索关键词", "admin.org.clearSearch": "清除搜索", - "admin.org.demo": "⚠ 演示数据 — 部门/组织管理后端待 P2-C 补齐", "admin.org.edit.title": "编辑部门", "admin.org.add.title": "添加部门", "admin.org.form.name": "部门名称", @@ -702,13 +684,8 @@ "ops.stats.out": "点数流出", "ops.stats.in.sub": "本月", "ops.stats.out.sub": "本月", - "ops.stats.keys.sub.mock": "{n} 个历史上架", - "ops.stats.users.sub.mock": "注册用户", "ops.stats.trades": "交易量", "ops.stats.trades.sub": "累计全部类型", - "ops.stats.in.sub.mock": "收益 / 充值 / 赠送", - "ops.stats.out.sub.mock": "消费 / 提现", - "ops.demo": "⚠ 演示数据 — 平台运营者(ops)端点待 P2-C 补齐", "ops.users.title": "用户充值", "ops.users.sub": "运营者 = 宿主本人(职责最小化:仅运行概览 + 充值)。按用户名 / 邮箱定位用户 → 输入点数金额 → 确认后余额增加永久有效点数并产生一条交易记录。", "ops.users.search.ph": "搜索用户名 / 邮箱…", @@ -906,7 +883,6 @@ "login.or": "or", "login.guest": "Browse market as guest", "login.foot": "No account? Register · Forgot password", - "login.forgot": "Forgot password", "login.tip": "Connected to backend API · real data after login · admin accounts see the Admin view", "login.logging": "Signing in…", "login.submit": "Sign in", @@ -972,16 +948,11 @@ "common.save": "Save", "common.edit": "Edit", "common.delete": "Delete", - "common.copy": "Copy", - "common.rename": "Rename", "common.close": "Close", "common.retry": "Retry", "common.search": "Search", "common.all": "All", "common.points": "pts", - "common.people": "people", - "common.calls": "calls", - "common.month": "month", "common.unnamed": "Unnamed", "common.unassigned": "Unassigned", "common.none": "—", @@ -1043,7 +1014,6 @@ "mk.cap.vision": "Vision", "mk.cap.vision.title": "Accepts image input (vision)", "mk.cap.peak": "Peak pricing", - "mk.count": "{n} keys on sale", "mk.recent": "Recent", "mk.recent.clear": "Clear", "mk.recent.clear.title": "Clear recent models", @@ -1107,11 +1077,9 @@ "share.day.5": "Fri", "share.day.6": "Sat", "share.day.7": "Sun", "share.allDay": "All day", "share.stats.listings": "Listings", - "share.stats.listings.sub": "{n} historical", "share.stats.earnings": "Total earnings", "share.stats.earnings.sub": "all keys", "share.stats.used": "Used", - "share.stats.used.sub": "{n} pts total quota", "share.stats.newthis": "New this month", "share.stats.newthis.sub": "several models", "share.stats.newthis.none": "nothing listed this month", @@ -1188,7 +1156,6 @@ "wallet.raise.err.reason": "Please fill in the reason", "wallet.raise.ok": "Request submitted +{amt} pts, awaiting admin approval", "wallet.raise.fail": "Submit failed", - "wallet.withdraw.disabled": "Withdraw is not supported yet", "tx.tab.all": "All", "tx.crumb": "/ Transactions", @@ -1223,7 +1190,6 @@ "tx.col.type": "Type", "tx.col.user": "User", "tx.col.model": "Model", - "tx.col.key": "Key", "tx.col.apiKeyName": "API Key Name", "tx.col.input": "Input (non-cache)", "tx.col.cached": "Input (cache)", @@ -1415,15 +1381,10 @@ "admin.emp.stats.quota.sub": "monthly", "admin.emp.stats.used.sub": "{p}% consumed", "admin.emp.stats.remain.sub": "by member", - "admin.emp.stats.members.sub.mock": "{d} departments · {n} unassigned", - "admin.emp.stats.members.sub.mock2": "{d} departments", "admin.emp.role.admin": " · Admin", "admin.emp.role.ops": " · Operator", - "admin.emp.dept.unassigned": "Unassigned", "admin.emp.dept.change": "Change dept", "admin.emp.topup": "Top up", - "admin.emp.status.near": "Near limit", - "admin.emp.status.normal": "OK", "admin.emp.topup.ok": "Topped up {name} with {amt} pts", "admin.emp.topup.fail": "Top-up failed", "admin.emp.topup.err": "Please enter a positive integer amount", @@ -1433,7 +1394,6 @@ "admin.emp.dept.fail": "Move failed", "admin.raise.title": "Raise requests", "admin.raise.sub": "(member request → admin approve / reject)", - "admin.raise.demo": "⚠ Demo data — raise approval pending backend (P2-C)", "admin.raise.col.member": "Member", "admin.raise.col.amount": "Requested pts", "admin.raise.col.reason": "Reason", @@ -1483,7 +1443,6 @@ "admin.org.empty": "No matching departments", "admin.org.empty.sub": "Try adjusting search keywords", "admin.org.clearSearch": "Clear search", - "admin.org.demo": "⚠ Demo data — departments pending backend (P2-C)", "admin.org.edit.title": "Edit department", "admin.org.add.title": "Add department", "admin.org.form.name": "Department name", @@ -1538,13 +1497,8 @@ "ops.stats.out": "Points out", "ops.stats.in.sub": "this month", "ops.stats.out.sub": "this month", - "ops.stats.keys.sub.mock": "{n} historical listings", - "ops.stats.users.sub.mock": "registered users", "ops.stats.trades": "Trades", "ops.stats.trades.sub": "all types", - "ops.stats.in.sub.mock": "earn / top-up / gift", - "ops.stats.out.sub.mock": "consume / withdraw", - "ops.demo": "⚠ Demo data — operator (ops) endpoints pending (P2-C)", "ops.users.title": "Top up a user", "ops.users.sub": "Operator = the host (minimal duties: overview + top-ups). Locate a user by name / email → enter points → confirm to add permanent points and record a transaction.", "ops.users.search.ph": "Search username / email…",