Skip to content

fix(i18n): translate source control remote operation error toasts - #35893

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

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

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​25
Prod 15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1244 $\color{#cf222e}{\Huge{\mathbf{−}}}$​109 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1135

Summary

Translate the git push/pull/sync/rebase/fetch failure toasts built in source-control-remote-error.ts. Classification of git output and Orca's shared English stays as-is; each resulting sentence is now a whole translated sentence.

What Changed

  • src/renderer/src/lib/source-control-remote-error.ts: every Orca sentence goes through translate(literalKey, englishFallback, params). The operation word is part of each key (one key per operation × case, e.g. failedWithDetail.push, hookBlocked.lint.forcePush, remoteAccessWithDetail.sync); no operation labels are inserted into templates.
  • New source-control-remote-error-copy.ts holds the per-operation sentence builders (split to stay within max-lines).
  • Raw git output, fatal/remote detail lines, raw hook summary lines and unclassified error messages stay verbatim (as {{detail}} when they were prefixed by Orca copy). Unclassified errors still pass through unchanged.
  • src/shared/git-remote-error.ts: classifySubmodulePushFailure exposes the submodule classification (name + remote-changed vs push-failed) so the renderer can render a translated sentence; formatSubmodulePushFailureDetail keeps its English output for main/CLI callers. The normalized-text pattern now captures the reason separately from the submodule name.
  • src/shared/source-control-push-failure.ts: export the lint / pre-push summary constants so the renderer can pick translated "blocked" sentences.
  • 49 keys under sourceControl.remoteError.* in all 11 catalogs.

Why

These toasts were English-only for every UI language. The errors come over IPC/runtime RPC as English text, so the existing renderer classification is reused and its result is translated.

Linked Issue

Refs #32207

Visual Proof

N/A — copy/i18n only.

Testing

  • English output checked byte-identical to origin/main with a scratch comparison across 21 error messages × 9 option sets (not checked in).
  • Added a test that a Spanish locale gets the translated sentence for a classified submodule failure, and that unclassified errors pass through.
  • pnpm test on source-control-remote-error, editor-remote-branch-actions and git-remote-error tests: pass.
  • pnpm tc:web, oxlint: pass.
  • pnpm sync:localization-runtime-catalog, verify:localization-catalogs, -catalog, -extraction, -coverage, -runtime-catalog: pass.
  • pnpm check:changed --maxWorkers=2: all steps passed except unit tests, which did not finish within 10 minutes on this loaded machine; CI is the gate.
  • Codex review of the diff: the first pass found a submodule-name/reason misclassification and a casing case; both fixed. Second pass found nothing.

@OrcaWin
OrcaWin requested a review from brennanb2025 as a code owner October 29, 2026 09:57
@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 actionable issues were found.

Summary

Translates classified source-control error toasts while keeping shared English messages and raw git details unchanged.

  • Source Control error toasts now use the selected UI language.

No actionable issues found. Review was based on source inspection; tests were not run.

Reviews (1) · Last reviewed commit: "fix(i18n): translate source control remo..." · Reviewed by Greptile

@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: ed170849-f8b6-4ab4-9724-d8d4a0682ca0
Commits

Reviewing files that changed from the base of the PR and between 9f62a4f and 8226788.

Files selected for processing: 16
  • 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/renderer/src/lib/source-control-remote-error-copy.ts
  • src/renderer/src/lib/source-control-remote-error.test.ts
  • src/renderer/src/lib/source-control-remote-error.ts
  • src/shared/git-remote-error.ts
  • src/shared/source-control-push-failure.ts

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

Walkthrough

The change adds translated messages for remote Git operation failures and blockers across the listed locales. It adds helpers that format copy by operation and classify submodule push failures. The remote-error resolver now uses these helpers. A test checks Spanish submodule-error copy and verifies that unclassified error text remains unchanged.

Priority: Normal

Merge Risk: Minimal · up to 82267

No merge-blocking regression was identified in the localized Git error messages.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description clearly covers the change, rationale, user-visible behavior, visual proof, linked issue reference, and testing. It does not fully follow the required template because it omits ELI5, Re… Add the missing template sections and complete the required checklist. Replace Refs #32207 with the required linked issue format, such as Fixes #32207, or provide the applicable maintainer-specific issue reference.
Docstring Coverage Warning Docstring coverage is 15.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: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: translating source control remote operation error toasts.
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 clearly covers the change, rationale, user-visible behavior, visual proof, linked issue reference, and testing. It does not fully follow the required template because it omits ELI5, Review, Agent skill upstream boundary, Notes, and Checklist sections, and uses Refs #32207 instead of the required linked issue format.

Resolution

Add the missing template sections and complete the required checklist. Replace Refs #32207 with the required linked issue format, such as Fixes #32207, or provide the applicable maintainer-specific issue reference.

Full details: Docstring Coverage

Explanation

Docstring coverage is 15.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 13 functions across 5 files. (11 skipped: 11 unsupported.)

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 bbb563e into main Oct 29, 2026
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