Repository navigation
fix(i18n): code WSL host status details and Add refusals - #35664
Conversation
|
Warning Review limit reachedYou'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. View limit details
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. Comment |
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryThe PR adds translation codes to WSL host Add refusals, status details, and Remove warnings while keeping English text for older readers.
No actionable issues were found. Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
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
src/shared/wsl-host-failure-copy.tsholds the English templates. Producers build the English wire text from it, so the text is unchanged, and they adderrorCode/errorParams(Add result),detailCode/detailParams(WslHostStatus) orreasonCode/reasonParams(WslHostServerStop, persistedpendingStop).wsl --set-version <distro> 2andwsl --list --verbosego into placeholders and are never translated. Turned off, paused and server files missing reuse the existingwsl-host-row-statuskeys.{{detail}}slot.wsl-host-failure-text.tsnarrows codes withObject.hasOwnand checks param types. Unknown codes, missing codes and bad params fall back to main's English. It is used byAddWslHostDialogBody, theWslHostsSectionrow detail and the Remove toasts.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: passpnpm 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 awsl-host-connection-recordcase (unverifiable sentence and code; verbatim errors stay uncoded).pnpm verify:localization-catalogs/catalog/extraction/coverage/runtime-catalog: passpnpm 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.