Skip to content

fix(i18n): localize GitHub project view errors and states - #34621

Merged
OrcaWin merged 3 commits into
mainfrom
OrcaWin/i18n-github-project-34589
Oct 28, 2026
Merged

OrcaWin merged 3 commits into
mainfrom
OrcaWin/i18n-github-project-34589

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1
Prod 29 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​917 $\color{#cf222e}{\Huge{\mathbf{−}}}$​113 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​804

What was wrong

The GitHub project view (Tasks page with a GitHub project source) showed its errors and several states in English in every UI language. Main returned English messages that the renderer displayed as-is, and some renderer copy (layout names, unsupported/not-found/too-large states, picker summaries, gh sign-in help) never went through translate.

What changed

Same pattern as #33368:

  • GitHubProjectViewError gains optional reason, host, rateLimit, detail and value. Main sets them on Orca-authored failures. message is unchanged for mobile, older clients and logs.
  • New renderer project-view-error-copy.ts maps reason, then type, to translated copy, with message as the last fallback. Hosts that send no reason still get the type-identified sentences (auth/scope with the surface host, rate limit, network, too large, unsupported layout, schema drift) translated. GitHub's own error text stays untranslated.
  • Used in the error state, picker banner and paste errors, item dialog, comment and row-mutation toasts, and the gh auth help (whose summary/detail sentences are now all wrapped).
  • Wraps the layout labels, the unsupported-layout sentence, picker partial-failure summaries and the paste hint.
  • en plus zh/ko/ja/es/fr/pt translations for the new projectViews.* keys.

Closes #34589

Main now tags Orca-authored project-view failures with an optional
reason code plus host, rate-limit numbers and diagnostic detail; the
English message is unchanged for mobile, older clients and logs. The
renderer maps type/reason to translated copy in the error state, picker,
item dialog and mutation toasts, falling back to the English message for
older hosts and GitHub's own text. Also wraps the layout labels,
unsupported-layout, not-found/too-large copy, picker partial-failure
summaries and the gh sign-in help.

Closes #34589
@OrcaWin
OrcaWin requested a review from brennanb2025 as a code owner October 27, 2026 23:42
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

Project-view errors now include structured reason codes and optional context, such as the GitHub host, rate-limit values, and diagnostic details. Renderer components use a shared formatter to select localized error copy by reason or error type, with the original message as a fallback. Translations for project-view errors, picker states, authentication guidance, and layout labels are added across seven locales. Existing error types, messages, and validation conditions remain in place.

Priority: Normal

Severity of issue fixed: Low

Merge Risk: Low · up to 296d6

Some project-view errors still appear in English when another UI language is selected. These bounded localization gaps can be fixed before merge or accepted for follow-up.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description follows the template's main sections: What changed, Why (as "What was wrong" and "What changed"), and a Closes #34589 link. It explains the mechanism, the fallback behavior for hosts w… Add an ELI5 section in plain language. Add a Visual Proof section with before and after screenshots or a video of the translated project view, picker, and gh auth help in a non-English locale. Fill in the Testing section with the steps take…
Docstring Coverage Warning Docstring coverage is 13.89% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… 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 "fix(i18n): localize GitHub project view errors and states" matches the main change. The changeset adds reason, host, and detail metadata to project-view errors, adds a renderer error-copy m…
Linked Issues check Passed [#34589] The PR adds structured error metadata while preserving the English message. The renderer maps reason first, then type, and falls back to message. The mapping covers authentication, sc…
Out of Scope Changes check Passed The changes stay within [#34589]. Main-process metadata supports renderer localization. Renderer changes replace raw English project-view copy with localized copy. Locale updates, the shared error typ…
Full details: Title check

Explanation

The title "fix(i18n): localize GitHub project view errors and states" matches the main change. The changeset adds reason, host, and detail metadata to project-view errors, adds a renderer error-copy mapper, and translates layout labels, unsupported-layout text, picker summaries, and gh auth help across the locale files. The title is short, specific, and uses a conventional commit prefix.

Full details: Linked Issues check

Explanation

[#34589] The PR adds structured error metadata while preserving the English message. The renderer maps reason first, then type, and falls back to message. The mapping covers authentication, scope, rate limits, network errors, size limits, unsupported layouts, schema drift, picker errors, and mutation errors. The affected UI paths use the mapper or translated keys. The six requested locales contain projectViews.* translations. The updated test verifies the new oversized-input reason and secret-safe message behavior.

Full details: Out of Scope Changes check

Explanation

The changes stay within [#34589]. Main-process metadata supports renderer localization. Renderer changes replace raw English project-view copy with localized copy. Locale updates, the shared error type, and the validation test directly support this behavior. No unrelated Linear, Jira, or feature work appears in the reviewed change summary.

Full details: Description check

Explanation

The description follows the template's main sections: What changed, Why (as "What was wrong" and "What changed"), and a Closes #34589 link. It explains the mechanism, the fallback behavior for hosts without a reason, and the locale coverage. It omits the ELI5 section, the Visual Proof section (required for UI changes, with no before and after attached), the Testing section (no manual or automated testing steps listed), the AI Disclosure, the Review and Agent skill boundary checks, and the Checklist. The linked issue uses "Closes" rather than the template's "Fixes #" form, which is acceptable.

Resolution

Add an ELI5 section in plain language. Add a Visual Proof section with before and after screenshots or a video of the translated project view, picker, and gh auth help in a non-English locale. Fill in the Testing section with the steps taken and the platforms tested, and check the manual testing box or explain why automated tests were not added. Complete the template checklist, and state the AI Disclosure if AI tools were used. Mark the agent skill upstream boundary item.

Full details: Docstring Coverage

Explanation

Docstring coverage is 13.89% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 36 functions across 23 files. (7 skipped: 7 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Localize the paste error when the input changes. · ProjectPicker.tsx:290

src/renderer/src/components/github-project/ProjectPicker.tsx:290
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Localize the paste error when the input changes.

When a user pastes an oversized reference, ProjectPickerBrowse.tsx passes the English size-limit message to onPasteInputChange. It also disables Add. This handler stores that English message directly, so the new localized handlePaste branch does not run during the normal paste flow. Format the size-limit error here, or format it before ProjectPickerBrowse.tsx passes it to the handler. (raw.githubusercontent.com)


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: cb7fa1af-ca3e-4ff6-b69b-3dfbed903da7
Commits

Reviewing files that changed from the base of the PR and between acec0e7 and 296d621.

Files selected for processing: 30
  • src/main/github/project-view.test.ts
  • src/main/github/project-view/internals.ts
  • src/main/github/project-view/issue-comment-mutations.ts
  • src/main/github/project-view/issue-type-mutation.ts
  • src/main/github/project-view/mutations.ts
  • src/main/github/project-view/project-error-classification.ts
  • src/main/github/project-view/project-field-mutations.ts
  • src/main/github/project-view/project-view-config.ts
  • src/main/github/project-view/project-view-item-page.ts
  • src/main/github/project-view/project-view-listing.ts
  • src/main/github/project-view/project-view-reference.ts
  • src/main/github/project-view/project-view-table.ts
  • src/main/github/project-view/pull-request-mutation.ts
  • src/main/github/project-view/work-item-details.ts
  • src/renderer/src/components/github-project/GhAuthErrorHelp.tsx
  • src/renderer/src/components/github-project/ProjectPicker.tsx
  • src/renderer/src/components/github-project/ProjectPickerPanels.tsx
  • src/renderer/src/components/github-project/ProjectViewStates.tsx
  • src/renderer/src/components/github-project/project-view-error-copy.ts
  • src/renderer/src/components/github-project/slug-dialog/Comments.tsx
  • src/renderer/src/components/github-project/slug-dialog/SlugDialogBody.tsx
  • src/renderer/src/components/github-project/useProjectRowMutations.ts
  • 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/zh.json
  • src/shared/github/project-result-types.ts

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

: await window.api.gh.deleteIssueCommentBySlug(args)
if (!res.ok) {
toast.error(res.error.message)
toast.error(projectViewErrorMessage(res.error))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Pass the project host to dialog error formatting.

If an older host returns auth_required or scope_missing without error.host, these calls omit the available host. projectViewErrorMessage then returns the English message instead of localized guidance. Pass { host } in all three calls. Apply the same correction to the formatter calls in SlugDialogBody.tsx, which also has the project host. (raw.githubusercontent.com)

Also applies to: 95-95, 239-239

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.

[Bug]: GitHub project view errors and states show in English in every UI language

1 participant