Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(providers): 切换语言后刷新 Cindy AI 身份名称

Dashb672b08b9208
diff --git a/apps/desktop/src/main/bootstrap-electron.ts b/apps/desktop/src/main/bootstrap-electron.ts
index a317fbbaa1..3323c624c4 100644
--- a/apps/desktop/src/main/bootstrap-electron.ts
+++ b/apps/desktop/src/main/bootstrap-electron.ts
@@ -3127,11 +3127,17 @@ ipcMain.on('app-locale:get-preferred-system-locale-sync', (event) => {
ipcMain.handle('deep-link:take-pending', takePendingDeepLinkFromRenderer);
ipcMain.handle('app-menu:set-locale', (_event, locale: unknown): { ok: true } => {
+ const previousLocale = currentApplicationMenuLocale;
currentApplicationMenuLocale = resolveApplicationMenuLocale(
typeof locale === 'string' ? locale : null,
);
setSelectionContextMenuLocale(currentApplicationMenuLocale);
setMainLocale(currentApplicationMenuLocale);
+ if (previousLocale !== currentApplicationMenuLocale) {
+ // Identity names are localized on the source host; refresh its cached views
+ // and linked devices through the existing provider-change notification.
+ refreshSelectableModelsAndBroadcast({ providerId: 'xd' });
+ }
refreshWindowsAppBadge();
resourceUsageWindowController.setLocale(currentApplicationMenuLocale);
remoteDesktopViewerWindows.setLocale(currentApplicationMenuLocale);