Skip to content

Fix missing/broken i18n - #89

Merged
dwgx merged 4 commits into
dwgx:masterfrom
smeinecke:fix/missing-i18n
Apr 29, 2026
Merged

Fix missing/broken i18n #89
dwgx merged 4 commits into
dwgx:masterfrom
smeinecke:fix/missing-i18n

Conversation

@smeinecke

Copy link
Copy Markdown
Contributor

改了什么 / What changed

  • Fixed i18n translation for all error codes in dashboard login flows (toasts, result displays, and login history)
  • Standardized error code naming: ERR_PRIVATE_IPERR_PROXY_PRIVATE_IP, ERR_PRIVATE_HOSTERR_PROXY_PRIVATE_HOST
  • Added missing ERR_PROXY_PRIVATE_HOST translation key to both en.json and zh-CN.json
  • Improved language toggle UI with dynamic tooltip showing target language

为什么 / Why

Fixes the issue where error codes like ERR_NO_PASSWORD_SET were displayed raw in toasts and login history instead of human-readable translations. Also aligns error code naming with existing ERR_PROXY_PRIVATE_IP for consistency.

测试 / Testing

  • Dashboard login with OAuth/password errors now shows translated messages in toasts
  • Login History table displays translated error messages with original code in tooltip
  • Language switcher tooltip correctly shows "Switch to English" / "切换到中文" based on current locale
  • No new npm dependencies (zero-dep project)

Checklist

  • 代码风格和现有文件一致 / Code style matches existing files
  • 没有引入 npm 依赖 / No new npm dependencies (project is zero-dep)
  • 涉及 LS binary 协议改动时 在 PR 描述里注明字段号来源 / If touching LS protocol, document field-number source in the PR description
  • 涉及 dashboard UI 用 App.confirm / App.prompt 不用浏览器原生 alert/confirm / Uses App.confirm / App.prompt, not native dialogs (if dashboard)

… i18n keys exist

All Windsurf login error display paths (single/batch/import) now attempt I18n.t() on error strings before rendering. If the error message is a known i18n key (I18n.t(err) !== err), use the translated version; otherwise fall back to the raw error string. Covers toast notifications, status text, result cards, and batch table cells.
…h panels + error.* namespace

Language toggle button now shows "中文"/"English" full words instead of "中"/"EN" abbreviations, with dynamic title tooltip ("Switch to English" / "切换到中文"). toggleLang() made async and triggers refreshActivePanelI18n() to reload the active panel's content after locale switch, so users see translated UI immediately without manual navigation.
… error codes

Dashboard i18n now includes ERR_PROXY_PRIVATE_HOST ("Private/local host is not allowed" / "内网/本地主机不允许"). net-safety.js error codes renamed from ERR_PRIVATE_HOST/ERR_PRIVATE_IP to ERR_PROXY_PRIVATE_HOST/ERR_PROXY_PRIVATE_IP for consistency with error.* namespace convention.
… rename

Follows the error code rename from ERR_PRIVATE_IP to ERR_PROXY_PRIVATE_IP introduced in 94509b9 (net-safety.js error codes standardized to error.* namespace convention). Also removes trailing blank lines.
@dwgx
dwgx merged commit 2cded99 into dwgx:master Apr 29, 2026
2 checks passed
dwgx added a commit that referenced this pull request Apr 29, 2026
- check-i18n.js: bare identifier 不再误报缺失 key (errKey/errCode/etc)
- 补 action.revealKey 翻译(v2.0.26 之前就缺,hardcoded fallback 已去)
- 新增 footer.langToggleTo{En,Zh} 给 PR #89 引入的 toggleBtn.title 用,去掉硬编码 '切换到中文'
- 全部 i18n 检查 + 311/311 tests pass
@smeinecke
smeinecke deleted the fix/missing-i18n branch April 29, 2026 09:11
huanchen pushed a commit to huanchen/WindsurfAPI that referenced this pull request May 3, 2026
Merging i18n fixes from @smeinecke. Thanks!

Notes for follow-up (will fix in v2.0.27):
- `toggleBtn.title = zhMode ? 'Switch to English' : '切换到中文'` introduces a hardcoded Chinese string that fails `node src/dashboard/check-i18n.js`. Will replace with `data-i18n-title` attribute pattern.
- The `error.${err.message}` lookup pattern is duplicated across 6 sites — will centralize into an `App.translateError(code, fallback)` helper next pass.
- Will also clean up the `action.revealKey` pre-existing miss while there.
huanchen pushed a commit to huanchen/WindsurfAPI that referenced this pull request May 3, 2026
- check-i18n.js: bare identifier 不再误报缺失 key (errKey/errCode/etc)
- 补 action.revealKey 翻译(v2.0.26 之前就缺,hardcoded fallback 已去)
- 新增 footer.langToggleTo{En,Zh} 给 PR dwgx#89 引入的 toggleBtn.title 用,去掉硬编码 '切换到中文'
- 全部 i18n 检查 + 311/311 tests pass
dwgx added a commit that referenced this pull request May 9, 2026
Merging i18n fixes from @smeinecke. Thanks!

Notes for follow-up (will fix in v2.0.27):
- `toggleBtn.title = zhMode ? 'Switch to English' : '切换到中文'` introduces a hardcoded Chinese string that fails `node src/dashboard/check-i18n.js`. Will replace with `data-i18n-title` attribute pattern.
- The `error.${err.message}` lookup pattern is duplicated across 6 sites — will centralize into an `App.translateError(code, fallback)` helper next pass.
- Will also clean up the `action.revealKey` pre-existing miss while there.
dwgx added a commit that referenced this pull request May 9, 2026
- check-i18n.js: bare identifier 不再误报缺失 key (errKey/errCode/etc)
- 补 action.revealKey 翻译(v2.0.26 之前就缺,hardcoded fallback 已去)
- 新增 footer.langToggleTo{En,Zh} 给 PR #89 引入的 toggleBtn.title 用,去掉硬编码 '切换到中文'
- 全部 i18n 检查 + 311/311 tests pass
dwgx added a commit that referenced this pull request Jun 4, 2026
Merging i18n fixes from @smeinecke. Thanks!

Notes for follow-up (will fix in v2.0.27):
- `toggleBtn.title = zhMode ? 'Switch to English' : '切换到中文'` introduces a hardcoded Chinese string that fails `node src/dashboard/check-i18n.js`. Will replace with `data-i18n-title` attribute pattern.
- The `error.${err.message}` lookup pattern is duplicated across 6 sites — will centralize into an `App.translateError(code, fallback)` helper next pass.
- Will also clean up the `action.revealKey` pre-existing miss while there.
dwgx added a commit that referenced this pull request Jun 4, 2026
- check-i18n.js: bare identifier 不再误报缺失 key (errKey/errCode/etc)
- 补 action.revealKey 翻译(v2.0.26 之前就缺,hardcoded fallback 已去)
- 新增 footer.langToggleTo{En,Zh} 给 PR #89 引入的 toggleBtn.title 用,去掉硬编码 '切换到中文'
- 全部 i18n 检查 + 311/311 tests pass
dwgx added a commit that referenced this pull request Jun 4, 2026
Merging i18n fixes from @smeinecke. Thanks!

Notes for follow-up (will fix in v2.0.27):
- `toggleBtn.title = zhMode ? 'Switch to English' : '切换到中文'` introduces a hardcoded Chinese string that fails `node src/dashboard/check-i18n.js`. Will replace with `data-i18n-title` attribute pattern.
- The `error.${err.message}` lookup pattern is duplicated across 6 sites — will centralize into an `App.translateError(code, fallback)` helper next pass.
- Will also clean up the `action.revealKey` pre-existing miss while there.
dwgx added a commit that referenced this pull request Jun 4, 2026
- check-i18n.js: bare identifier 不再误报缺失 key (errKey/errCode/etc)
- 补 action.revealKey 翻译(v2.0.26 之前就缺,hardcoded fallback 已去)
- 新增 footer.langToggleTo{En,Zh} 给 PR #89 引入的 toggleBtn.title 用,去掉硬编码 '切换到中文'
- 全部 i18n 检查 + 311/311 tests pass
dwgx added a commit that referenced this pull request Jun 4, 2026
Merging i18n fixes from @smeinecke. Thanks!

Notes for follow-up (will fix in v2.0.27):
- `toggleBtn.title = zhMode ? 'Switch to English' : '切换到中文'` introduces a hardcoded Chinese string that fails `node src/dashboard/check-i18n.js`. Will replace with `data-i18n-title` attribute pattern.
- The `error.${err.message}` lookup pattern is duplicated across 6 sites — will centralize into an `App.translateError(code, fallback)` helper next pass.
- Will also clean up the `action.revealKey` pre-existing miss while there.
dwgx added a commit that referenced this pull request Jun 4, 2026
- check-i18n.js: bare identifier 不再误报缺失 key (errKey/errCode/etc)
- 补 action.revealKey 翻译(v2.0.26 之前就缺,hardcoded fallback 已去)
- 新增 footer.langToggleTo{En,Zh} 给 PR #89 引入的 toggleBtn.title 用,去掉硬编码 '切换到中文'
- 全部 i18n 检查 + 311/311 tests pass
dwgx added a commit that referenced this pull request Jun 29, 2026
Backfill contributors who were merged but never added to the thanks
page, with weight tiers calibrated against existing entries:

- #64  baily-zhang (S)  — cascade transport canceled-session recovery
- #163 you922 (A)       — LS crash self-heal: exponential-backoff restart
- #204 lovivi (B+)      — glm-5.2 gpt_native tool dialect fix
- #90  smeinecke (B+)   — inline proxy on add-account form
- #88  smeinecke (B+)   — ALLOW_PRIVATE_PROXY_HOSTS opt-in for local proxy
- #89  smeinecke (B)    — login-flow i18n + error-code standardization

Synced src -> docs via sync:contributors. Also gitignore .workflow-results/
(local audit artifacts, not source). dashboard tests 17/17.
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