UI: localize login gate hardcoded labels#61062
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f08f6b8c92
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR moves hardcoded English strings in the login gate (gateway URL placeholder, token/password visibility labels) into locale keys and wires them through
Confidence Score: 3/5Not safe to merge as-is — the tokenPlaceholder consolidation regresses an existing zh-CN/zh-TW translation. The change is well-scoped i18n cleanup with correct fallback infrastructure, but one specific key ( ui/src/i18n/locales/zh-CN.ts and ui/src/i18n/locales/zh-TW.ts — both need Prompt To Fix All With AIThis is a comment left during a code review.
Path: ui/src/i18n/locales/pt-BR.ts
Line: 159-163
Comment:
**Regression for zh-CN and zh-TW locales**
The original token-field placeholder was composed as `"OPENCLAW_GATEWAY_TOKEN (${t("login.passwordPlaceholder")})"`, which meant `zh-CN` and `zh-TW` users — who already had `passwordPlaceholder: "可选"` / `"可選"` translated — saw `"OPENCLAW_GATEWAY_TOKEN (可选)"`. Consolidating this into a single `tokenPlaceholder` key without also adding it to `zh-CN.ts` and `zh-TW.ts` silently drops those translations. The fallback chain yields the English `"OPENCLAW_GATEWAY_TOKEN (optional)"` for those locales instead.
To restore parity, add `tokenPlaceholder` to `ui/src/i18n/locales/zh-CN.ts` (at the `login:` block, line 154) and `ui/src/i18n/locales/zh-TW.ts` (same location):
```ts
// zh-CN.ts – login block
login: {
subtitle: "网关仪表盘",
tokenPlaceholder: "OPENCLAW_GATEWAY_TOKEN (可选)",
passwordPlaceholder: "可选",
},
// zh-TW.ts – login block
login: {
subtitle: "閘道儀表板",
tokenPlaceholder: "OPENCLAW_GATEWAY_TOKEN (可選)",
passwordPlaceholder: "可選",
},
```
The remaining seven new keys (`showToken`, `hideToken`, etc.) were hardcoded English before this PR, so their fallback to English for zh-CN/zh-TW is not a regression — only `tokenPlaceholder` regresses because it absorbs the previously-translated `passwordPlaceholder`.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "UI: localize login gate hardcoded labels" | Re-trigger Greptile |
|
Good catch — I restored the previous zh-CN / zh-TW token placeholder behavior by adding |
Signed-off-by: sallyom <[email protected]>
Signed-off-by: sallyom <[email protected]>
cab4fcc to
f591fbb
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f591fbb622
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| state.applySettings({ ...state.settings, token: v }); | ||
| }} | ||
| placeholder="OPENCLAW_GATEWAY_TOKEN (${t("login.passwordPlaceholder")})" | ||
| placeholder=${t("login.tokenPlaceholder")} |
There was a problem hiding this comment.
Restore localized token placeholder fallback
Switching the token input to t("login.tokenPlaceholder") drops localized placeholders in locales that still only provide login.passwordPlaceholder; before this change, the token placeholder reused passwordPlaceholder, but now those locales fall back to English OPENCLAW_GATEWAY_TOKEN (optional). Fresh evidence in this commit is that de, es, fr, id, ja-JP, ko, pl, tr, and uk locale bundles still omit login.tokenPlaceholder, so users selecting those languages see mixed-language text on the login gate.
Useful? React with 👍 / 👎.
7b86525 to
f591fbb
Compare
|
Closing in favor of #61054. |
Summary
login-gate.tsto read them throught(...).Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
ui/src/ui/views/login-gate.tsinstead of using locale files.Regression Test Plan (if applicable)
ui/src/i18n/test/translate.test.tsui/src/i18n/test/translate.test.tsUser-visible / Behavior Changes
Diagram (if applicable)
N/A
Security Impact (required)
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Validation:
Human Verification (required)
Review Conversations
Compatibility / Migration
Yes/No): YesYes/No): NoYes/No): NoRisks and Mitigations