diff --git a/apps/desktop/src/components/editor/AiAssistant.vue b/apps/desktop/src/components/editor/AiAssistant.vue index e0553137f6..b2c055c9d8 100644 --- a/apps/desktop/src/components/editor/AiAssistant.vue +++ b/apps/desktop/src/components/editor/AiAssistant.vue @@ -55,7 +55,7 @@ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, D import { useTheme } from "@/composables/useTheme"; import CodeSnapshotDialog from "@/components/codeSnapshot/CodeSnapshotDialog.vue"; import type { CodeSnapshotSource } from "@/lib/codeSnapshot/codeSnapshot"; -import { useSettingsStore, AI_PROVIDER_PRESETS, normalizeAiConfig } from "@/stores/settingsStore"; +import { useSettingsStore, AI_PROVIDER_PRESETS, aiProviderLabel, normalizeAiConfig } from "@/stores/settingsStore"; import AiProviderLogo from "@/components/icons/AiProviderLogo.vue"; import { useConnectionStore } from "@/stores/connectionStore"; import { useSavedSqlStore } from "@/stores/savedSqlStore"; @@ -725,7 +725,7 @@ function getModelsForConfig(configId: string) { } function configMatchesModelQuery(config: AiConfigItem, query: string): boolean { - return config.name.toLowerCase().includes(query) || config.provider.toLowerCase().includes(query) || AI_PROVIDER_PRESETS[config.provider].label.toLowerCase().includes(query); + return config.name.toLowerCase().includes(query) || config.provider.toLowerCase().includes(query) || aiProviderLabel(config.provider, t).toLowerCase().includes(query) || AI_PROVIDER_PRESETS[config.provider].label.toLowerCase().includes(query); } function getConfigModelOptions(config: AiConfigItem) { @@ -5001,12 +5001,7 @@ async function openExternalUrl(url: string) { diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index 59a7156fa4..6e578c3fee 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -51,6 +51,7 @@ import { HelpTooltip, Tooltip, TooltipContent, TooltipTrigger, TooltipProvider } import { useSettingsStore, AI_PROVIDER_PRESETS, + aiProviderLabel, EDITOR_THEMES, DEFAULT_EDITOR_SETTINGS, DEFAULT_DESKTOP_SETTINGS, @@ -6282,7 +6283,7 @@ onUnmounted(() => {
- {{ AI_PROVIDER_PRESETS[config.provider].label }} + {{ aiProviderLabel(config.provider, t) }}
@@ -6531,8 +6532,8 @@ onUnmounted(() => { - - {{ selectedAiProviderPreset.label }} + + {{ aiProviderLabel(selectedAiProviderPreset.provider, t) }} @@ -6540,8 +6541,8 @@ onUnmounted(() => { - - {{ provider.label }} + + {{ aiProviderLabel(provider.provider, t) }} diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.ts index 073a48a1c2..8b682efcb8 100644 --- a/apps/desktop/src/i18n/locales/en.ts +++ b/apps/desktop/src/i18n/locales/en.ts @@ -2437,6 +2437,7 @@ export default { settings: "AI Settings", noConfig: "AI is not configured. Please set up your AI provider in Settings > AI.", provider: "Provider", + providerCustom: "Custom", providerStatusActive: "Active", providerStatusConfigured: "Configured", switchProvider: "Switch Provider", diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.ts index 345aed9932..c2d53bd63e 100644 --- a/apps/desktop/src/i18n/locales/es.ts +++ b/apps/desktop/src/i18n/locales/es.ts @@ -2373,6 +2373,7 @@ export default withEnglishFallback({ settings: "Configuración de IA", noConfig: "La IA no está configurada. Configura tu proveedor de IA en Ajustes > IA.", provider: "Proveedor", + providerCustom: "Personalizado", providerStatusActive: "Activo", providerStatusConfigured: "Configurado", switchProvider: "Cambiar proveedor", diff --git a/apps/desktop/src/i18n/locales/it.ts b/apps/desktop/src/i18n/locales/it.ts index e4735b8e39..9458ca1de0 100644 --- a/apps/desktop/src/i18n/locales/it.ts +++ b/apps/desktop/src/i18n/locales/it.ts @@ -2371,6 +2371,7 @@ export default withEnglishFallback({ settings: "Impostazioni AI", noConfig: "L'AI non è configurata. Configura il tuo provider AI in Impostazioni > AI.", provider: "Provider", + providerCustom: "Personalizzato", providerStatusActive: "Attivo", providerStatusConfigured: "Configurato", switchProvider: "Cambia provider", diff --git a/apps/desktop/src/i18n/locales/ja.ts b/apps/desktop/src/i18n/locales/ja.ts index ed5b77f0a2..e06ac5ae77 100644 --- a/apps/desktop/src/i18n/locales/ja.ts +++ b/apps/desktop/src/i18n/locales/ja.ts @@ -2397,6 +2397,7 @@ export default withEnglishFallback({ settings: "AI設定", noConfig: "AIが設定されていません。設定 > AIでAIプロバイダーを設定してください。", provider: "プロバイダー", + providerCustom: "カスタム", providerStatusActive: "使用中", providerStatusConfigured: "設定済み", switchProvider: "プロバイダーを切替", diff --git a/apps/desktop/src/i18n/locales/ko.ts b/apps/desktop/src/i18n/locales/ko.ts index 08469fb477..e9ef63be6f 100644 --- a/apps/desktop/src/i18n/locales/ko.ts +++ b/apps/desktop/src/i18n/locales/ko.ts @@ -2269,6 +2269,7 @@ export default withEnglishFallback({ settings: "AI 설정", noConfig: "AI가 구성되지 않았습니다. 설정 > AI에서 AI 공급자를 설정하세요.", provider: "공급자", + providerCustom: "사용자 지정", providerStatusActive: "활성", providerStatusConfigured: "구성됨", switchProvider: "공급자 전환", diff --git a/apps/desktop/src/i18n/locales/pt-BR.ts b/apps/desktop/src/i18n/locales/pt-BR.ts index c05d59b4e2..88d0ae9553 100644 --- a/apps/desktop/src/i18n/locales/pt-BR.ts +++ b/apps/desktop/src/i18n/locales/pt-BR.ts @@ -2373,6 +2373,7 @@ export default withEnglishFallback({ settings: "Configurações de AI", noConfig: "A AI não está configurada. Configure seu provedor de AI em Configurações > AI.", provider: "Provedor", + providerCustom: "Personalizado", providerStatusActive: "Ativo", providerStatusConfigured: "Configurado", switchProvider: "Trocar provedor", diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.ts index b97cc804e8..d26f9b4219 100644 --- a/apps/desktop/src/i18n/locales/zh-CN.ts +++ b/apps/desktop/src/i18n/locales/zh-CN.ts @@ -2361,6 +2361,7 @@ export default withEnglishFallback({ settings: "AI 设置", noConfig: "AI 尚未配置。请在 设置 > AI 中配置你的 AI 服务。", provider: "提供商", + providerCustom: "自定义", providerStatusActive: "当前", providerStatusConfigured: "已配置", switchProvider: "切换服务商", diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.ts index 9e327c31c4..30ac83401b 100644 --- a/apps/desktop/src/i18n/locales/zh-TW.ts +++ b/apps/desktop/src/i18n/locales/zh-TW.ts @@ -2371,6 +2371,7 @@ export default withEnglishFallback({ settings: "AI 設定", noConfig: "AI 尚未設定。請在 設定 > AI 中設定你的 AI 服務。", provider: "供應商", + providerCustom: "自訂", providerStatusActive: "目前", providerStatusConfigured: "已設定", switchProvider: "切換服務商", diff --git a/apps/desktop/src/stores/settingsStore.ts b/apps/desktop/src/stores/settingsStore.ts index a3b30d55e5..533286b1f0 100644 --- a/apps/desktop/src/stores/settingsStore.ts +++ b/apps/desktop/src/stores/settingsStore.ts @@ -313,6 +313,12 @@ export const AI_PROVIDER_PRESETS: Record = { }, }; +/** Brand names stay as preset labels; only the generic "custom" entry is localized. */ +export function aiProviderLabel(provider: AiProvider, t: (key: string) => string): string { + if (provider === "custom") return t("ai.providerCustom"); + return AI_PROVIDER_PRESETS[provider].label; +} + const defaultConfigs: Record> = Object.fromEntries( Object.entries(AI_PROVIDER_PRESETS).map(([provider, preset]) => { const { label: _label, iconSlug: _iconSlug, requiresApiKey: _requiresApiKey, ...config } = preset;