diff --git a/apps/desktop/src/main/runtime-host-quit-copy.ts b/apps/desktop/src/main/runtime-host-quit-copy.ts index 9b316e77a6..4fd7bb5839 100644 --- a/apps/desktop/src/main/runtime-host-quit-copy.ts +++ b/apps/desktop/src/main/runtime-host-quit-copy.ts @@ -17,7 +17,7 @@ * under the License. */ -import type { UiLocale } from '@maka/core/ui-locale'; +import type { UiCatalog, UiLocale } from '@maka/core/ui-locale'; import type { MessageBoxOptions } from 'electron'; export interface RuntimeHostQuitDialog { @@ -46,6 +46,14 @@ export function buildRuntimeHostActiveQuitDialog( }; } +interface RuntimeHostQuitCopy { + readonly activeTitle: string; + readonly activeMessage: string; + readonly activeDetail: string; + readonly stopAndQuit: string; + readonly keepRunning: string; +} + const COPY = { en: { activeTitle: 'Maka is still working', @@ -71,4 +79,4 @@ const COPY = { stopAndQuit: '停止工作並結束', keepRunning: '繼續執行 Maka', }, -} as const; +} satisfies UiCatalog; diff --git a/apps/desktop/src/main/runtime-host-wsl-handoff.ts b/apps/desktop/src/main/runtime-host-wsl-handoff.ts index e1847646ec..67cc4034b4 100644 --- a/apps/desktop/src/main/runtime-host-wsl-handoff.ts +++ b/apps/desktop/src/main/runtime-host-wsl-handoff.ts @@ -17,7 +17,7 @@ * under the License. */ -import type { UiLocale } from '@maka/core/ui-locale'; +import type { UiCatalog, UiLocale } from '@maka/core/ui-locale'; import type { EnvironmentRuntimeHostProfile, HostHandoffBlocker, HostHandoffPhase, RuntimeHostRemoteCompatibilityError } from '@maka/runtime-host/client'; import { compareProductReleaseVersions } from '@maka/runtime-host/operator'; import type { DesktopRuntimeHostManagedServiceBinding } from './runtime-host-managed-services.js'; @@ -110,6 +110,14 @@ export async function resolveDesktopWslHostHandoff( } +interface WslHandoffGuidance { + readonly client: string; + readonly binding: string; + readonly source: string; + readonly target: string; + readonly development: string; +} + const GUIDANCE = { en: { client: 'Update Desktop to a build compatible with this Host. The Host will not be downgraded.', @@ -132,4 +140,4 @@ const GUIDANCE = { target: '目前 Desktop 無法驗證合適的替換套件。請更新 Desktop,或透過開發環境明確管理選定的開發套件;現有 Host 會被保留。', development: '選定的開發構建', }, -} as const; +} satisfies UiCatalog; diff --git a/apps/desktop/src/main/startup-progress-window.ts b/apps/desktop/src/main/startup-progress-window.ts index 6bc3c2ac01..7c8bee4f16 100644 --- a/apps/desktop/src/main/startup-progress-window.ts +++ b/apps/desktop/src/main/startup-progress-window.ts @@ -19,7 +19,7 @@ import { randomUUID } from 'node:crypto'; import { MAKA_WORDMARK_PATH } from '@maka/core/maka-wordmark'; -import type { UiLocale } from '@maka/core/ui-locale'; +import type { UiCatalog, UiLocale } from '@maka/core/ui-locale'; import { formatHostHandoff, type HostHandoffView, type HostHandoffAction } from '@maka/runtime-host/client'; import type { BrowserWindow, BrowserWindowConstructorOptions } from 'electron'; @@ -28,6 +28,17 @@ export type StartupPhase = | 'checking' | 'staging' | 'retiring' | 'replacing' | 'restart' | 'attention' | 'renderer'; +interface StartupProgressCopy { + readonly title: string; + readonly detail: string; + readonly slow: string; + readonly copy: string; + readonly copied: string; + readonly copyFailed: string; + readonly elapsed: string; + readonly phases: Record; +} + const COPY = { en: { title: 'Opening your workspace', @@ -67,7 +78,7 @@ const COPY = { attention: '等待你的確認', renderer: '正在開啟工作區', }, }, -} as const; +} satisfies UiCatalog; export interface StartupProgressWindow { update(phase: StartupPhase): void; diff --git a/apps/desktop/src/main/windows-app-tray.ts b/apps/desktop/src/main/windows-app-tray.ts index d3bc8aec5b..66762db569 100644 --- a/apps/desktop/src/main/windows-app-tray.ts +++ b/apps/desktop/src/main/windows-app-tray.ts @@ -18,6 +18,7 @@ */ import type { Menu, MenuItemConstructorOptions, Tray } from 'electron'; +import type { UiCatalog } from '@maka/core/ui-locale'; import type { DesktopLocaleAuthority } from './desktop-locale-authority.js'; type TraySurface = Pick; @@ -33,11 +34,17 @@ interface WindowsAppTrayDeps { onError(error: unknown): void; } +interface WindowsAppTrayCopy { + readonly open: string; + readonly workHub: string; + readonly quit: string; +} + const copy = { en: { open: 'Open Maka', workHub: 'Open WorkHub', quit: 'Quit Maka' }, 'zh-CN': { open: '打开 Maka', workHub: '打开 WorkHub', quit: '退出 Maka' }, 'zh-TW': { open: '開啟 Maka', workHub: '開啟 WorkHub', quit: '結束 Maka' }, -}; +} satisfies UiCatalog; /** Windows needs a visible way back after the last product window closes. */ export function createWindowsAppTray(deps: WindowsAppTrayDeps) {