chore(desktop): move inline bilingual copy into catalogs - #4526
Draft
orangeCatDeveloper wants to merge 3 commits into
Draft
chore(desktop): move inline bilingual copy into catalogs#4526orangeCatDeveloper wants to merge 3 commits into
orangeCatDeveloper wants to merge 3 commits into
Conversation
orangeCatDeveloper
force-pushed
the
chore/locale-inline-catalogs
branch
4 times, most recently
from
September 3, 2026 08:50
82b4195 to
b02d78b
Compare
3 tasks
orangeCatDeveloper
force-pushed
the
chore/locale-inline-catalogs
branch
2 times, most recently
from
September 4, 2026 08:29
c9a6933 to
edeecb2
Compare
Typed locale catalogs are the mandated home for user-visible copy; inline locale ternaries scattered through components bypass that and make copy audits miss strings. This is the mechanical consolidation wave: zh and en strings are moved verbatim into UiCatalog-shaped tables with no behavior or string changes. Generated-by: Claude Code
The peer mesh member projection types state as a closed five-value union, so the routeState catalog's sixth key was new copy no locale could ever render. Its neighbour endpointKind does need an unknown fallback — that field is optional — which is likely where the extra key came from. Generated-by: Claude Code Claude-Session: https://claude.ai/code/session_01Tik4Vo8b7oXizLS3ZDFHRn
Drop the zh Object.fromEntries copy that defeated satisfies checking and reallocated identical entries; zh returns the base entries directly. Generated-by: Muse Spark
orangeCatDeveloper
force-pushed
the
chore/locale-inline-catalogs
branch
from
September 4, 2026 08:38
edeecb2 to
58d7392
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mechanical consolidation wave from the repo-wide locale sweep — one transform across 28 files, no behavior changes, every zh and en string byte-identical (verified by literal-multiset comparison): inline
locale === 'zh' ? … : …andlocale.startsWith('zh')copy selection moves into typedsatisfies UiCatalog<T>catalogs.New catalogs:
peer-mesh-copy.ts(~150 keys out of the 2137-line dialog),agent-graph-copy.ts,task-readiness-copy.ts(retargeted tofeatures/conversationafter main's refactor). Routed into existing catalogs: the transport-label ternaries inruntime-host-profiles-section.tsx,notifications-policy.ts(colocated main-process catalog),mcp-catalog.ts(en overlay restructured asUiCatalog, exported API unchanged).packages/core/redaction.tsgains a thingeneralizedErrorMessageForLocaledispatcher and every scatteredlocale === 'zh' ? generalizedErrorMessageChinese(…) : generalizedErrorMessage(…)pair (19 sites across desktop andpackages/ui) now calls it. One deliberate exception kept with a site comment:provider-add-form.tsxzh passthrough of raw validation detail.Follow-up in
2858de475: the first pass added arouteState.unknownentry (路径未知/Route unknown) that no locale could render —PeerMeshMemberProjection.stateis a closed five-value union — so it is removed and the byte-identical claim above holds as stated.Refs #2672
Verification
String fidelity verified by literal-multiset comparison across the whole file set (every zh/en string preserved verbatim); independent subagent review found no issues. Rebase note: main's new peer route-state vocabulary (
connecting/reachable/reconnecting/needs_repair) is synced intopeer-mesh-copy.tsverbatim.AI use
Select exactly one:
Tool(s) and scope: Claude Code — migration implementation and this description, under the contributor's direction. Each commit carries a
Generated-by: Claude Codetrailer.Checklist
No new tests: this is a mechanical copy relocation with no new behavior to exercise. String fidelity is verified by literal-multiset comparison rather than by a suite, and the existing tests over the touched modules (53 pass) keep covering their behavior.
Does this PR entail a change in behavior?