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

* fix(i18n): localize GitHub project view errors and states

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

* test: expect input_too_large reason on oversized project refs

* fix: make project view error copy switches exhaustive

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
OrcaWin
2026-10-27 17:11:45 -07:00
committed by GitHub
co-authored by OrcaWin
parent eb7448b260
commit 99199b2bd2
30 changed files with 919 additions and 114 deletions
+33
View File
@@ -22,9 +22,42 @@ export type GitHubProjectViewErrorType =
| 'rate_limited'
| 'unknown'
/** Distinguishes Orca-authored sentences that share one `type`; renderers fall back to `message` for unknown or missing reasons. */
export type GitHubProjectViewErrorReason =
| 'project_or_view_not_found'
| 'project_not_found'
| 'view_not_found'
| 'owner_not_found'
| 'item_not_found'
| 'issue_not_found'
| 'input_required'
| 'input_too_large'
| 'input_unparseable'
| 'invalid_slug'
| 'invalid_positive_integer'
| 'invalid_owner_type'
| 'invalid_item_type'
| 'missing_ids'
| 'updates_required'
| 'comment_body_required'
| 'duplicate_target_not_allowed'
| 'duplicate_target_required'
| 'request_invalid'
| 'request_failed'
| 'unexpected_rest_response'
export type GitHubProjectViewError = {
type: GitHubProjectViewErrorType
/** English copy kept for mobile, older clients and logs. */
message: string
reason?: GitHubProjectViewErrorReason
/** GitHub host for sign-in commands. */
host?: string
rateLimit?: { remaining: number; limit: number; resetMinutes: number }
/** Untranslated diagnostic or field name that follows Orca's own prefix. */
detail?: string
/** Rejected slug value for `invalid_slug`. */
value?: string
/** Classified GraphQL details only; never include tokens or full command stdout. */
details?: { path?: (string | number)[]; code?: string }
}