fix(ui): use i18n t() for Node option in exec approvals target select#68152
fix(ui): use i18n t() for Node option in exec approvals target select#68152patricklee001 wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Greptile SummaryReplaces the hardcoded Confidence Score: 5/5Safe to merge; the change is a minimal, correct i18n fix with no logic impact. The only remaining finding is a P2 consistency suggestion (translating the sibling Gateway option). No logic, correctness, or security concerns. ui/src/ui/views/nodes-exec-approvals.ts — the sibling Gateway option on line 258 is still hardcoded English. Prompt To Fix All With AIThis is a comment left during a code review.
Path: ui/src/ui/views/nodes-exec-approvals.ts
Line: 258
Comment:
**Sibling `Gateway` option still hardcoded**
The `Node` option is now translated but the `Gateway` option immediately above it in the same `<select>` remains a hardcoded English string. Non-English locales will see a mixed select (e.g. "Gateway / 节点" in zh-CN). A `nodes.binding.gateway: "Gateway"` key should be added to `en.ts`, the locale bundles regenerated with `pnpm ui:i18n:sync`, and `Gateway` replaced with `${t("nodes.binding.gateway")}` here.
```suggestion
<option value="gateway" ?selected=${state.target === "gateway"}>${t("nodes.binding.gateway")}</option>
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(ui): use i18n t() for Node option in..." | Re-trigger Greptile |
| @@ -256,7 +256,7 @@ function renderExecApprovalsTarget(state: ExecApprovalsState) { | |||
| }} | |||
| > | |||
| <option value="gateway" ?selected=${state.target === "gateway"}>Gateway</option> | |||
There was a problem hiding this comment.
Sibling
Gateway option still hardcoded
The Node option is now translated but the Gateway option immediately above it in the same <select> remains a hardcoded English string. Non-English locales will see a mixed select (e.g. "Gateway / 节点" in zh-CN). A nodes.binding.gateway: "Gateway" key should be added to en.ts, the locale bundles regenerated with pnpm ui:i18n:sync, and Gateway replaced with ${t("nodes.binding.gateway")} here.
| <option value="gateway" ?selected=${state.target === "gateway"}>Gateway</option> | |
| <option value="gateway" ?selected=${state.target === "gateway"}>${t("nodes.binding.gateway")}</option> |
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/ui/views/nodes-exec-approvals.ts
Line: 258
Comment:
**Sibling `Gateway` option still hardcoded**
The `Node` option is now translated but the `Gateway` option immediately above it in the same `<select>` remains a hardcoded English string. Non-English locales will see a mixed select (e.g. "Gateway / 节点" in zh-CN). A `nodes.binding.gateway: "Gateway"` key should be added to `en.ts`, the locale bundles regenerated with `pnpm ui:i18n:sync`, and `Gateway` replaced with `${t("nodes.binding.gateway")}` here.
```suggestion
<option value="gateway" ?selected=${state.target === "gateway"}>${t("nodes.binding.gateway")}</option>
```
How can I resolve this? If you propose a fix, please make it concise.|
Codex review: needs changes before merge. Summary Reproducibility: yes. The code path is deterministic: current main renders Next step before merge Security Review findings
Review detailsBest possible solution: Localize the complete target selector in one i18n workflow change: add the gateway source key, render both options through Do we have a high-confidence way to reproduce the issue? Yes. The code path is deterministic: current main renders Is this the best way to solve the issue? No. The PR is a valid partial fix, but the narrow maintainable solution is to update the whole selector and generated i18n metadata together. Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 225b71db1ee8. |
What
Fix hardcoded
Nodestring inui/src/ui/views/nodes-exec-approvals.tsthat bypasses the i18n system.The translation key
nodes.binding.nodealready exists in all locale files with proper translations (e.g.节点for zh-CN,節點for zh-TW).How
Replace the hardcoded string in the exec approvals target
<select>witht("nodes.binding.node").Testing
Related
Fixes #24803