feat(portal): i18n 收尾 — operator dashboard 全接线 + admin 角色名映射#310
Conversation
- app/operator/page.tsx: full i18n wiring of the operator dashboard (operatorDashboard ns); keep #309 Quick Actions (operatorHub) + add type=button - app/admin/page.tsx: map API role.name via t(roleNames.<name>) with raw fallback - locales: +operatorDashboard (27) +roleNames (7); 632 keys, en/zh in parity Completes #305 review suggestion (type=button) and the operator/admin i18n gaps. Verified: type-check 0, i18n:check (632), lint clean, next build pass.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
clestons
left a comment
There was a problem hiding this comment.
Review: feat(portal): operator dashboard i18n 收尾 + admin roleNames 映射
Verdict: APPROVE — 2-round (pure i18n wiring + role name mapping, no business logic / auth / contracts). No blocking findings.
What was verified
type="button" fix — Both Quick Actions buttons now carry type="button", addressing the Low suggestion from #309. ✅
operatorDashboard namespace (27 keys) — Full i18n coverage for app/operator/page.tsx: title, loadError, status badges (spoBadge, v4OperatorBadge), metric cards (gtokenBalance, spoStake, spBalance, configured/notConfigured, exchangeRate, v4PaymasterEth), SPO registration instructions, contractAddresses, spoOperatorsTitle/v4OperatorsTitle, noneRegistered. EN/ZH symmetric. ✅
Split prefix/suffix pattern — registerSpoStep2Prefix/registerSpoStep2Suffix, deployV4Step1Prefix/deployV4Step1Suffix, deployV4Step2Prefix/deployV4Step2Suffix correctly wrap inline <code> elements without embedding markup in translation strings. ✅
roleNames namespace (7 keys) — app/admin/page.tsx uses t(\roleNames.${role.name}`, { defaultValue: role.name })`. Unknown role names fall back to the original string — zero data loss on schema evolution. EN maps technical aliases correctly ("SPO" and "SPO Operator" both → "SPO Operator"; "Admin" and "Protocol Admin" both → "Protocol Admin"). ✅
EN/ZH parity — 34 new keys per locale (27 + 7), symmetric structure. 632 total keys, i18n:check CI guard passed. ✅
Import ordering — useTranslation moved before @heroicons/react imports; cosmetic cleanup, no functional effect. ✅
No regressions — operatorHub (4 keys, #309), operatorDeploy/operatorManage/rolePage/communityPage/adminPage/salePage namespaces (prior PRs) untouched. ✅
改动
app/operator/page.tsx:运营者 dashboard 其余文案完整 i18n 接线(operatorDashboard命名空间);保留 feat(portal): operator dashboard 加入口到 deploy/manage 流程 #309 的 Quick Actions 入口(operatorHub)并补type="button"(feat(portal): Track D — i18next 中英双语基建 #305/feat(portal): operator dashboard 加入口到 deploy/manage 流程 #309 的 Low 建议)app/admin/page.tsx:role.name经t(roleNames.${name}, {defaultValue})映射,未知值回退原文不丢数据operatorDashboard(27)+roleNames(7);en/zh 各 632 key 一致说明
i18n:check632 key、lint 干净、next build 通过