Skip to content

fix(i18n): localize remote server pairing, host sign-in and Bitbucket connect failures - #35843

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

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

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​132 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​129
Prod 41 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​892 $\color{#cf222e}{\Huge{\mathbf{−}}}$​193 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​699

Summary

Localizes Orca-authored failure sentences that main/shared code sent to the renderer as English: Remote Orca Server pairing save refusals, host account sign-in failures reported to another device, Bitbucket credential connect failures, and the Bitbucket / Azure DevOps / Gitea "base branch, head branch, and title are required" Create PR validation.

What Changed

  • Remote Orca Servers pairing (src/shared/remote-server-pairing-failure-copy.ts): one English table for the store guards (runtime-environment-pairing-replace-guards.ts, runtime-environment-store.ts, runtime-environment-store-file.ts). RuntimeEnvironmentStoreError gains an optional pairingFailure (errorCode + errorParams.name). The verify-and-add / re-pair IPC results (RemotePairingFailure) carry optional errorCode/errorParams. Each "already paired as X" + guard combination has its own whole-sentence template, so nothing is concatenated. The renderer (remote-server-pairing-error-copy.ts) translates known codes in Settings > Remote Orca Servers, the re-pair dialog and the sidebar Add Remote Host dialog.
  • Host account sign-in (host-account-sign-in-types.ts): HostAccountSignInStatus.errorCode (optional) marks the two failures Orca names itself (ownerSilent, superseded). The login's own error text stays uncoded and verbatim. The renderer client translates them, plus its own "Sign-in failed. Try again." fallback.
  • Bitbucket connect (bitbucket-credentials.ts): BitbucketConnectResult failures carry optional errorCode. The renderer dialog translates it.
  • Hosted review create: new CreateHostedReviewFailureReason base_head_title_required on the existing reason model, mapped in hosted-review-create-failure-copy.ts. The sign-in hint helpers moved verbatim to hosted-review-sign-in-copy.ts so that file stays under the 300-line lint cap.
  • en + de, es, fr, ja, ko, pt, ru, tr, zh, zh-Hant catalog entries.

Wire changes are additive and optional. error/message English is byte-identical. Codes are plain strings that the client narrows with Object.hasOwn, and uncoded (older host), unknown (newer host) or param-incomplete results show the English text. Everything touched here is Electron IPC or an RPC result object. None of it goes through a .strict() schema.

Why

These sentences reached the UI in English for non-English users.

Left as-is on purpose:

  • Errors thrown over runtime RPC stay English, since RPC strips extra error fields: host-account-sign-in-flows.ts start/submitCode/not-active, accounts.ts / antigravity-accounts.ts "cannot add accounts/sign in", and runtime-account-controller.ts services-not-configured.
  • runtime_error store read/write failures with file paths, which only surface as thrown errors.
  • git-remote-error.ts and git-clone-failure-message.ts: every caller throws (push/pull/fetch over IPC and runtime RPC, clone over IPC and RPC), so a code cannot reach the client. The display layer is the renderer's source-control-remote-error.ts, which is itself still English and re-classifies the English text. Localizing that belongs in a renderer change.
  • AI text-generation agent output failures are in a separate PR.

Linked Issue

Refs #32207

Visual Proof

N/A — copy/i18n only.

Testing

  • pnpm tc passed
  • pnpm test on the touched areas (host sign-in flows/client, bitbucket, azure-devops, gitea, github, gitlab, runtime-environment store tests, settings components, runtime-environments IPC, new copy tests) passed
  • pnpm sync:localization-runtime-catalog plus all five verify:localization-* checks passed
  • pnpm check:code-quality:changed passed
  • pnpm check:changed --maxWorkers=2 passed everything except two steps. The changed-code quality step had one switch-exhaustiveness finding, now fixed and re-checked. The full unit-test step did not finish within 25 minutes on the loaded host, so CI is the gate for it.
  • Codex review of the diff. Its one note was that the new base_head_title_required detail is composed into "Create PR failed: {{detail}}". That is the same structure every existing hosted-review reason uses, so it was left consistent with them.

@OrcaWin
OrcaWin requested a review from brennanb2025 as a code owner October 29, 2026 08:27
@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; the previous type mismatch is fixed.

Summary

Localizes pairing, host sign-in, Bitbucket connect, and missing-field Create PR errors while keeping English fallback text.

  • Remote server pairing failures can appear in the language you use.
  • Host sign-in failures can appear in the language you use.
  • Bitbucket credential failures can appear in the language you use.
  • Missing pull-request fields can appear in the language you use.

Reviews (2) · Last reviewed commit: "fix(i18n): type the Bitbucket connect br..." · Reviewed by Greptile

Comment thread src/shared/bitbucket-credentials.ts Resolved
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent 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: ed648026-586f-485c-be61-ca6b20d45c70
Commits

Reviewing files that changed from the base of the PR and between e40e6ab and af62bb6.

Files selected for processing: 2
  • src/preload/api/bitbucket-bridge.ts
  • src/preload/api/hosted-review-api.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Walkthrough

The changes add structured failure codes and localized error copy for hosted review validation, Bitbucket connections, host account sign-in, and remote-server pairing. Pairing failures retain codes and optional parameters across store, IPC, and renderer paths. Tests cover translation and fallback behavior for several failure types.

Priority: Low

Merge Risk: Minimal · up to af62b

The inspected failure paths preserve structured codes and intended English fallbacks, with no merge-blocking risk established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 41.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely summarizes the main change: localization for remote server pairing, host sign-in, and Bitbucket connection failures.
Description check Passed The description is mostly complete. It explains the user impact, implementation, rationale, scope, issue reference, visual proof status, and testing results. Some template sections, including ELI5, Re…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is mostly complete. It explains the user impact, implementation, rationale, scope, issue reference, visual proof status, and testing results. Some template sections, including ELI5, Review, Notes, and Checklist, are not explicitly completed, but the description remains clear and relevant.

Full details: Docstring Coverage

Explanation

Docstring coverage is 41.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 29 functions across 35 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • 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.

@OrcaWin
OrcaWin merged commit e610139 into main Oct 29, 2026
57 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