From 815b80e93a6b1e069b9ebcaab9d4d143ad35c605 Mon Sep 17 00:00:00 2001 From: ElwinLiu Date: Mon, 27 Apr 2026 10:21:07 -0400 Subject: [PATCH] fix(models): clarify Doubao credential labels --- src-tauri/src/cloud_stt/doubao.rs | 5 +++-- .../PostProcessingSettingsApi/ApiKeyField.tsx | 12 +++++++++- .../models/CloudProviderConfigCard.tsx | 22 ++++++++++++++----- src/i18n/locales/ar/translation.json | 6 ++++- src/i18n/locales/cs/translation.json | 6 ++++- src/i18n/locales/de/translation.json | 6 ++++- src/i18n/locales/en/translation.json | 6 ++++- src/i18n/locales/es/translation.json | 6 ++++- src/i18n/locales/fr/translation.json | 6 ++++- src/i18n/locales/it/translation.json | 6 ++++- src/i18n/locales/ja/translation.json | 6 ++++- src/i18n/locales/ko/translation.json | 6 ++++- src/i18n/locales/pl/translation.json | 6 ++++- src/i18n/locales/pt/translation.json | 6 ++++- src/i18n/locales/ru/translation.json | 6 ++++- src/i18n/locales/tr/translation.json | 6 ++++- src/i18n/locales/uk/translation.json | 6 ++++- src/i18n/locales/vi/translation.json | 6 ++++- src/i18n/locales/zh-TW/translation.json | 6 ++++- src/i18n/locales/zh/translation.json | 6 ++++- 20 files changed, 116 insertions(+), 25 deletions(-) diff --git a/src-tauri/src/cloud_stt/doubao.rs b/src-tauri/src/cloud_stt/doubao.rs index f9b7f262..06190f5e 100644 --- a/src-tauri/src/cloud_stt/doubao.rs +++ b/src-tauri/src/cloud_stt/doubao.rs @@ -50,7 +50,7 @@ pub(crate) enum DoubaoEvent { // ─── Credential extraction ────────────────────────────────────────── /// Extract the three Doubao credentials: -/// - `access_key` from the `api_key` parameter (the main API Key field) +/// - `access_token` from the main credential field /// - `app_key` and `resource_id` from the cloud options pub(crate) fn extract_credentials<'a>( api_key: &'a str, @@ -69,7 +69,8 @@ pub(crate) fn extract_credentials<'a>( .and_then(|v| v.as_str()) .filter(|s| !s.is_empty()) .unwrap_or(DEFAULT_RESOURCE_ID); - Ok((api_key, app_key, resource_id)) + let access_token = api_key; + Ok((access_token, app_key, resource_id)) } /// Map app language codes to Doubao API language codes. diff --git a/src/components/settings/PostProcessingSettingsApi/ApiKeyField.tsx b/src/components/settings/PostProcessingSettingsApi/ApiKeyField.tsx index 03dc2e29..2b26956d 100644 --- a/src/components/settings/PostProcessingSettingsApi/ApiKeyField.tsx +++ b/src/components/settings/PostProcessingSettingsApi/ApiKeyField.tsx @@ -10,11 +10,20 @@ interface ApiKeyFieldProps { onChange?: (value: string) => void; disabled: boolean; placeholder?: string; + ariaLabel?: string; className?: string; } export const ApiKeyField: React.FC = React.memo( - ({ value, onBlur, onChange, disabled, placeholder, className = "" }) => { + ({ + value, + onBlur, + onChange, + disabled, + placeholder, + ariaLabel, + className = "", + }) => { const { t } = useTranslation(); const [localValue, setLocalValue] = useState(value); const [showCopied, setShowCopied] = useState(false); @@ -53,6 +62,7 @@ export const ApiKeyField: React.FC = React.memo( if (localValue !== value) onBlur(localValue); }} placeholder={placeholder} + aria-label={ariaLabel} variant="compact" disabled={disabled} className={`w-full ${localValue ? "pr-7" : ""}`} diff --git a/src/components/settings/models/CloudProviderConfigCard.tsx b/src/components/settings/models/CloudProviderConfigCard.tsx index 07769b13..39652e10 100644 --- a/src/components/settings/models/CloudProviderConfigCard.tsx +++ b/src/components/settings/models/CloudProviderConfigCard.tsx @@ -276,6 +276,19 @@ export const CloudProviderConfigCard: React.FC< const effectiveStatus = !isVerified && status === "active" ? "available" : status; const isClickable = isVerified; + const isDoubao = provider.id === "doubao"; + const credentialLabel = isDoubao + ? t("settings.models.cloudProviders.doubao.accessToken") + : t("settings.models.cloudProviders.apiKey.title"); + const credentialPlaceholder = isDoubao + ? t("settings.models.cloudProviders.doubao.accessTokenPlaceholder") + : t("settings.models.cloudProviders.apiKey.placeholder"); + const verifyFirstLabel = isDoubao + ? t("settings.models.cloudProviders.doubao.verifyFirst") + : t("settings.models.cloudProviders.verifyFirst"); + const consoleButtonLabel = isDoubao + ? t("settings.models.cloudProviders.doubao.openSpeechConsole") + : t("settings.models.cloudProviders.getApiKey"); const [showVerifyHint, setShowVerifyHint] = useState(false); const hintTimer = useRef | null>(null); @@ -328,7 +341,7 @@ export const CloudProviderConfigCard: React.FC< )} {showVerifyHint && ( - {t("settings.models.cloudProviders.verifyFirst")} + {verifyFirstLabel} )} )} diff --git a/src/i18n/locales/ar/translation.json b/src/i18n/locales/ar/translation.json index 3ec72d12..4ef63b12 100644 --- a/src/i18n/locales/ar/translation.json +++ b/src/i18n/locales/ar/translation.json @@ -333,7 +333,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/cs/translation.json b/src/i18n/locales/cs/translation.json index 50f89e33..3199c8b4 100644 --- a/src/i18n/locales/cs/translation.json +++ b/src/i18n/locales/cs/translation.json @@ -279,7 +279,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/de/translation.json b/src/i18n/locales/de/translation.json index 15044d55..f2de5757 100644 --- a/src/i18n/locales/de/translation.json +++ b/src/i18n/locales/de/translation.json @@ -279,7 +279,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index 55bb159a..60d4652f 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -333,7 +333,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/es/translation.json b/src/i18n/locales/es/translation.json index e76f013c..a51f2177 100644 --- a/src/i18n/locales/es/translation.json +++ b/src/i18n/locales/es/translation.json @@ -279,7 +279,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/fr/translation.json b/src/i18n/locales/fr/translation.json index fabe7929..0f07626e 100644 --- a/src/i18n/locales/fr/translation.json +++ b/src/i18n/locales/fr/translation.json @@ -279,7 +279,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/it/translation.json b/src/i18n/locales/it/translation.json index 95f7acb3..9ca48e84 100644 --- a/src/i18n/locales/it/translation.json +++ b/src/i18n/locales/it/translation.json @@ -279,7 +279,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/ja/translation.json b/src/i18n/locales/ja/translation.json index 9f152810..fa503761 100644 --- a/src/i18n/locales/ja/translation.json +++ b/src/i18n/locales/ja/translation.json @@ -279,7 +279,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/ko/translation.json b/src/i18n/locales/ko/translation.json index 01e6ebc8..8d10bf14 100644 --- a/src/i18n/locales/ko/translation.json +++ b/src/i18n/locales/ko/translation.json @@ -352,7 +352,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/pl/translation.json b/src/i18n/locales/pl/translation.json index d445a83a..90fdc118 100644 --- a/src/i18n/locales/pl/translation.json +++ b/src/i18n/locales/pl/translation.json @@ -333,7 +333,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/pt/translation.json b/src/i18n/locales/pt/translation.json index 5529bcac..aaa6f682 100644 --- a/src/i18n/locales/pt/translation.json +++ b/src/i18n/locales/pt/translation.json @@ -333,7 +333,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/ru/translation.json b/src/i18n/locales/ru/translation.json index 2e30de26..e526bb04 100644 --- a/src/i18n/locales/ru/translation.json +++ b/src/i18n/locales/ru/translation.json @@ -279,7 +279,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/tr/translation.json b/src/i18n/locales/tr/translation.json index 7bbd5250..16218bfd 100644 --- a/src/i18n/locales/tr/translation.json +++ b/src/i18n/locales/tr/translation.json @@ -333,7 +333,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/uk/translation.json b/src/i18n/locales/uk/translation.json index 844c462c..b0a8eec6 100644 --- a/src/i18n/locales/uk/translation.json +++ b/src/i18n/locales/uk/translation.json @@ -333,7 +333,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/vi/translation.json b/src/i18n/locales/vi/translation.json index f5b087af..85414cf3 100644 --- a/src/i18n/locales/vi/translation.json +++ b/src/i18n/locales/vi/translation.json @@ -333,7 +333,11 @@ "appKey": "App Key (App ID)", "appKeyDescription": "Your Volcengine App ID (from the Speech console)", "resourceId": "Resource ID", - "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)" + "resourceIdDescription": "Your Volcengine speech resource ID (from the Speech console)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "Verify your Access Token first", + "openSpeechConsole": "Open speech console" } }, "localModels": { diff --git a/src/i18n/locales/zh-TW/translation.json b/src/i18n/locales/zh-TW/translation.json index fad0ebbc..3d07a34c 100644 --- a/src/i18n/locales/zh-TW/translation.json +++ b/src/i18n/locales/zh-TW/translation.json @@ -333,7 +333,11 @@ "appKey": "應用金鑰 (App ID)", "appKeyDescription": "火山引擎 App ID(從語音控制台取得)", "resourceId": "資源 ID", - "resourceIdDescription": "火山引擎語音資源 ID(從語音控制台取得)" + "resourceIdDescription": "火山引擎語音資源 ID(從語音控制台取得)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "請先驗證您的 Access Token", + "openSpeechConsole": "開啟語音控制台" } }, "localModels": { diff --git a/src/i18n/locales/zh/translation.json b/src/i18n/locales/zh/translation.json index 5138458e..dfabeccf 100644 --- a/src/i18n/locales/zh/translation.json +++ b/src/i18n/locales/zh/translation.json @@ -279,7 +279,11 @@ "appKey": "应用密钥 (App ID)", "appKeyDescription": "火山引擎 App ID(从语音控制台获取)", "resourceId": "资源 ID", - "resourceIdDescription": "火山引擎语音资源 ID(从语音控制台获取)" + "resourceIdDescription": "火山引擎语音资源 ID(从语音控制台获取)", + "accessToken": "Access Token", + "accessTokenPlaceholder": "Access Token", + "verifyFirst": "请先验证您的 Access Token", + "openSpeechConsole": "打开语音控制台" } }, "localModels": {