Skip to content

fix(i18n): translate browser cookie import failures by code - #35855

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/i18n-main-codes-22
Oct 29, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/i18n-main-codes-22

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​72 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​59
Prod 31 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​759 $\color{#cf222e}{\Huge{\mathbf{−}}}$​97 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​662

Summary

Cookie import refusals produced in main (file import, Chromium/Firefox/Safari import, session-profile and client-route checks) now carry a semantic reasonCode (plus reasonParams / reasonDetail when the sentence interpolates values), and the renderer shows them in the UI language. The English reason on the wire is byte-identical to before.

What Changed

  • src/shared/browser-cookie-import-failure-copy.ts: one English table + browserCookieImportFailure(code, params, detail) that builds the legacy English reason and the additive optional reasonCode / reasonParams / reasonDetail. BrowserCookieImportResult's failure branch uses this type (additive only).
  • Producers converted: browser-cookie-import-pipeline.ts (file import), chromium/import-cookies.ts, chromium/prepare-import.ts (browser label is a param), sources/browser-cookie-firefox-import.ts, sources/browser-cookie-safari-import.ts, ipc/browser-session-profile-ipc.ts, runtime/browser/browser-profiles.ts (runtime RPC path), browser-client-route-cookie-import.ts. The verbatim SQLite error summary goes in reasonDetail; the diag log path is a param. The now-unused reasonWithDiagLog is removed.
  • Renderer lib/browser-cookie-import-error-copy.ts: browserCookieImportFailureText(result) narrows with Object.hasOwn, checks each code's params, and falls back to the English reason for unknown codes, missing params, or old hosts. It is used by the four import toasts (browser toolbar menu, import hint button, settings profile row, browser-use setup step) and by the store's import error state.
  • use-browser-page-resource-notices.ts: the cookie import success/failure banner wrapping that text is now translated (whole sentences, count plural).
  • New keys under browser.cookieImport.* in all 11 catalogs.

Left as is: 'canceled' (a sentinel, never shown), and the "This Orca client cannot report cookies skipped…" refusal (only older clients receive it, and they cannot read codes).

Why

Issue #32207: main-produced English was shown verbatim in non-English UIs.

Linked Issue

Refs #32207

Visual Proof

N/A, copy/i18n only.

Testing

  • pnpm tc passed
  • pnpm test on src/main/browser/** cookie tests, browser-client-route-cookie-import, browser-google-cookie-clear-target, the new browser-cookie-import-error-copy.test.ts, and the renderer browser store/settings/browser-pane tests: all passed (existing tests that compared the whole failure object with toEqual now use toMatchObject, so they still pin the English reason)
  • pnpm sync:localization-runtime-catalog, verify:localization-catalogs, verify:localization-catalog, verify:localization-extraction, verify:localization-coverage, verify:localization-runtime-catalog: passed
  • oxlint on changed files: clean; pnpm format: applied
  • pnpm check:changed --maxWorkers=2 did not finish within 20 minutes on this loaded machine (its Electron-hosted suites time out locally), so CI is the gate

@OrcaWin
OrcaWin requested a review from brennanb2025 as a code owner October 29, 2026 08:43
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge; no actionable issues were found.

Summary

Cookie import failures now carry message codes so the renderer can show translated text while keeping the existing English reason for older clients.

  • Cookie import failures carry codes alongside their English reasons.
  • Import refusals show translated messages in the renderer.
  • Browser-page import banners use translated sentences and cookie-count plurals.

OrcaWin explicitly left canceled unchanged because it is not displayed. OrcaWin also left the older-client partition-reporting refusal unchanged because those clients cannot read message codes.

Reviews (1) · Last reviewed commit: "fix(i18n): translate browser cookie impo..." · Reviewed by Greptile

@OrcaWin
OrcaWin merged commit 5d1c688 into main Oct 29, 2026
48 of 49 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