Skip to content

The agent that grows with you

fix(desktop): directory card strings in every locale, notice body out of the handler

alt-glitcheccdfdf907b9
diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/input-requests.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/input-requests.ts
index 1f4f6de11e8..ddc01daaa0c 100644
--- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/input-requests.ts
+++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/input-requests.ts
@@ -7,7 +7,12 @@ import { connectionRequestToolPayload } from '@/app/session/hooks/use-session-ac
import { translateNow } from '@/i18n'
import { settlePendingClarifyToolCall, textPart } from '@/lib/chat-messages'
import { $clarifyRequests, clearClarifyRequest } from '@/store/clarify'
-import { normalizeConnectionRequest, setConnectionRequest, updateConnectionRequest } from '@/store/connection-request'
+import {
+ type ConnectionRequest,
+ normalizeConnectionRequest,
+ setConnectionRequest,
+ updateConnectionRequest
+} from '@/store/connection-request'
import { dispatchNativeNotification } from '@/store/native-notifications'
import { notify } from '@/store/notifications'
import {
@@ -41,6 +46,10 @@ const isConnectionRequestEvent = (event: GatewayEvent): event is ConnectionReque
const isConnectionUpdateEvent = (event: GatewayEvent): event is ConnectionUpdateEvent =>
event.type === 'connection.update' && event.payload !== undefined
+// A display card has no targets to name.
+const connectionRequestNoticeBody = (request: ConnectionRequest): string =>
+ request.targets.map(target => target.name).join(', ') || translateNow('connectors.title')
+
/** The blocking-input family arrives as server→client REQUESTS (see
* `server-requests.ts`); the one EVENT in the family is `request.cancel`, the
* backend withdrawing an open request (timeout / interrupt / session close):
@@ -70,7 +79,7 @@ export function handleInputRequestEvent(ctx: GatewayEventContext): boolean {
}
dispatchNativeNotification({
- body: request.targets.map(target => target.name).join(', ') || translateNow('connectors.title'),
+ body: connectionRequestNoticeBody(request),
kind: 'input',
sessionId,
title: translateNow('notifications.native.inputTitle')
diff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.ts
index 14022b536fa..94fbb94da98 100644
--- a/apps/desktop/src/i18n/ar.ts
+++ b/apps/desktop/src/i18n/ar.ts
@@ -12,6 +12,16 @@ import { arSettings } from './ar_settings'
import { defineLocale, type TranslationOverrides } from './define-locale'
export const arOverrides = {
+ connectors: {
+ directory: {
+ suggested: 'مقترحة',
+ allApps: 'كل التطبيقات',
+ receiptConnected: apps => `متصلة: ${apps}`,
+ receiptNone: 'لم يتم ربط أي تطبيق',
+ receiptSaid: 'تمت الإجابة في الدردشة',
+ receiptTimedOut: 'أُغلقت بعد 5 دقائق'
+ }
+ },
sharedMetrics: arCommon.sharedMetrics,
externalOpenFailed: arChrome.externalOpenFailed,
sessionImport: arConnectors.sessionImport,
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index 18895f2a8e4..6f2e3a83b4d 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -13,6 +13,16 @@ import { jaSharedMetrics } from './ja_shared_metrics'
import { jaUpdateChannel } from './ja_update_channel'
export const jaOverrides = {
+ connectors: {
+ directory: {
+ suggested: 'おすすめ',
+ allApps: 'すべてのアプリ',
+ receiptConnected: apps => `接続済み: ${apps}`,
+ receiptNone: '接続したアプリはありません',
+ receiptSaid: 'チャットで回答しました',
+ receiptTimedOut: '5 分後に閉じました'
+ }
+ },
externalOpenFailed: {
title: 'このリンクを開けませんでした',
message: 'このアドレスを開くブラウザが登録されていません。リンクをコピーして手動で開いてください。',
diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.ts
index 6151c050782..cecf5fe0521 100644
--- a/apps/desktop/src/i18n/ru.ts
+++ b/apps/desktop/src/i18n/ru.ts
@@ -32,6 +32,16 @@ const RU_NOUN = (count: number | string, one: string, few: string, many: string)
}
export const ruOverrides = {
+ connectors: {
+ directory: {
+ suggested: 'Рекомендуемые',
+ allApps: 'Все приложения',
+ receiptConnected: apps => `Подключены: ${apps}`,
+ receiptNone: 'Приложения не подключены',
+ receiptSaid: 'Ответ дан в чате',
+ receiptTimedOut: 'Закрыто через 5 минут'
+ }
+ },
sharedMetrics: ruSharedMetrics,
sessionImport: {
title: 'Продолжить из другого приложения',
diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts
index 6f43aac1e94..1d32077abc6 100644
--- a/apps/desktop/src/i18n/zh-hant.ts
+++ b/apps/desktop/src/i18n/zh-hant.ts
@@ -13,6 +13,16 @@ import { zhHantDiagnostics } from './zh-hant_diagnostics'
import { zhHantSettings } from './zh-hant_settings'
export const zhHantOverrides = {
+ connectors: {
+ directory: {
+ suggested: '推薦',
+ allApps: '全部應用程式',
+ receiptConnected: apps => `已連接:${apps}`,
+ receiptNone: '未連接任何應用程式',
+ receiptSaid: '已在聊天中回覆',
+ receiptTimedOut: '5 分鐘後已關閉'
+ }
+ },
skillDeepLink: {
installTitle: (name: string) => `安裝「${name}」?`,
installDescription: '此技能將於新的工作階段中可用。請僅安裝可信來源的內容。',
diff --git a/locales/_keys.desktop.json b/locales/_keys.desktop.json
index 26cb430779a..de4602fe4aa 100644
--- a/locales/_keys.desktop.json
+++ b/locales/_keys.desktop.json
@@ -1020,6 +1020,12 @@
"connectors.connectError",
"connectors.connectErrorFor",
"connectors.connected",
+ "connectors.directory.allApps",
+ "connectors.directory.receiptConnected",
+ "connectors.directory.receiptNone",
+ "connectors.directory.receiptSaid",
+ "connectors.directory.receiptTimedOut",
+ "connectors.directory.suggested",
"connectors.disabled",
"connectors.disclaimer",
"connectors.empty",