Skip to content

fix(desktop): localize the native file and save dialog titles - #5179

Merged
Astro-Han merged 1 commit into
apache:mainfrom
orangeCatDeveloper:fix/native-file-dialog-copy
Sep 12, 2026
Merged

Astro-Han merged 1 commit into
apache:mainfrom
orangeCatDeveloper:fix/native-file-dialog-copy

Conversation

@orangeCatDeveloper

Copy link
Copy Markdown
Contributor

Summary

The native open and save panels carried English titles in every locale. A zh user picking a reference folder, adding attachments, importing a Skill or a pet, or saving a conversation read the one English string on an otherwise translated screen. All Files was the worst of the set: the file-type dropdown lists it directly beside the OS's own localized entries, so the panel reads half-translated.

Seven strings move into native-file-dialog-copy.ts, a typed UiCatalog beside the existing project-picker-copy.ts. Two call sites (markdown-save-ipc-main.ts, pet-pack-import.ts) and runtime-host-skills-ipc-main.ts gain a resolveLocale dependency, the form createPermissionOverlayMain already uses; the lower-level markdown-save-main.ts still takes a plain string, so nothing below the IPC boundary starts depending on a catalog.

Format names stay in English on purpose: Markdown, Skill Markdown and PNG and JPEG identify a file format, not a product concept, and translating them would add noise rather than clarity.

This also deletes runtime-host-boot-copy.ts — 90 lines of trilingual catalog whose only importer was its own test. The live copy for that surface is native-diagnostic-dialog-copy.ts.

Refs #2672

Verification

apps/desktop full dist suite        2463 pass / 5 fail
apps/desktop typecheck (4)          0 errors
check-locale-hygiene                passed
npm run format:check                clean

The five failures are browser-message-box, red on the unmodified base (7 tests, 5 fail), unrelated to this diff.

The new test asserts every key differs from its English value and carries Han text in both Chinese locales, so a forgotten translation fails rather than silently shipping English.

Review focus

dialog.title is honoured on Windows and Linux; macOS does not render it on the native panel. The change is still correct there — All Files appears in the file-type dropdown on all three platforms — but a macOS screenshot would not show the titles.

main.ts's showErrorBox('Maka Dev', …) is deliberately untouched: it is the catch-path fallback for a development-only single-instance dialog whose main path already resolves the system locale through DEV_SINGLETON_COPY.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code — located the untranslated sites, wrote the catalog and the locale plumbing, the test, and this description. The zh-CN/zh-TW wording and the decision to leave format names in English were the contributor's. The commit carries a Generated-by: Claude Code trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — six dialog titles and the All Files filter label now follow the Desktop locale
  • No

The open and save panels carried English titles in every locale, so a zh
user picking a reference folder or saving a conversation read the one
English string on an otherwise translated screen. `All Files` was the
worst of them: the panel lists it beside the OS's own localized entries.

Format names (`Markdown`, `Skill Markdown`, `PNG and JPEG`) stay in
English — they identify a file format rather than a product concept.

Deletes runtime-host-boot-copy.ts, whose only importer was its own test.

Generated-by: Claude Code
@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 11, 2026
@orangeCatDeveloper
orangeCatDeveloper marked this pull request as ready for review September 11, 2026 04:55

@me2seeks me2seeks 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.

PR 5179 Review

结论

APPROVE
七个 native 对话框标题/过滤器名移入带类型的 nativeFileDialogCopy 目录,三个 register 函数获得与 createPermissionOverlayMain 同形的 resolveLocale 依赖;删除的 runtime-host-boot-copy.ts 确无生产引用。

@Astro-Han
Astro-Han merged commit c1d5025 into apache:main Sep 12, 2026
3 checks passed
@orangeCatDeveloper
orangeCatDeveloper deleted the fix/native-file-dialog-copy branch September 12, 2026 19:00
Shouly pushed a commit to Shouly/maka that referenced this pull request Sep 13, 2026
Twelve upstream commits. Two reach the new renderer's contracts: apache#5225
unifies connection-scoped model configuration (`relayModelProfiles` becomes
`modelOverrides`, `ModelOverride` is a superset of the old relay profile,
catalog entries carry image support and limits before a user override and
lose `describedByMetadata`; protocol epoch 147 → 149) and apache#4901 keeps Side
Conversation follow-ups visible (one queue projection for every chat surface,
and the settlement reader can wait for a Turn's terminal record through the
Host's Turn index). Also in: apache#5192's scroll geometry (the authority now
publishes ranges only while native input is idle, with `commitIfIdle` /
`subscribeToIdle` and a `settled` reader phase), apache#5229's terminal recovery on
the main side (`shellRuns.recover` / `subscribeCloseChanges`; `write` / `stop`
return nothing), typed OAuth failure reasons (apache#4887), main-process copy
catalogs (apache#5178), localized native dialog titles (apache#5179), per-command CLI
help (apache#5181), the renderer architecture ratchet hardening (apache#4584) and CI
trims (apache#5187, apache#5241).

Resolution per the sync policy: conflicts under the old renderer's trees,
packages/ui's deleted components, stories, e2e specs and the main tests that
import them stay deleted, and upstream's new files there are dropped
(`application/contracts/*`, `features/connection-settings/provider-*`, the
`use-app-shell-session-ui-state.ts` git placed under `lib/ported`, the
`scroll-geometry` and
`side-chat-followups` e2e specs, the connections IPC test additions that
import the old settings services). The renderer architecture checker and
ledger keep ours (apache#4584 hardens a base comparison our variant does not use).
`workbar-layout.ts` / `workbar-tabs.ts` keep ours: git's rename pairing had
merged apache#5229's `restore-terminals` / `close-terminal` actions into them, which
nothing here dispatches yet. `runtime-host-quit-copy.ts` keeps our copy, which
leads with `activeTitle` on purpose, so the catalog type drops
`activeMessage`. Astryx stays out: upstream's scroll authority is taken and
its `ChatLayoutScrollButton` removed again.

Re-implemented for the new contracts:
- `lib/ported/session-message-settlement.ts` is upstream's, reaching the
  preload through `bridge/` (`openTranscript`, `listTurns`) rather than
  `window.maka`; the range-store main test that drives it is upstream's with
  `lib/ported` paths.
- `lib/ported/message-queue-projection.ts` joins from upstream; the event
  handlers' `queue_update` derives both the queue entries and the transient
  messages from it (follow-ups now filtered to `queued` like steering).
- `bridge/shell-runs.ts` returns nothing from `write` / `stop`.
- Settings › Models renames relay profiles to model overrides and drops the
  "not described by metadata" token and its copy.
- `packages/ui` `transcript-scroll-authority.tsx` is upstream's minus the
  Astryx button; `use-chat-scroll.ts` and `transcript-viewport-navigation.ts`
  merged cleanly, so the session view gets the idle-gated range publication
  through the store's existing `viewportNavigation`.

`TransientUserMessageProjection` gains `pendingSteering?` so the projection's
flag is a declared field. Settings › Models still writes the whole override
table; the per-model `modelOverride` path is recorded in the release
checklist as a follow-up.

The compatible-change declaration is unchanged this round.

Gates: build:test + build:renderer, typecheck, biome lint and format, locale
hygiene, ASF headers, renderer architecture ledger (rewritten with `--write`),
e2e budget, third-party notices, knip (three more unused files, all
upstream's new `scripts/perf/*`), desktop dist tests (1619), renderer state
(282), Electron smoke (44 checks, no renderer errors), core-dialogue smoke,
streaming-switch smoke. `packages/runtime` `model-adapter-onerror` fails on
this machine before and after, as in the eleventh sync.

Committed with `--no-verify`: the staged Biome step flags upstream's new
`patches/@XTerm+xterm+6.0.0.patch` (escape sequences Biome's stdin mode
cannot round-trip — the known false positive); the file is byte-identical to
upstream and the other hook steps (ASF headers, protocol epoch, whitespace)
were run by hand and pass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants