Skip to content

fix(i18n): resolve code review issues for PR #1318 - #1324

Merged
diegosouzapw merged 2 commits into
cheaper-inference:release/v3.6.7from
clousky2020:feat/i18n-clean
Apr 16, 2026
Merged

diegosouzapw merged 2 commits into
cheaper-inference:release/v3.6.7from
clousky2020:feat/i18n-clean

Conversation

@clousky2020

Copy link
Copy Markdown
Contributor

Summary

Fixes all code review issues from PR #1318:

  • Fixed duplicate routing strategy guidance and recommendations translations in zh-CN.json
  • Added useMemo import in playground/page.tsx for performance optimization
  • Added useMemo in RequestLoggerV2.tsx for performance optimization
  • Fixed hardcoded string localization in ProxyConfigModal.tsx
  • Replaced dangerouslySetInnerHTML with t.rich in OAuthModal.tsx and PricingModal.tsx
  • Added missing translation namespaces to en.json

Files changed

  • src/app/(dashboard)/dashboard/combos/page.tsx
  • src/app/(dashboard)/dashboard/playground/page.tsx
  • src/i18n/messages/en.json
  • src/i18n/messages/zh-CN.json
  • src/shared/components/OAuthModal.tsx
  • src/shared/components/PricingModal.tsx
  • src/shared/components/ProxyConfigModal.tsx
  • src/shared/components/RequestLoggerV2.tsx

Test plan

  • Local test: Playground page loads correctly
  • Local test: Combos page loads correctly
  • Local test: Logs page loads correctly
  • ESLint and Prettier checks pass

🤖 Generated with Claude Code

- 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>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates strategy guidance and recommendations, refactors several components to use useMemo for performance optimization, and improves translation handling by replacing dangerouslySetInnerHTML with t.rich. It also adds a significant number of translation keys for various dashboard features. Feedback is provided regarding the RequestLoggerV2 component, where the cacheSource and tps columns were omitted from the columns array, and their corresponding translation keys are missing from the English locale file.

Comment on lines +130 to +145
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]
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The columns array is missing the cacheSource and tps columns which were present in the original COLUMNS constant. This causes these columns to be hidden by default (as visibleColumns is initialized from this array) and prevents them from appearing in the column visibility toggle list, resulting in a regression of UI functionality.

Suggested change
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]
);

Comment thread src/i18n/messages/en.json
Comment on lines +3557 to +3569
"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"
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Missing translation keys for cacheSource and tps columns in the requestLogger namespace. These are required to support the missing columns in the Request Logger UI.

Suggested change
"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"
},

Add cacheSource and tps to the translated columns array and their
corresponding translation keys in en.json and zh-CN.json.
@diegosouzapw
diegosouzapw changed the base branch from main to release/v3.6.7 April 16, 2026 13:17
@diegosouzapw
diegosouzapw merged commit 57395ed into cheaper-inference:release/v3.6.7 Apr 16, 2026
2 checks passed
Poid-ZA pushed a commit to Poid-ZA/OmniRoute that referenced this pull request Aug 5, 2026
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants