Repository navigation
fix(i18n): resolve code review issues for PR #1318 - #1323
clousky2020 wants to merge 1 commit into
Conversation
- Fix duplicate routing strategy guidance texts in zh-CN.json - Fix strategy recommendations duplicates - Add useMemo import in playground/page.tsx - Add hardcoded string localization in ProxyConfigModal.tsx - Replace dangerouslySetInnerHTML with t.rich in OAuthModal.tsx - Replace dangerouslySetInnerHTML with t.rich in PricingModal.tsx - Add useMemo in RequestLoggerV2.tsx for performance Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request updates strategy guidance descriptions, refactors component logic to use useMemo for performance optimization, and transitions from dangerouslySetInnerHTML to t.rich for safer translation rendering. It also introduces a significant number of new translation keys for various dashboard modules. Review feedback identifies missing cacheSource and tps columns in the RequestLoggerV2 component and their associated translation entries in the English locale file.
| const columns = useMemo( | ||
| () => [ | ||
| { key: "status", label: t("columns.status") }, | ||
| { key: "model", label: t("columns.model") }, | ||
| { key: "requestedModel", label: t("columns.requested") }, | ||
| { key: "provider", label: t("columns.provider") }, | ||
| { key: "protocol", label: t("columns.protocol") }, | ||
| { key: "account", label: t("columns.account") }, | ||
| { key: "apiKey", label: t("columns.apiKey") }, | ||
| { key: "combo", label: t("columns.combo") }, | ||
| { key: "tokens", label: t("columns.tokens") }, | ||
| { key: "duration", label: t("columns.duration") }, | ||
| { key: "time", label: t("columns.time") }, | ||
| ], | ||
| [t] | ||
| ); |
There was a problem hiding this comment.
在 columns 的 useMemo 中缺少了 cacheSource 和 tps 列。这会导致这些列在 UI 中无法显示或切换(因为 defaultVisible 和列切换按钮都依赖于此数组),尽管表格逻辑中已经包含了它们。建议同步 COLUMNS 常量中的定义。
| const columns = useMemo( | |
| () => [ | |
| { key: "status", label: t("columns.status") }, | |
| { key: "model", label: t("columns.model") }, | |
| { key: "requestedModel", label: t("columns.requested") }, | |
| { key: "provider", label: t("columns.provider") }, | |
| { key: "protocol", label: t("columns.protocol") }, | |
| { key: "account", label: t("columns.account") }, | |
| { key: "apiKey", label: t("columns.apiKey") }, | |
| { key: "combo", label: t("columns.combo") }, | |
| { key: "tokens", label: t("columns.tokens") }, | |
| { key: "duration", label: t("columns.duration") }, | |
| { key: "time", label: t("columns.time") }, | |
| ], | |
| [t] | |
| ); | |
| const columns = useMemo( | |
| () => [ | |
| { key: "status", label: t("columns.status") }, | |
| { key: "cacheSource", label: t("columns.cacheSource") }, | |
| { key: "model", label: t("columns.model") }, | |
| { key: "requestedModel", label: t("columns.requested") }, | |
| { key: "provider", label: t("columns.provider") }, | |
| { key: "protocol", label: t("columns.protocol") }, | |
| { key: "account", label: t("columns.account") }, | |
| { key: "apiKey", label: t("columns.apiKey") }, | |
| { key: "combo", label: t("columns.combo") }, | |
| { key: "tokens", label: t("columns.tokens") }, | |
| { key: "tps", label: t("columns.tps") }, | |
| { key: "duration", label: t("columns.duration") }, | |
| { key: "time", label: t("columns.time") }, | |
| ], | |
| [t] | |
| ); |
| "columns": { | ||
| "status": "Status", | ||
| "model": "Model", | ||
| "requested": "Requested", | ||
| "provider": "Provider", | ||
| "protocol": "Request Protocol", | ||
| "account": "Account", | ||
| "apiKey": "API Key", | ||
| "combo": "Combo", | ||
| "tokens": "Tokens", | ||
| "duration": "Duration", | ||
| "time": "Time" | ||
| }, |
There was a problem hiding this comment.
requestLogger.columns 命名空间中缺少 cacheSource 和 tps 的翻译。建议添加以支持多语言显示并与代码逻辑保持一致。
| "columns": { | |
| "status": "Status", | |
| "model": "Model", | |
| "requested": "Requested", | |
| "provider": "Provider", | |
| "protocol": "Request Protocol", | |
| "account": "Account", | |
| "apiKey": "API Key", | |
| "combo": "Combo", | |
| "tokens": "Tokens", | |
| "duration": "Duration", | |
| "time": "Time" | |
| }, | |
| "columns": { | |
| "status": "Status", | |
| "cacheSource": "Cache Source", | |
| "model": "Model", | |
| "requested": "Requested", | |
| "provider": "Provider", | |
| "protocol": "Request Protocol", | |
| "account": "Account", | |
| "apiKey": "API Key", | |
| "combo": "Combo", | |
| "tokens": "Tokens", | |
| "tps": "TPS", | |
| "duration": "Duration", | |
| "time": "Time" | |
| }, |
Summary
修复 PR #1318 代码审查反馈中指出的所有问题:
Test plan
🤖 Generated with Claude Code