Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 77 additions & 27 deletions apps/desktop/renderer-architecture.json
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/artifact-copy.ts": {
"bridgePaths": {},
Expand All @@ -1101,7 +1103,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/browser-copy.ts": {
"bridgePaths": {},
Expand All @@ -1110,7 +1114,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/capability-reason-copy.ts": {
"bridgePaths": {},
Expand All @@ -1130,7 +1136,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/mcp-copy.ts": {
"bridgePaths": {},
Expand All @@ -1139,7 +1147,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/onboarding-copy.ts": {
"bridgePaths": {},
Expand All @@ -1148,7 +1158,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/peer-mesh-copy.ts": {
"bridgePaths": {},
Expand All @@ -1157,7 +1169,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/permission-center-copy.ts": {
"bridgePaths": {},
Expand All @@ -1166,7 +1180,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/plan-mode-copy.ts": {
"bridgePaths": {},
Expand All @@ -1186,7 +1202,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/session-local-copy.ts": {
"bridgePaths": {},
Expand All @@ -1195,7 +1213,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/settings-bot-copy.ts": {
"bridgePaths": {},
Expand All @@ -1215,7 +1235,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/settings-data-copy.ts": {
"bridgePaths": {},
Expand All @@ -1224,7 +1246,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/settings-external-agents-copy.ts": {
"bridgePaths": {},
Expand All @@ -1233,7 +1257,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/settings-health-copy.ts": {
"bridgePaths": {},
Expand All @@ -1242,7 +1268,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/settings-jev-copy.ts": {
"bridgePaths": {},
Expand All @@ -1251,7 +1279,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/settings-memory-copy.ts": {
"bridgePaths": {},
Expand All @@ -1271,7 +1301,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/settings-preferences-copy.ts": {
"bridgePaths": {},
Expand All @@ -1280,7 +1312,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/settings-projects-copy.ts": {
"bridgePaths": {},
Expand All @@ -1300,7 +1334,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/settings-subagents-copy.ts": {
"bridgePaths": {},
Expand All @@ -1309,7 +1345,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/settings-tasks-copy.ts": {
"bridgePaths": {},
Expand All @@ -1318,7 +1356,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/settings-test-result-copy.ts": {
"bridgePaths": {},
Expand All @@ -1328,7 +1368,7 @@
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"@maka/core/ui-locale": 1
"@maka/core/ui-locale": 2
}
},
"src/renderer/locales/settings-usage-copy.ts": {
Expand All @@ -1338,7 +1378,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/settings-web-search-copy.ts": {
"bridgePaths": {},
Expand All @@ -1347,7 +1389,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/shell-copy.ts": {
"bridgePaths": {},
Expand All @@ -1369,7 +1413,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/storage-usage-copy.ts": {
"bridgePaths": {},
Expand All @@ -1378,7 +1424,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/task-readiness-copy.ts": {
"bridgePaths": {},
Expand All @@ -1387,7 +1435,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/work-board-error-copy.ts": {
"bridgePaths": {},
Expand All @@ -1397,7 +1447,7 @@
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"@maka/core/ui-locale": 1
"@maka/core/ui-locale": 2
}
},
"src/renderer/model-catalog-choices.ts": {
Expand Down
14 changes: 7 additions & 7 deletions apps/desktop/src/main/__tests__/bot-chat-detail.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { pathToFileURL } from 'node:url';
import { createDefaultBotChannel } from '@maka/core/bot-chat-settings';
import { MAX_ALLOWED_USER_IDS, createDefaultSettings } from '@maka/core/settings';
import { BotRegistry, SlackBotBridge, WechatBridge, type BotStatus } from '@maka/runtime/bots';
import { UI_LOCALES, type UiCatalog, type UiLocale } from '@maka/core/ui-locale';
import { UI_LOCALES, type UiLocale, defineShippedUiMessageCatalog, resolveUiMessageCatalog } from '@maka/core/ui-locale';
import { AstryxLocaleProvider, LocaleProvider, ToastProvider } from '@maka/ui';
import { build } from 'esbuild';
import { parseHTML } from 'linkedom';
Expand Down Expand Up @@ -69,7 +69,11 @@ after(async () => {
});

const invalidUsers = ['@alice', '@bob', '@carol', '@dave', '@eve'];
const expectedCopy = {
const expectedCopy = resolveUiMessageCatalog(defineShippedUiMessageCatalog<{
help: string;
cappedHelp: string;
warnings: [number, string][];
}>()({
'zh-CN': {
help: 'Telegram 用户 ID 是 64 位整数;填入后只接收列表里这些 ID 的来信,其它人发的消息会被静默忽略(不会回弹任何提示)。',
cappedHelp: 'Telegram 用户 ID 是 64 位整数;填入后只接收列表里这些 ID 的来信,其它人发的消息会被静默忽略(不会回弹任何提示)。 (已达到上限)',
Expand Down Expand Up @@ -100,11 +104,7 @@ const expectedCopy = {
[5, 'These entries are not numeric IDs and may be usernames, so they will not match anyone: @alice, @bob, @carol and 2 more'],
],
},
} satisfies UiCatalog<{
help: string;
cappedHelp: string;
warnings: [number, string][];
}>;
}));

for (const locale of UI_LOCALES) {
const expected = expectedCopy[locale];
Expand Down
12 changes: 6 additions & 6 deletions apps/desktop/src/main/__tests__/health-center-copy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import assert from 'node:assert/strict';
import { test } from 'node:test';
import { CAPABILITY_REASON_CODES } from '@maka/core/capabilities';
import { UI_LOCALES, type UiCatalog } from '@maka/core/ui-locale';
import { UI_LOCALES, defineShippedUiMessageCatalog, resolveUiMessageCatalog } from '@maka/core/ui-locale';
import { connectionLastTestMessageDisplay } from '../../renderer/features/connection-settings/index.js';
import { getHealthCenterCopy } from '../../renderer/locales/settings-health-copy.js';
import { getCapabilityReasonCopy } from '../../renderer/locales/capability-reason-copy.js';
Expand Down Expand Up @@ -100,11 +100,11 @@ test('renders runtime probe details from structured params, not string parsing',
});

test('capability reason codes have copy in every locale, unknown reasons keep the fallback', () => {
const fallback = {
'zh-CN': '状态详情请见对应设置页。',
'zh-TW': '狀態詳細資料請參閱對應的設定頁。',
en: 'See the corresponding settings page for details.',
} satisfies UiCatalog<string>;
const fallback = resolveUiMessageCatalog(defineShippedUiMessageCatalog<string>()({
'zh-CN': '状态详情请见对应设置页。',
'zh-TW': '狀態詳細資料請參閱對應的設定頁。',
en: 'See the corresponding settings page for details.',
}));
assert.equal(getCapabilityReasonCopy('zh-CN').platform_credentials_missing, '未配置平台凭据');
for (const locale of UI_LOCALES) {
const reasons = getCapabilityReasonCopy(locale);
Expand Down
20 changes: 10 additions & 10 deletions apps/desktop/src/main/__tests__/settings-memory-copy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import assert from 'node:assert/strict';
import test from 'node:test';
import { UI_LOCALES, type UiCatalog } from '@maka/core/ui-locale';
import { UI_LOCALES, defineShippedUiMessageCatalog, resolveUiMessageCatalog } from '@maka/core/ui-locale';
import {
getMemorySettingsCopy,
memoryResultMessage,
Expand Down Expand Up @@ -51,7 +51,14 @@ test('falls back for an unknown Runtime Host memory rejection code', () => {
}
});

const formattedCopy = {
const formattedCopy = resolveUiMessageCatalog(defineShippedUiMessageCatalog<{
counts: string[][];
summaries: string[][];
redacted: string[];
backupFailures: string[];
preview: string[];
labels: string[];
}>()({
'zh-CN': {
counts: [
['0 条生效', '草稿 0 条生效', '0 条已归档', '草稿 0 条已归档', '0 条记忆'],
Expand Down Expand Up @@ -145,14 +152,7 @@ const formattedCopy = {
'The current MEMORY.md will be backed up before the selected backup replaces it. Restore: Backup #2',
],
},
} satisfies UiCatalog<{
counts: string[][];
summaries: string[][];
redacted: string[];
backupFailures: string[];
preview: string[];
labels: string[];
}>;
}));

for (const locale of UI_LOCALES) {
const expected = formattedCopy[locale];
Expand Down
Loading