Repository navigation
fix(i18n): translate updater failure messages shown in the renderer - #35833
Conversation
[Medium impact] The PR appears safe to merge, with one remaining non-blocking language-switch issue. Findings
SummaryAdds translation codes to updater failures while keeping English messages for older clients.
Reviews (2) · Last reviewed commit: "fix(i18n): sync runtime catalog and code..." · Reviewed by Greptile |
| if (isCurrentRecovery()) { | ||
| setCommandUnavailable(true) | ||
| setActionError(instructions.message) | ||
| setActionError(linuxPackageCommandUnavailableText(instructions)) |
There was a problem hiding this comment.
Recovery error keeps old language
This call saves an already translated string in actionError. After a no-sudo or no-package-manager error, changing the UI language updates the card’s other text but leaves this error in the previous language. Store the failed instructions or their reason, then call linuxPackageCommandUnavailableText during render, as the build picker does for its errors.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
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:
f1dea558-2578-4e6f-a20c-c186be56fc2f
Files selected for processing: 40-
src/main/linux-package-downloaded-status.tssrc/main/updater-events.test.tssrc/main/updater-linux-package-recovery-actions.test.tssrc/main/updater-release-builds.test.tssrc/main/updater-release-builds.tssrc/main/updater.build-channel-selection.test.tssrc/main/updater.check-failure.test.tssrc/main/updater.prerelease-fallback.test.tssrc/main/updater.publishing-window-feed.test.tssrc/main/updater/updater-build-selection.tssrc/main/updater/updater-check-failure.tssrc/main/updater/updater-check-state.tssrc/main/updater/updater-coded-error.tssrc/main/updater/updater-download-install.tssrc/main/updater/updater-install-execution.tssrc/main/updater/updater-package-recovery.tssrc/main/window/main-window-updater.tssrc/renderer/src/components/LinuxPackageInstallRecoveryCard.test.tsxsrc/renderer/src/components/LinuxPackageInstallRecoveryCard.tsxsrc/renderer/src/components/UpdateCard.tsxsrc/renderer/src/components/maintenance/update-card/update-card-error-model.tssrc/renderer/src/components/settings/GeneralUpdateSettingsSection.tsxsrc/renderer/src/components/settings/ReleaseChannelSection.tsxsrc/renderer/src/i18n/en-runtime-required.jsonsrc/renderer/src/i18n/locales/de.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/pt.jsonsrc/renderer/src/i18n/locales/ru.jsonsrc/renderer/src/i18n/locales/tr.jsonsrc/renderer/src/i18n/locales/zh-Hant.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/updater-message-copy.test.tssrc/renderer/src/lib/updater-message-copy.tssrc/renderer/src/runtime/remote-server-updater-polling.tssrc/shared/update-status-types.tssrc/shared/updater-failure-copy.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
| }, | ||
| "updates": { | ||
| "failure": { | ||
| "channelUnsupportedPlatform": "{{channel}} builds are produced only for {{platforms}}.", |
There was a problem hiding this comment.
Match the English boot message to the formatter.
channelUnsupportedPlatform receives channel, but this resource also requires platforms. An English renderer uses this boot resource, so an unsupported-channel error cannot display the complete platform list. The value also disagrees with locales/en.json, which makes verify:localization-runtime-catalog fail. Replace {{platforms}} with macOS and Windows. (raw.githubusercontent.com)
Summary
Updater failures that main sends to the renderer now carry a translation code. The update card, Settings → Updates, the Linux package recovery card and the release-channel build picker show them in the UI language.
What Changed
src/shared/updater-failure-copy.tsholds one English table.updaterCodedMessage(code, params)builds the existing Englishmessage(byte-identical) and addsmessageCode/messageParams.messageCode?/messageParams?on theUpdateStatuserror variant and onReleaseBuildListResult{ ok: false }.message.releaseNotReady,updateServerUnreachable).channelUnsupportedPlatform,unsignedDevChannel). The channel label is a param.LinuxPackageRecoveryUnavailableReason.UpdaterCodedError. Main catches them itself: theupdater:listBuildshandler and the pinned-build catch copy the code onto the IPC result or status.sendErrorStatus/sendSettledCheckStatuskeep the code instead of rebuilding the status frommessageonly.src/renderer/src/lib/updater-message-copy.ts.Object.hasOwnand checks param types, and falls back to the Englishmessage. It is used by the update card error model,UpdateCard,GeneralUpdateSettingsSectionandReleaseChannelSection.ReleaseChannelSectionnow stores the coded result instead of a string, so it re-translates on render.{ ok: false }result already hasreason, so the Linux recovery card mapsno-sudo/no-package-managerfrom it.updates.failure.*in all 10 locales.Left as is:
failLinuxPackageRecoverystill throwsError(message)to the invoke caller. The card shows that text forread-failed/invalid-package-path, and Electron invoke keeps only the message, so those two stay English unless the IPC returns a result object instead of throwing.Why
Main built these updater sentences in English and the renderer showed
status.messageverbatim, so they ignored the UI language.Linked Issue
Refs #32207
Visual Proof
N/A — copy/i18n only.
Testing
pnpm sync:localization-runtime-catalog,pnpm sync:localization-catalog(filled the es/fr/pt_manyforms),verify:localization-catalogs,verify:localization-catalog,verify:localization-extraction,verify:localization-coverage,verify:localization-runtime-catalog: passpnpm tc: passpnpm teston the updater main tests (updater-release-builds,updater-events,updater.check-failure,updater.prerelease-fallback,updater.publishing-window-feed,updater.build-channel-selection,updater-linux-package-recovery-actions, …),LinuxPackageInstallRecoveryCard,UpdateCard.error-card,remote-server-update-coordinator, and the newupdater-message-copy.test.ts(es text for known codes, English for older hosts, unknown codes and missing params): passmessageCode. The release-builds test asserts the thrown error carries its code and params.errorMessage). The thrown recovery error is left as described above.