Skip to content

fix(i18n): code WSL host status details and Add refusals - #35664

Merged
OrcaWin merged 3 commits into
mainfrom
OrcaWin/i18n-main-codes-8
Oct 29, 2026
Merged

OrcaWin merged 3 commits into
mainfrom
OrcaWin/i18n-main-codes-8

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​138 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​135
Prod 32 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​621 $\color{#cf222e}{\Huge{\mathbf{−}}}$​80 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​541

Summary

Main sent WSL host status details and Add refusals to the renderer as English text, and showed the "can't verify" reasons as raw ids (guest-unanswered). They now carry optional codes and the renderer translates them, using one shared English table.

What Changed

  • New src/shared/wsl-host-failure-copy.ts holds the English templates. Producers build the English wire text from it, so the text is unchanged, and they add errorCode/errorParams (Add result), detailCode/detailParams (WslHostStatus) or reasonCode/reasonParams (WslHostServerStop, persisted pendingStop).
  • Add refusals are coded: turned off, paused in this build, server files missing, already added, distro stopped, WSL 1 (from admission and from connect), not registered (from admission and from connect), and shared with an SSH server. Commands such as wsl --set-version <distro> 2 and wsl --list --verbose go into placeholders and are never translated. Turned off, paused and server files missing reuse the existing wsl-host-row-status keys.
  • Status details are coded: the three unverifiable reasons (now real sentences instead of raw ids), the restart give-up (plural), and the Remove stop reasons that are a single sentence (service unconfirmed, peer check failed, removal unrecorded). Verbatim error text goes only into a {{detail}} slot.
  • The renderer's wsl-host-failure-text.ts narrows codes with Object.hasOwn and checks param types. Unknown codes, missing codes and bad params fall back to main's English. It is used by AddWslHostDialogBody, the WslHostsSection row detail and the Remove toasts.
  • New keys are in all 11 catalogs.

Why

Non-English users saw English sentences, and raw reason ids, next to translated labels.

Linked Issue

Refs #32207

Visual Proof

N/A — copy/i18n only

Testing

  • pnpm tc:node, pnpm tc:web: pass
  • pnpm test src/main/wsl src/main/ipc/wsl-host: pass. New tests: wsl-host-failure-text.test.ts (es translation, plural, fallbacks), wsl-host-first-connect.test.ts (English unchanged and code carried), and a wsl-host-connection-record case (unverifiable sentence and code; verbatim errors stay uncoded).
  • pnpm verify:localization-catalogs/catalog/extraction/coverage/runtime-catalog: pass
  • pnpm check:changed --maxWorkers=2: lint and format pass; the unit-test phase did not finish on the loaded machine (load ~78), so CI is the gate.

@OrcaWin
OrcaWin requested a review from brennanb2025 as a code owner October 29, 2026 04:27
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 29 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4e3ff4ae-8c65-400e-a7a4-ffd53a0099d5
Commits

Reviewing files that changed from the base of the PR and between d334119 and 5620ad3.

Files selected for processing: 36
  • src/main/ipc/wsl-host-handlers.ts
  • src/main/wsl/wsl-distro-unsupported.ts
  • src/main/wsl/wsl-host-add-admission.ts
  • src/main/wsl/wsl-host-connection-record.test.ts
  • src/main/wsl/wsl-host-connection-record.ts
  • src/main/wsl/wsl-host-connector.ts
  • src/main/wsl/wsl-host-first-connect.test.ts
  • src/main/wsl/wsl-host-first-connect.ts
  • src/main/wsl/wsl-host-gate.ts
  • src/main/wsl/wsl-host-registration.ts
  • src/main/wsl/wsl-host-removal.ts
  • src/main/wsl/wsl-host-server-stop.ts
  • src/main/wsl/wsl-host-service.test.ts
  • src/main/wsl/wsl-host-ssh-orcad-conflict.ts
  • src/main/wsl/wsl-orcad-connection-status.ts
  • src/main/wsl/wsl-orcad-liveness-recovery.ts
  • src/renderer/src/components/settings/WslHostsSection.tsx
  • src/renderer/src/components/sidebar/AddWslHostDialogBody.tsx
  • src/renderer/src/components/sidebar/wsl-host-failure-text.test.ts
  • src/renderer/src/components/sidebar/wsl-host-failure-text.ts
  • src/renderer/src/components/sidebar/wsl-host-removal.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/wsl-host-deployment-store.ts
  • src/shared/wsl-host-failure-copy.ts
  • src/shared/wsl-host-types.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

The PR adds translation codes to WSL host Add refusals, status details, and Remove warnings while keeping English text for older readers.

  • WSL host Add refusals carry codes the dialog can translate.
  • WSL host status and removal details show translated explanations.

No actionable issues were found.

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

@OrcaWin
OrcaWin merged commit 502413d into main Oct 29, 2026
62 of 63 checks passed
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.

1 participant