From 5cf47e588035010fed5a7076aa7a02debec47cb4 Mon Sep 17 00:00:00 2001 From: HybridTalentComputing <1316645276@qq.com> Date: Tue, 23 Dec 2025 23:38:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90provider=E7=9A=84=E6=B1=89?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../settings/common/ApiKeyField.tsx | 27 +++---- .../settings/common/BaseUrlField.tsx | 12 ++-- .../settings/providers/AnthropicProvider.tsx | 5 +- .../settings/providers/AskSageProvider.tsx | 10 +-- .../settings/providers/BedrockProvider.tsx | 65 +++++++++-------- .../settings/providers/DifyProvider.tsx | 23 ++---- .../settings/providers/FireworksProvider.tsx | 38 +++++----- .../settings/providers/GeminiProvider.tsx | 11 +-- .../settings/providers/HicapProvider.tsx | 6 +- .../providers/HuggingFaceProvider.tsx | 25 ++++--- .../settings/providers/LMStudioProvider.tsx | 38 ++++++---- .../settings/providers/MiniMaxProvider.tsx | 9 +-- .../settings/providers/MoonshotProvider.tsx | 8 ++- .../settings/providers/NebiusProvider.tsx | 6 +- .../settings/providers/OllamaProvider.tsx | 50 +++++++------ .../settings/providers/OpenAICompatible.tsx | 20 +++--- .../settings/providers/OpenRouterProvider.tsx | 16 ++--- .../settings/providers/RequestyProvider.tsx | 8 ++- .../settings/providers/TogetherProvider.tsx | 12 ++-- .../providers/VercelAIGatewayProvider.tsx | 32 +++++---- webview-ui/src/locales/en/common.json | 72 +++++++++++++++++++ webview-ui/src/locales/zh-CN/common.json | 72 +++++++++++++++++++ 22 files changed, 372 insertions(+), 193 deletions(-) diff --git a/webview-ui/src/components/settings/common/ApiKeyField.tsx b/webview-ui/src/components/settings/common/ApiKeyField.tsx index d968ddf8..39abf2f1 100644 --- a/webview-ui/src/components/settings/common/ApiKeyField.tsx +++ b/webview-ui/src/components/settings/common/ApiKeyField.tsx @@ -1,4 +1,5 @@ import { VSCodeLink, VSCodeTextField } from "@vscode/webview-ui-toolkit/react" +import { useTranslation } from "react-i18next" import { useDebouncedInput } from "../utils/useDebouncedInput" /** @@ -16,26 +17,27 @@ interface ApiKeyFieldProps { /** * A reusable component for API key input fields with standard styling and help text for signing up for key */ -export const ApiKeyField = ({ - initialValue, - onChange, - providerName, - signupUrl, - placeholder = "Enter API Key...", - helpText, -}: ApiKeyFieldProps) => { +export const ApiKeyField = ({ initialValue, onChange, providerName, signupUrl, placeholder, helpText }: ApiKeyFieldProps) => { + const { t } = useTranslation() const [localValue, setLocalValue] = useDebouncedInput(initialValue, onChange) + const defaultPlaceholder = placeholder || t("settings.apiConfig.apiKeyPlaceholder") + const defaultHelpText = helpText || t("settings.apiConfig.apiKeyStoredLocally") + const getApiKeyText = /^[aeiou]/i.test(providerName) + ? t("settings.apiConfig.getApiKeyAn", { providerName }) + : t("settings.apiConfig.getApiKey", { providerName }) return (
setLocalValue(e.target.value)} - placeholder={placeholder} + placeholder={defaultPlaceholder} required={true} style={{ width: "100%" }} type="password" value={localValue}> - {providerName} API Key + + {providerName} {t("settings.providers.apiKey")} +

- {helpText || "This key is stored locally and only used to make API requests from this extension."} + {defaultHelpText} {!localValue && signupUrl && ( - You can get a{/^[aeiou]/i.test(providerName) ? "n" : ""} {providerName} API key by signing up here. + {" "} + {getApiKeyText} )}

diff --git a/webview-ui/src/components/settings/common/BaseUrlField.tsx b/webview-ui/src/components/settings/common/BaseUrlField.tsx index e71b3f2b..05f81205 100644 --- a/webview-ui/src/components/settings/common/BaseUrlField.tsx +++ b/webview-ui/src/components/settings/common/BaseUrlField.tsx @@ -1,5 +1,6 @@ import { VSCodeCheckbox, VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import { useState } from "react" +import { useTranslation } from "react-i18next" import { useDebouncedInput } from "../utils/useDebouncedInput" /** @@ -21,11 +22,14 @@ interface BaseUrlFieldProps { export const BaseUrlField = ({ initialValue, onChange, - label = "Use custom base URL", - placeholder = "Default: https://api.example.com", + label, + placeholder, disabled = false, showLockIcon = false, }: BaseUrlFieldProps) => { + const { t } = useTranslation() + const defaultLabel = label || t("settings.apiConfig.useCustomBaseUrl") + const defaultPlaceholder = placeholder || "Default: https://api.example.com" const [isEnabled, setIsEnabled] = useState(!!initialValue) const [localValue, setLocalValue] = useDebouncedInput(initialValue || "", onChange) @@ -41,7 +45,7 @@ export const BaseUrlField = ({
- {label} + {defaultLabel} {showLockIcon && }
@@ -50,7 +54,7 @@ export const BaseUrlField = ({ setLocalValue(e.target.value.trim())} - placeholder={placeholder} + placeholder={defaultPlaceholder} style={{ width: "100%", marginTop: 3 }} type="text" value={localValue} diff --git a/webview-ui/src/components/settings/providers/AnthropicProvider.tsx b/webview-ui/src/components/settings/providers/AnthropicProvider.tsx index 6e6961aa..1fee63a4 100644 --- a/webview-ui/src/components/settings/providers/AnthropicProvider.tsx +++ b/webview-ui/src/components/settings/providers/AnthropicProvider.tsx @@ -1,5 +1,6 @@ import { anthropicModels, CLAUDE_SONNET_1M_SUFFIX } from "@shared/api" import { Mode } from "@shared/storage/types" +import { useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { ApiKeyField } from "../common/ApiKeyField" import { BaseUrlField } from "../common/BaseUrlField" @@ -36,6 +37,7 @@ interface AnthropicProviderProps { * The Anthropic provider configuration component */ export const AnthropicProvider = ({ showModelOptions, isPopup, currentMode }: AnthropicProviderProps) => { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() const { handleFieldChange, handleModeFieldChange } = useApiConfigurationHandlers() @@ -58,7 +60,6 @@ export const AnthropicProvider = ({ showModelOptions, isPopup, currentMode }: An handleFieldChange("anthropicBaseUrl", value)} placeholder="Default: https://api.anthropic.com" /> @@ -66,7 +67,7 @@ export const AnthropicProvider = ({ showModelOptions, isPopup, currentMode }: An {showModelOptions && ( <> handleModeFieldChange( diff --git a/webview-ui/src/components/settings/providers/AskSageProvider.tsx b/webview-ui/src/components/settings/providers/AskSageProvider.tsx index db36fa26..9dad42ac 100644 --- a/webview-ui/src/components/settings/providers/AskSageProvider.tsx +++ b/webview-ui/src/components/settings/providers/AskSageProvider.tsx @@ -1,6 +1,7 @@ import { askSageDefaultURL, askSageModels, ModelInfo } from "@shared/api" import { Mode } from "@shared/storage/types" import { useEffect, useState } from "react" +import { useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { ApiKeyField } from "../common/ApiKeyField" import { DebouncedTextField } from "../common/DebouncedTextField" @@ -22,6 +23,7 @@ interface AskSageProviderProps { * The AskSage provider configuration component */ export const AskSageProvider = ({ showModelOptions, isPopup, currentMode }: AskSageProviderProps) => { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() const { handleFieldChange, handleModeFieldChange } = useApiConfigurationHandlers() const [availableModels, setAvailableModels] = useState>(askSageModels) @@ -70,7 +72,7 @@ export const AskSageProvider = ({ showModelOptions, isPopup, currentMode }: AskS return (
handleFieldChange("asksageApiKey", value)} providerName="AskSage" @@ -79,16 +81,16 @@ export const AskSageProvider = ({ showModelOptions, isPopup, currentMode }: AskS handleFieldChange("asksageApiUrl", value)} - placeholder="Enter AskSage API URL..." + placeholder={t("settings.apiConfig.enterAskSageApiUrl")} style={{ width: "100%" }} type="text"> - AskSage API URL + {t("settings.apiConfig.askSageApiUrl")} {showModelOptions && ( <> handleModeFieldChange( diff --git a/webview-ui/src/components/settings/providers/BedrockProvider.tsx b/webview-ui/src/components/settings/providers/BedrockProvider.tsx index 07816207..939af6ee 100644 --- a/webview-ui/src/components/settings/providers/BedrockProvider.tsx +++ b/webview-ui/src/components/settings/providers/BedrockProvider.tsx @@ -3,6 +3,7 @@ import BedrockData from "@shared/providers/bedrock.json" import { Mode } from "@shared/storage/types" import { VSCodeCheckbox, VSCodeDropdown, VSCodeOption, VSCodeRadio, VSCodeRadioGroup } from "@vscode/webview-ui-toolkit/react" import { useState } from "react" +import { useTranslation } from "react-i18next" import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip" import { useExtensionState } from "@/context/ExtensionStateContext" import { DebouncedTextField } from "../common/DebouncedTextField" @@ -36,6 +37,7 @@ interface BedrockProviderProps { } export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: BedrockProviderProps) => { + const { t } = useTranslation() const { apiConfiguration, remoteConfigSettings } = useExtensionState() const { handleFieldChange, handleModeFieldChange, handleModeFieldsChange } = useApiConfigurationHandlers() @@ -51,9 +53,9 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr handleFieldChange("awsAuthentication", value) }} value={apiConfiguration?.awsAuthentication ?? (apiConfiguration?.awsProfile ? "profile" : "credentials")}> - API Key - AWS Profile - AWS Credentials + {t("settings.providers.apiKey")} + {t("settings.apiConfig.awsProfile")} + {t("settings.apiConfig.awsCredentials")} {(apiConfiguration?.awsAuthentication === undefined && apiConfiguration?.awsUseProfile) || @@ -63,8 +65,8 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr initialValue={apiConfiguration?.awsProfile ?? ""} key="profile" onChange={(value) => handleFieldChange("awsProfile", value)} - placeholder="Enter profile name (default if empty)"> - AWS Profile Name + placeholder={t("settings.apiConfig.enterProfileName")}> + {t("settings.apiConfig.awsProfileName")} ) : apiConfiguration?.awsAuthentication === "apikey" ? ( handleFieldChange("awsBedrockApiKey", value)} - placeholder="Enter Bedrock Api Key" + placeholder={t("settings.apiConfig.enterBedrockApiKey")} type="password"> - AWS Bedrock Api Key + {t("settings.apiConfig.awsBedrockApiKey")} ) : ( <> @@ -83,25 +85,25 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr initialValue={apiConfiguration?.awsAccessKey || ""} key="accessKey" onChange={(value) => handleFieldChange("awsAccessKey", value)} - placeholder="Enter Access Key..." + placeholder={t("settings.apiConfig.enterAccessKey")} type="password"> - AWS Access Key + {t("settings.apiConfig.awsAccessKey")} handleFieldChange("awsSecretKey", value)} - placeholder="Enter Secret Key..." + placeholder={t("settings.apiConfig.enterSecretKey")} type="password"> - AWS Secret Key + {t("settings.apiConfig.awsSecretKey")} handleFieldChange("awsSessionToken", value)} - placeholder="Enter Session Token..." + placeholder={t("settings.apiConfig.enterSessionToken")} type="password"> - AWS Session Token + {t("settings.apiConfig.awsSessionToken")} )} @@ -114,7 +116,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
{remoteConfigSettings?.awsRegion !== undefined && ( @@ -126,7 +128,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr id="aws-region-dropdown" onChange={(e: any) => handleFieldChange("awsRegion", e.target.value)} value={apiConfiguration?.awsRegion || ""}> - Select a region... + {t("settings.apiConfig.selectRegion")} {/* The user will have to choose a region that supports the model they use, but this shouldn't be a problem since they'd have to request access for it in that region in the first place. */} {AWS_REGIONS.map((region) => ( @@ -155,7 +157,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr handleFieldChange("awsBedrockEndpoint", "") } }}> - Use custom VPC endpoint + {t("settings.apiConfig.useCustomVpcEndpoint")} {remoteConfigSettings?.awsBedrockEndpoint !== undefined && ( @@ -168,7 +170,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr disabled={remoteConfigSettings?.awsBedrockEndpoint !== undefined} initialValue={apiConfiguration?.awsBedrockEndpoint || ""} onChange={(value) => handleFieldChange("awsBedrockEndpoint", value)} - placeholder="Enter VPC Endpoint URL (optional)" + placeholder={t("settings.apiConfig.enterVpcEndpointUrl")} type="text" /> )} @@ -189,7 +191,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr handleFieldChange("awsUseCrossRegionInference", isChecked) }}> - Use cross-region inference + {t("settings.apiConfig.useCrossRegionInference")} {remoteConfigSettings?.awsUseCrossRegionInference !== undefined && ( @@ -212,7 +214,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr const isChecked = e.target.checked === true handleFieldChange("awsUseGlobalInference", isChecked) }}> - Use global inference profile + {t("settings.apiConfig.useGlobalInferenceProfile")} {remoteConfigSettings?.awsUseGlobalInference !== undefined && ( @@ -236,7 +238,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr const isChecked = e.target.checked === true handleFieldChange("awsBedrockUsePromptCache", isChecked) }}> - Use prompt caching + {t("settings.apiConfig.usePromptCaching")} {remoteConfigSettings?.awsBedrockUsePromptCache !== undefined && ( @@ -249,14 +251,14 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr

{apiConfiguration?.awsUseProfile - ? "Using AWS Profile credentials from ~/.aws/credentials. Leave profile name empty to use the default profile. These credentials are only used locally to make API requests from this extension." - : "Authenticate by either providing the keys above or use the default AWS credential providers, i.e. ~/.aws/credentials or environment variables. These credentials are only used locally to make API requests from this extension."} + ? t("settings.apiConfig.awsProfileDescription") + : t("settings.apiConfig.awsCredentialsDescription")}

{showModelOptions && ( <> - Select a model... + {t("settings.apiConfig.selectModel")} {Object.keys(bedrockModels).map((modelId) => ( ))} - Custom + {t("settings.apiConfig.custom")} {modeFields.awsBedrockCustomSelected && (
-

- Select "Custom" when using the Application Inference Profile in Bedrock. Enter the Application - Inference Profile ARN in the Model ID field. -

+

{t("settings.apiConfig.customModelDescription")}

- Model ID + placeholder={t("settings.apiConfig.enterCustomModelId")}> + {t("settings.apiConfig.modelId")} - Select a model... + {t("settings.apiConfig.selectModel")} {Object.keys(bedrockModels).map((modelId) => ( { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() const { handleFieldChange } = useApiConfigurationHandlers() - // Use debounced input for proper state management - const [baseUrlValue, setBaseUrlValue] = useDebouncedInput(apiConfiguration?.difyBaseUrl || "", (value) => - handleFieldChange("difyBaseUrl", value), - ) - - const [apiKeyValue, setApiKeyValue] = useDebouncedInput(apiConfiguration?.difyApiKey || "", (value) => - handleFieldChange("difyApiKey", value), - ) - // Get the normalized configuration const { selectedModelId, selectedModelInfo } = normalizeApiConfiguration(apiConfiguration, currentMode) @@ -37,10 +29,10 @@ export const DifyProvider = ({ showModelOptions, isPopup, currentMode }: DifyPro onChange={(value) => { handleFieldChange("difyBaseUrl", value) }} - placeholder={"Enter base URL..."} + placeholder={t("settings.apiConfig.enterBaseUrl")} style={{ width: "100%", marginBottom: 10 }} type="text"> - Base URL + {t("settings.apiConfig.baseUrl")}
-

- Dify is a platform that provides access to various AI models through a unified API. Configure your Dify - instance URL and API key to get started. -

+

{t("settings.apiConfig.difyDescription")}

- Note: The model selection is handled within your Dify application configuration. + {t("settings.apiConfig.note")} {t("settings.apiConfig.difyNote")}

diff --git a/webview-ui/src/components/settings/providers/FireworksProvider.tsx b/webview-ui/src/components/settings/providers/FireworksProvider.tsx index ca26126f..c70765c9 100644 --- a/webview-ui/src/components/settings/providers/FireworksProvider.tsx +++ b/webview-ui/src/components/settings/providers/FireworksProvider.tsx @@ -1,5 +1,6 @@ import { fireworksModels } from "@shared/api" import { Mode } from "@shared/storage/types" +import { useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { ApiKeyField } from "../common/ApiKeyField" import { ModelInfoView } from "../common/ModelInfoView" @@ -20,6 +21,7 @@ interface FireworksProviderProps { * The Fireworks provider configuration component */ export const FireworksProvider = ({ currentMode, isPopup, showModelOptions }: FireworksProviderProps) => { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() const { handleModeFieldChange, handleFieldChange } = useApiConfigurationHandlers() @@ -33,23 +35,27 @@ export const FireworksProvider = ({ currentMode, isPopup, showModelOptions }: Fi providerName="Fireworks" signupUrl="https://fireworks.ai/" /> - { - handleModeFieldChange( - { - plan: "planModeFireworksModelId", - act: "actModeFireworksModelId", - }, - e.target.value, - currentMode, - ) - }} - selectedModelId={selectedModelId} - /> + {showModelOptions && ( + <> + { + handleModeFieldChange( + { + plan: "planModeFireworksModelId", + act: "actModeFireworksModelId", + }, + e.target.value, + currentMode, + ) + }} + selectedModelId={selectedModelId} + /> - + + + )}
) } diff --git a/webview-ui/src/components/settings/providers/GeminiProvider.tsx b/webview-ui/src/components/settings/providers/GeminiProvider.tsx index 9aa51784..4e5ffae5 100644 --- a/webview-ui/src/components/settings/providers/GeminiProvider.tsx +++ b/webview-ui/src/components/settings/providers/GeminiProvider.tsx @@ -1,6 +1,7 @@ import { geminiModels } from "@shared/api" import { Mode } from "@shared/storage/types" import { VSCodeDropdown, VSCodeOption } from "@vscode/webview-ui-toolkit/react" +import { useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { ApiKeyField } from "../common/ApiKeyField" import { BaseUrlField } from "../common/BaseUrlField" @@ -31,6 +32,7 @@ interface GeminiProviderProps { * The Gemini provider configuration component */ export const GeminiProvider = ({ showModelOptions, isPopup, currentMode }: GeminiProviderProps) => { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() const { handleFieldChange, handleModeFieldChange } = useApiConfigurationHandlers() @@ -51,7 +53,6 @@ export const GeminiProvider = ({ showModelOptions, isPopup, currentMode }: Gemin handleFieldChange("geminiBaseUrl", value)} placeholder="Default: https://generativelanguage.googleapis.com" /> @@ -59,7 +60,7 @@ export const GeminiProvider = ({ showModelOptions, isPopup, currentMode }: Gemin {showModelOptions && ( <> handleModeFieldChange( @@ -83,7 +84,7 @@ export const GeminiProvider = ({ showModelOptions, isPopup, currentMode }: Gemin {selectedModelInfo.thinkingConfig?.supportsThinkingLevel && ( - Low - High + {t("settings.apiConfig.low")} + {t("settings.apiConfig.high")} )} diff --git a/webview-ui/src/components/settings/providers/HicapProvider.tsx b/webview-ui/src/components/settings/providers/HicapProvider.tsx index 1fb751ad..f95a27d3 100644 --- a/webview-ui/src/components/settings/providers/HicapProvider.tsx +++ b/webview-ui/src/components/settings/providers/HicapProvider.tsx @@ -1,4 +1,5 @@ import { Mode } from "@shared/storage/types" +import { useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { DebouncedTextField } from "../common/DebouncedTextField" import HicapModelPicker from "../HicapModelPicker" @@ -17,6 +18,7 @@ interface HicapProviderProps { * The Hicap provider configuration component */ export const HicapProvider = ({ showModelOptions, isPopup, currentMode }: HicapProviderProps) => { + const { t } = useTranslation() const { apiConfiguration, refreshHicapModels } = useExtensionState() const { handleFieldChange } = useApiConfigurationHandlers() @@ -31,7 +33,7 @@ export const HicapProvider = ({ showModelOptions, isPopup, currentMode }: HicapP refreshHicapModels() } }} - placeholder="Enter API Key..." + placeholder={t("settings.apiConfig.apiKeyPlaceholder")} style={{ width: "100%" }} type="password">
- Hicap API Key + Hicap {t("settings.providers.apiKey")}
diff --git a/webview-ui/src/components/settings/providers/HuggingFaceProvider.tsx b/webview-ui/src/components/settings/providers/HuggingFaceProvider.tsx index 43aecd33..06242f2d 100644 --- a/webview-ui/src/components/settings/providers/HuggingFaceProvider.tsx +++ b/webview-ui/src/components/settings/providers/HuggingFaceProvider.tsx @@ -1,8 +1,8 @@ import { Mode } from "@shared/storage/types" +import { Trans, useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { DebouncedTextField } from "../common/DebouncedTextField" import { HuggingFaceModelPicker } from "../HuggingFaceModelPicker" -import { normalizeApiConfiguration } from "../utils/providerUtils" import { useApiConfigurationHandlers } from "../utils/useApiConfigurationHandlers" /** @@ -18,21 +18,19 @@ interface HuggingFaceProviderProps { * The Hugging Face provider configuration component */ export const HuggingFaceProvider = ({ showModelOptions, isPopup, currentMode }: HuggingFaceProviderProps) => { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() const { handleFieldChange } = useApiConfigurationHandlers() - // Get the normalized configuration - const { selectedModelId, selectedModelInfo } = normalizeApiConfiguration(apiConfiguration, currentMode) - return (
handleFieldChange("huggingFaceApiKey", value)} - placeholder="Enter API Key..." + placeholder={t("settings.apiConfig.apiKeyPlaceholder")} style={{ width: "100%" }} type="password"> - Hugging Face API Key + {t("settings.apiConfig.huggingFaceApiKey")}

- This key is stored locally and only used to make API requests from this extension. We don’t show pricing here - because it depends on your Hugging Face provider settings and isn’t consistently available via their API{" "} - - Get your API key here - + + {t("settings.apiConfig.getHuggingFaceApiKey")} + + ), + }} + i18nKey="settings.apiConfig.huggingFaceDescription" + />

{showModelOptions && } diff --git a/webview-ui/src/components/settings/providers/LMStudioProvider.tsx b/webview-ui/src/components/settings/providers/LMStudioProvider.tsx index de5c8382..6da29e10 100644 --- a/webview-ui/src/components/settings/providers/LMStudioProvider.tsx +++ b/webview-ui/src/components/settings/providers/LMStudioProvider.tsx @@ -1,6 +1,7 @@ import type { Mode } from "@shared/storage/types" import { VSCodeDropdown, VSCodeLink, VSCodeOption, VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import { useCallback, useEffect, useMemo, useState } from "react" +import { Trans, useTranslation } from "react-i18next" import { useInterval } from "react-use" import UseCustomPromptCheckbox from "@/components/settings/UseCustomPromptCheckbox" import { useExtensionState } from "@/context/ExtensionStateContext" @@ -37,6 +38,7 @@ interface LMStudioApiModel { * The LM Studio provider configuration component */ export const LMStudioProvider = ({ currentMode }: LMStudioProviderProps) => { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() const { handleFieldChange, handleModeFieldChange } = useApiConfigurationHandlers() @@ -96,12 +98,11 @@ export const LMStudioProvider = ({ currentMode }: LMStudioProviderProps) => {
handleFieldChange("lmStudioBaseUrl", value)} placeholder="Default: http://localhost:1234" /> -
Model
+
{t("settings.providers.model")}
{lmStudioModels.length > 0 ? ( { /> )} -
Context Window
+
{t("settings.apiConfig.contextWindow")}
- LM Studio allows you to run models locally on your computer. For instructions on how to get started, see their - - quickstart guide. - - You will also need to start LM Studio's{" "} - - local server - {" "} - feature with lms server start to use it with this extension.{" "} + + {t("settings.apiConfig.lmStudioQuickstartGuide")} + + ), + localServerLink: ( + + {t("settings.apiConfig.lmStudioLocalServer")} + + ), + }} + i18nKey="settings.apiConfig.lmStudioDescription" + />{" "} + {t("settings.apiConfig.lmStudioServerStart")}{" "}
- Note: Cline uses complex prompts and works best with Claude models. - Less capable models may not work as expected. + {t("settings.apiConfig.note")}{" "} + {t("settings.apiConfig.clineBestWithClaude")}
diff --git a/webview-ui/src/components/settings/providers/MiniMaxProvider.tsx b/webview-ui/src/components/settings/providers/MiniMaxProvider.tsx index 92386fee..d89de5e4 100644 --- a/webview-ui/src/components/settings/providers/MiniMaxProvider.tsx +++ b/webview-ui/src/components/settings/providers/MiniMaxProvider.tsx @@ -1,6 +1,7 @@ import { minimaxModels } from "@shared/api" import { Mode } from "@shared/storage/types" import { VSCodeDropdown, VSCodeOption } from "@vscode/webview-ui-toolkit/react" +import { useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { ApiKeyField } from "../common/ApiKeyField" import { ModelInfoView } from "../common/ModelInfoView" @@ -21,6 +22,7 @@ interface MinimaxProviderProps { * The Minimax AI Studio provider configuration component */ export const MinimaxProvider = ({ showModelOptions, isPopup, currentMode }: MinimaxProviderProps) => { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() const { handleFieldChange, handleModeFieldChange } = useApiConfigurationHandlers() @@ -31,7 +33,7 @@ export const MinimaxProvider = ({ showModelOptions, isPopup, currentMode }: Mini
- Select the API endpoint according to your region: api.minimaxi.com for China, or{" "} - api.minimax.io for all other locations. + {t("settings.apiConfig.minimaxEndpointDescription")}

handleModeFieldChange( diff --git a/webview-ui/src/components/settings/providers/MoonshotProvider.tsx b/webview-ui/src/components/settings/providers/MoonshotProvider.tsx index 2ad33cec..e1c0038a 100644 --- a/webview-ui/src/components/settings/providers/MoonshotProvider.tsx +++ b/webview-ui/src/components/settings/providers/MoonshotProvider.tsx @@ -2,6 +2,7 @@ import { moonshotModels } from "@shared/api" import { UpdateApiConfigurationRequestNew } from "@shared/proto/index.cline" import { Mode } from "@shared/storage/types" import { VSCodeDropdown, VSCodeOption } from "@vscode/webview-ui-toolkit/react" +import { useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { ModelsServiceClient } from "@/services/grpc-client" import { ApiKeyField } from "../common/ApiKeyField" @@ -22,6 +23,7 @@ interface MoonshotProviderProps { * The Moonshot AI Studio provider configuration component */ export const MoonshotProvider = ({ showModelOptions, isPopup, currentMode }: MoonshotProviderProps) => { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() // Get the normalized configuration @@ -31,7 +33,7 @@ export const MoonshotProvider = ({ showModelOptions, isPopup, currentMode }: Moo
{ await ModelsServiceClient.updateApiConfiguration( @@ -83,7 +85,7 @@ export const MoonshotProvider = ({ showModelOptions, isPopup, currentMode }: Moo {showModelOptions && ( <> { const value = e.target.value diff --git a/webview-ui/src/components/settings/providers/NebiusProvider.tsx b/webview-ui/src/components/settings/providers/NebiusProvider.tsx index d63f0af5..030e059e 100644 --- a/webview-ui/src/components/settings/providers/NebiusProvider.tsx +++ b/webview-ui/src/components/settings/providers/NebiusProvider.tsx @@ -1,5 +1,6 @@ import { nebiusModels } from "@shared/api" import { Mode } from "@shared/storage/types" +import { useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { ApiKeyField } from "../common/ApiKeyField" import { ModelInfoView } from "../common/ModelInfoView" @@ -20,6 +21,7 @@ interface NebiusProviderProps { * The Nebius AI Studio provider configuration component */ export const NebiusProvider = ({ showModelOptions, isPopup, currentMode }: NebiusProviderProps) => { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() const { handleFieldChange, handleModeFieldChange } = useApiConfigurationHandlers() @@ -28,7 +30,7 @@ export const NebiusProvider = ({ showModelOptions, isPopup, currentMode }: Nebiu return (
handleFieldChange("nebiusApiKey", value)} providerName="Nebius" @@ -38,7 +40,7 @@ export const NebiusProvider = ({ showModelOptions, isPopup, currentMode }: Nebiu {showModelOptions && ( <> handleModeFieldChange( diff --git a/webview-ui/src/components/settings/providers/OllamaProvider.tsx b/webview-ui/src/components/settings/providers/OllamaProvider.tsx index 0702d7f2..a2c8ebf4 100644 --- a/webview-ui/src/components/settings/providers/OllamaProvider.tsx +++ b/webview-ui/src/components/settings/providers/OllamaProvider.tsx @@ -2,6 +2,7 @@ import { StringRequest } from "@shared/proto/cline/common" import { Mode } from "@shared/storage/types" import { VSCodeLink } from "@vscode/webview-ui-toolkit/react" import { useCallback, useEffect, useState } from "react" +import { Trans, useTranslation } from "react-i18next" import { useInterval } from "react-use" import UseCustomPromptCheckbox from "@/components/settings/UseCustomPromptCheckbox" import { useExtensionState } from "@/context/ExtensionStateContext" @@ -25,7 +26,8 @@ interface OllamaProviderProps { /** * The Ollama provider configuration component */ -export const OllamaProvider = ({ showModelOptions, isPopup, currentMode }: OllamaProviderProps) => { +export const OllamaProvider = ({ showModelOptions, currentMode }: OllamaProviderProps) => { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() const { handleFieldChange, handleModeFieldChange } = useApiConfigurationHandlers() @@ -60,40 +62,38 @@ export const OllamaProvider = ({ showModelOptions, isPopup, currentMode }: Ollam
handleFieldChange("ollamaBaseUrl", value)} placeholder="Default: http://localhost:11434" /> {apiConfiguration?.ollamaBaseUrl && ( handleFieldChange("ollamaApiKey", value)} - placeholder="Enter API Key (optional)..." + placeholder={t("settings.apiConfig.enterApiKeyOptional")} providerName="Ollama" /> )} {/* Model selection - use filterable picker */} { handleModeFieldChange({ plan: "planModeOllamaModelId", act: "actModeOllamaModelId" }, modelId, currentMode) }} - placeholder={ollamaModels.length > 0 ? "Search and select a model..." : "e.g. llama3.1"} + placeholder={ + ollamaModels.length > 0 ? t("settings.apiConfig.searchAndSelectModel") : t("settings.apiConfig.modelExample") + } selectedModelId={ollamaModelId || ""} /> {/* Show status message based on model availability */} {ollamaModels.length === 0 && ( -

- Unable to fetch models from Ollama server. Please ensure Ollama is running and accessible, or enter the model - ID manually above. -

+

{t("settings.apiConfig.unableToFetchModels")}

)} handleFieldChange("ollamaApiOptionsCtxNum", v || undefined)} placeholder={"e.g. 32768"} style={{ width: "100%" }}> - Model Context Window + {t("settings.apiConfig.modelContextWindow")} {showModelOptions && ( @@ -117,11 +117,9 @@ export const OllamaProvider = ({ showModelOptions, isPopup, currentMode }: Ollam }} placeholder="Default: 30000 (30 seconds)" style={{ width: "100%" }}> - Request Timeout (ms) + {t("settings.apiConfig.requestTimeout")} -

- Maximum time in milliseconds to wait for API responses before timing out. -

+

{t("settings.apiConfig.requestTimeoutDescription")}

)} @@ -133,15 +131,21 @@ export const OllamaProvider = ({ showModelOptions, isPopup, currentMode }: Ollam marginTop: "5px", color: "var(--vscode-descriptionForeground)", }}> - Ollama allows you to run models locally on your computer. For instructions on how to get started, see their{" "} - - quickstart guide. - {" "} + + {t("settings.apiConfig.quickstartGuide")} + + ), + }} + i18nKey="settings.apiConfig.ollamaDescription" + />{" "} - (Note: Cline uses complex prompts and works best with Claude models. - Less capable models may not work as expected.) + ({t("settings.apiConfig.note")}{" "} + {t("settings.apiConfig.clineBestWithClaude")})

diff --git a/webview-ui/src/components/settings/providers/OpenAICompatible.tsx b/webview-ui/src/components/settings/providers/OpenAICompatible.tsx index a2c52732..6bc53f06 100644 --- a/webview-ui/src/components/settings/providers/OpenAICompatible.tsx +++ b/webview-ui/src/components/settings/providers/OpenAICompatible.tsx @@ -4,6 +4,7 @@ import { OpenAiModelsRequest } from "@shared/proto/cline/models" import { Mode } from "@shared/storage/types" import { VSCodeButton, VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react" import { useCallback, useEffect, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { Tooltip } from "@/components/ui/tooltip" import { useExtensionState } from "@/context/ExtensionStateContext" import { ModelsServiceClient } from "@/services/grpc-client" @@ -28,6 +29,7 @@ interface OpenAICompatibleProviderProps { * The OpenAI Compatible provider configuration component */ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMode }: OpenAICompatibleProviderProps) => { + const { t } = useTranslation() const { apiConfiguration, remoteConfigSettings } = useExtensionState() const { handleFieldChange, handleModeFieldChange } = useApiConfigurationHandlers() @@ -75,7 +77,7 @@ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMod
- Base URL + {t("settings.apiConfig.baseUrl")} {remoteConfigSettings?.openAiBaseUrl !== undefined && ( )} @@ -87,14 +89,14 @@ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMod handleFieldChange("openAiBaseUrl", value) debouncedRefreshOpenAiModels(value, apiConfiguration?.openAiApiKey) }} - placeholder={"Enter base URL..."} + placeholder={t("settings.apiConfig.enterBaseUrl")} style={{ width: "100%", marginBottom: 10 }} type="text" />
@@ -112,9 +114,9 @@ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMod onChange={(value) => handleModeFieldChange({ plan: "planModeOpenAiModelId", act: "actModeOpenAiModelId" }, value, currentMode) } - placeholder={"Enter Model ID..."} + placeholder={t("settings.apiConfig.enterModelId")} style={{ width: "100%", marginBottom: 10 }}> - Model ID + {t("settings.apiConfig.modelId")} {/* OpenAI Compatible Custom Headers */} @@ -134,7 +136,7 @@ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMod
- {headerEntries.map(([key, value], index) => ( -
+ {headerEntries.map(([key, value]) => ( +
- This setting is managed by your organization's remote configuration + {t("settings.apiConfig.remoteConfigManaged")} ) : ( { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() const { handleFieldChange } = useApiConfigurationHandlers() @@ -67,11 +69,11 @@ export const OpenRouterProvider = ({ showModelOptions, isPopup, currentMode }: O handleFieldChange("openRouterApiKey", value)} - placeholder="Enter API Key..." + placeholder={t("settings.apiConfig.apiKeyPlaceholder")} style={{ width: "100%" }} type="password">
- OpenRouter API Key + OpenRouter {t("settings.providers.apiKey")} {apiConfiguration?.openRouterApiKey && ( )} @@ -88,7 +90,7 @@ export const OpenRouterProvider = ({ showModelOptions, isPopup, currentMode }: O } }} style={{ margin: "5px 0 0 0" }}> - Get OpenRouter API Key + {t("settings.apiConfig.getOpenRouterApiKey")} )}

- This key is stored locally and only used to make API requests from this extension. + {t("settings.apiConfig.apiKeyStoredLocally")}

- {showModelOptions && ( - <> - - - )} + {showModelOptions && }
) } diff --git a/webview-ui/src/components/settings/providers/RequestyProvider.tsx b/webview-ui/src/components/settings/providers/RequestyProvider.tsx index e99fb455..bc6e3856 100644 --- a/webview-ui/src/components/settings/providers/RequestyProvider.tsx +++ b/webview-ui/src/components/settings/providers/RequestyProvider.tsx @@ -3,6 +3,7 @@ import { StringRequest } from "@shared/proto/cline/common" import { Mode } from "@shared/storage/types" import { VSCodeButton, VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react" import { useState } from "react" +import { useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { AccountServiceClient } from "@/services/grpc-client" import { ApiKeyField } from "../common/ApiKeyField" @@ -23,6 +24,7 @@ interface RequestyProviderProps { * The Requesty provider configuration component */ export const RequestyProvider = ({ showModelOptions, isPopup, currentMode }: RequestyProviderProps) => { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() const { handleFieldChange } = useApiConfigurationHandlers() @@ -54,7 +56,7 @@ export const RequestyProvider = ({ showModelOptions, isPopup, currentMode }: Req } }} style={{ margin: "5px 0 0 0" }}> - Get Requesty API Key + {t("settings.apiConfig.getRequestyApiKey")} )} - Use custom base URL + {t("settings.apiConfig.useCustomBaseUrl")} {requestyEndpointSelected && ( diff --git a/webview-ui/src/components/settings/providers/TogetherProvider.tsx b/webview-ui/src/components/settings/providers/TogetherProvider.tsx index ce487b40..a7eb1f62 100644 --- a/webview-ui/src/components/settings/providers/TogetherProvider.tsx +++ b/webview-ui/src/components/settings/providers/TogetherProvider.tsx @@ -1,4 +1,5 @@ import { Mode } from "@shared/storage/types" +import { useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { ApiKeyField } from "../common/ApiKeyField" import { DebouncedTextField } from "../common/DebouncedTextField" @@ -17,7 +18,8 @@ interface TogetherProviderProps { /** * The Together provider configuration component */ -export const TogetherProvider = ({ showModelOptions, isPopup, currentMode }: TogetherProviderProps) => { +export const TogetherProvider = ({ currentMode }: TogetherProviderProps) => { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() const { handleFieldChange, handleModeFieldChange } = useApiConfigurationHandlers() @@ -35,9 +37,9 @@ export const TogetherProvider = ({ showModelOptions, isPopup, currentMode }: Tog onChange={(value) => handleModeFieldChange({ plan: "planModeTogetherModelId", act: "actModeTogetherModelId" }, value, currentMode) } - placeholder={"Enter Model ID..."} + placeholder={t("settings.apiConfig.enterModelId")} style={{ width: "100%" }}> - Model ID + {t("settings.apiConfig.modelId")}

- (Note: Cline uses complex prompts and works best with Claude models. - Less capable models may not work as expected.) + ({t("settings.apiConfig.note")}{" "} + {t("settings.apiConfig.clineBestWithClaude")})

diff --git a/webview-ui/src/components/settings/providers/VercelAIGatewayProvider.tsx b/webview-ui/src/components/settings/providers/VercelAIGatewayProvider.tsx index a5559fa1..a972858c 100644 --- a/webview-ui/src/components/settings/providers/VercelAIGatewayProvider.tsx +++ b/webview-ui/src/components/settings/providers/VercelAIGatewayProvider.tsx @@ -1,5 +1,6 @@ import { Mode } from "@shared/storage/types" import { VSCodeLink } from "@vscode/webview-ui-toolkit/react" +import { Trans, useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { DebouncedTextField } from "../common/DebouncedTextField" import OpenRouterModelPicker from "../OpenRouterModelPicker" @@ -18,6 +19,7 @@ interface VercelAIGatewayProviderProps { * The Vercel AI Gateway provider configuration component */ export const VercelAIGatewayProvider = ({ showModelOptions, isPopup, currentMode }: VercelAIGatewayProviderProps) => { + const { t } = useTranslation() const { apiConfiguration } = useExtensionState() const { handleFieldChange } = useApiConfigurationHandlers() @@ -27,10 +29,10 @@ export const VercelAIGatewayProvider = ({ showModelOptions, isPopup, currentMode handleFieldChange("vercelAiGatewayApiKey", value)} - placeholder="Enter API Key..." + placeholder={t("settings.apiConfig.apiKeyPlaceholder")} style={{ width: "100%" }} type="password"> - Vercel AI Gateway API Key + {t("settings.apiConfig.vercelAiGatewayApiKey")}

- This key is stored locally and only used to make API requests from this extension. + {t("settings.apiConfig.apiKeyStoredLocally")} {!apiConfiguration?.vercelAiGatewayApiKey && ( <> {" "} - You can get a Vercel AI Gateway API key by{" "} - - signing up here. - + + {t("settings.apiConfig.signingUpHere")} + + ), + }} + i18nKey="settings.apiConfig.getVercelAiGatewayApiKey" + /> )}

- {showModelOptions && ( - <> - - - )} + {showModelOptions && }
) } diff --git a/webview-ui/src/locales/en/common.json b/webview-ui/src/locales/en/common.json index 2171f3c3..205f7d45 100644 --- a/webview-ui/src/locales/en/common.json +++ b/webview-ui/src/locales/en/common.json @@ -278,6 +278,78 @@ "configureInSettings": "Configure in settings", "noModelsFound": "No models found", "projectIdPlaceholder": "Enter Project ID...", + "apiKeyPlaceholder": "Enter API Key...", + "apiKeyStoredLocally": "This key is stored locally and only used to make API requests from this extension.", + "getApiKey": "You can get a {providerName} API key by signing up here.", + "getApiKeyAn": "You can get an {providerName} API key by signing up here.", + "useCustomBaseUrl": "Use custom base URL", + "enterModelId": "Enter Model ID...", + "modelId": "Model ID", + "baseUrl": "Base URL", + "enterBaseUrl": "Enter base URL...", + "note": "Note:", + "clineBestWithClaude": "Cline uses complex prompts and works best with Claude models. Less capable models may not work as expected.", + "getOpenRouterApiKey": "Get OpenRouter API Key", + "getRequestyApiKey": "Get Requesty API Key", + "thinkingLevel": "Thinking Level", + "low": "Low", + "high": "High", + "customBaseUrl": "Custom base URL", + "optionalApiKey": "Optional API key for authenticated Ollama instances or cloud services. Leave empty for local installations.", + "enterApiKeyOptional": "Enter API Key (optional)...", + "searchAndSelectModel": "Search and select a model...", + "modelExample": "e.g. llama3.1", + "unableToFetchModels": "Unable to fetch models from Ollama server. Please ensure Ollama is running and accessible, or enter the model ID manually above.", + "modelContextWindow": "Model Context Window", + "requestTimeout": "Request Timeout (ms)", + "requestTimeoutDescription": "Maximum time in milliseconds to wait for API responses before timing out.", + "ollamaDescription": "Ollama allows you to run models locally on your computer. For instructions on how to get started, see their ", + "quickstartGuide": "quickstart guide", + "awsProfile": "AWS Profile", + "awsCredentials": "AWS Credentials", + "awsProfileName": "AWS Profile Name", + "enterProfileName": "Enter profile name (default if empty)", + "enterBedrockApiKey": "Enter Bedrock Api Key", + "awsBedrockApiKey": "AWS Bedrock Api Key", + "awsAccessKey": "AWS Access Key", + "enterAccessKey": "Enter Access Key...", + "awsSecretKey": "AWS Secret Key", + "enterSecretKey": "Enter Secret Key...", + "awsSessionToken": "AWS Session Token", + "enterSessionToken": "Enter Session Token...", + "awsRegion": "AWS Region", + "selectRegion": "Select a region...", + "useCustomVpcEndpoint": "Use custom VPC endpoint", + "enterVpcEndpointUrl": "Enter VPC Endpoint URL (optional)", + "useCrossRegionInference": "Use cross-region inference", + "useGlobalInferenceProfile": "Use global inference profile", + "usePromptCaching": "Use prompt caching", + "awsProfileDescription": "Using AWS Profile credentials from ~/.aws/credentials. Leave profile name empty to use the default profile. These credentials are only used locally to make API requests from this extension.", + "awsCredentialsDescription": "Authenticate by either providing the keys above or use the default AWS credential providers, i.e. ~/.aws/credentials or environment variables. These credentials are only used locally to make API requests from this extension.", + "selectModel": "Select a model...", + "custom": "Custom", + "customModelDescription": "Select \"Custom\" when using the Application Inference Profile in Bedrock. Enter the Application Inference Profile ARN in the Model ID field.", + "enterCustomModelId": "Enter custom model ID...", + "baseInferenceModel": "Base Inference Model", + "contextWindow": "Context Window", + "notEditable": "Not editable - the value is returned by the connected endpoint", + "lmStudioDescription": "LM Studio allows you to run models locally on your computer. For instructions on how to get started, see their You will also need to start LM Studio's ", + "lmStudioQuickstartGuide": "quickstart guide", + "lmStudioLocalServer": "local server", + "lmStudioServerStart": "feature with lms server start to use it with this extension.", + "huggingFaceApiKey": "Hugging Face API Key", + "huggingFaceDescription": "This key is stored locally and only used to make API requests from this extension. We don't show pricing here because it depends on your Hugging Face provider settings and isn't consistently available via their API ", + "getHuggingFaceApiKey": "Get your API key here", + "difyDescription": "Dify is a platform that provides access to various AI models through a unified API. Configure your Dify instance URL and API key to get started.", + "difyNote": "The model selection is handled within your Dify application configuration.", + "minimaxEntrypoint": "MiniMax Entrypoint", + "minimaxEndpointDescription": "Select the API endpoint according to your region: api.minimaxi.com for China, or api.minimax.io for all other locations.", + "moonshotEntrypoint": "Moonshot Entrypoint", + "askSageApiUrl": "AskSage API URL", + "enterAskSageApiUrl": "Enter AskSage API URL...", + "vercelAiGatewayApiKey": "Vercel AI Gateway API Key", + "getVercelAiGatewayApiKey": "You can get a Vercel AI Gateway API key by ", + "signingUpHere": "signing up here", "providerHelpText": { "lmstudio": "Start LM Studio and load a model to begin", "ollama": "Run `ollama serve` and pull a model", diff --git a/webview-ui/src/locales/zh-CN/common.json b/webview-ui/src/locales/zh-CN/common.json index aad7ef1c..1696993b 100644 --- a/webview-ui/src/locales/zh-CN/common.json +++ b/webview-ui/src/locales/zh-CN/common.json @@ -278,6 +278,78 @@ "configureInSettings": "在设置中配置", "noModelsFound": "未找到模型", "projectIdPlaceholder": "输入项目 ID...", + "apiKeyPlaceholder": "输入 API 密钥...", + "apiKeyStoredLocally": "此密钥存储在本地,仅用于从此扩展程序发出 API 请求。", + "getApiKey": "您可以通过在此处注册获取 {providerName} API 密钥。", + "getApiKeyAn": "您可以通过在此处注册获取 {providerName} API 密钥。", + "useCustomBaseUrl": "使用自定义基础 URL", + "enterModelId": "输入模型 ID...", + "modelId": "模型 ID", + "baseUrl": "基础 URL", + "enterBaseUrl": "输入基础 URL...", + "note": "注意:", + "clineBestWithClaude": "Cline 使用复杂的提示,最适合与 Claude 模型配合使用。能力较弱的模型可能无法按预期工作。", + "getOpenRouterApiKey": "获取 OpenRouter API 密钥", + "getRequestyApiKey": "获取 Requesty API 密钥", + "thinkingLevel": "思考层级", + "low": "低", + "high": "高", + "customBaseUrl": "自定义基础 URL", + "optionalApiKey": "用于经过身份验证的 Ollama 实例或云服务的可选 API 密钥。对于本地安装,请留空。", + "enterApiKeyOptional": "输入 API 密钥(可选)...", + "searchAndSelectModel": "搜索并选择模型...", + "modelExample": "例如:llama3.1", + "unableToFetchModels": "无法从 Ollama 服务器获取模型。请确保 Ollama 正在运行且可访问,或在上方手动输入模型 ID。", + "modelContextWindow": "模型上下文窗口", + "requestTimeout": "请求超时(毫秒)", + "requestTimeoutDescription": "在超时之前等待 API 响应的最大时间(以毫秒为单位)。", + "ollamaDescription": "Ollama 允许您在本地计算机上运行模型。有关如何开始的说明,请参阅其 ", + "quickstartGuide": "快速入门指南", + "awsProfile": "AWS 配置文件", + "awsCredentials": "AWS 凭据", + "awsProfileName": "AWS 配置文件名称", + "enterProfileName": "输入配置文件名称(如果为空则使用默认值)", + "enterBedrockApiKey": "输入 Bedrock API 密钥", + "awsBedrockApiKey": "AWS Bedrock API 密钥", + "awsAccessKey": "AWS 访问密钥", + "enterAccessKey": "输入访问密钥...", + "awsSecretKey": "AWS 密钥", + "enterSecretKey": "输入密钥...", + "awsSessionToken": "AWS 会话令牌", + "enterSessionToken": "输入会话令牌...", + "awsRegion": "AWS 区域", + "selectRegion": "选择区域...", + "useCustomVpcEndpoint": "使用自定义 VPC 端点", + "enterVpcEndpointUrl": "输入 VPC 端点 URL(可选)", + "useCrossRegionInference": "使用跨区域推理", + "useGlobalInferenceProfile": "使用全局推理配置文件", + "usePromptCaching": "使用提示缓存", + "awsProfileDescription": "使用来自 ~/.aws/credentials 的 AWS 配置文件凭据。如果配置文件名称为空,则使用默认配置文件。这些凭据仅在本地用于从此扩展程序发出 API 请求。", + "awsCredentialsDescription": "通过提供上述密钥或使用默认的 AWS 凭据提供程序(即 ~/.aws/credentials 或环境变量)进行身份验证。这些凭据仅在本地用于从此扩展程序发出 API 请求。", + "selectModel": "选择模型...", + "custom": "自定义", + "customModelDescription": "在 Bedrock 中使用应用程序推理配置文件时选择\"自定义\"。在模型 ID 字段中输入应用程序推理配置文件 ARN。", + "enterCustomModelId": "输入自定义模型 ID...", + "baseInferenceModel": "基础推理模型", + "contextWindow": "上下文窗口", + "notEditable": "不可编辑 - 该值由连接的端点返回", + "lmStudioDescription": "LM Studio 允许您在本地计算机上运行模型。有关如何开始的说明,请参阅其 您还需要启动 LM Studio 的 ", + "lmStudioQuickstartGuide": "快速入门指南", + "lmStudioLocalServer": "本地服务器", + "lmStudioServerStart": "功能(使用 lms server start 启动)以与此扩展程序一起使用。", + "huggingFaceApiKey": "Hugging Face API 密钥", + "huggingFaceDescription": "此密钥存储在本地,仅用于从此扩展程序发出 API 请求。我们在此不显示定价,因为它取决于您的 Hugging Face 提供商设置,并且无法通过其 API 一致地获取 ", + "getHuggingFaceApiKey": "在此处获取您的 API 密钥", + "difyDescription": "Dify 是一个通过统一 API 提供对各种 AI 模型访问的平台。配置您的 Dify 实例 URL 和 API 密钥以开始使用。", + "difyNote": "模型选择在您的 Dify 应用程序配置中处理。", + "minimaxEntrypoint": "MiniMax 入口点", + "minimaxEndpointDescription": "根据您的区域选择 API 端点:中国使用 api.minimaxi.com,其他所有地区使用 api.minimax.io。", + "moonshotEntrypoint": "Moonshot 入口点", + "askSageApiUrl": "AskSage API URL", + "enterAskSageApiUrl": "输入 AskSage API URL...", + "vercelAiGatewayApiKey": "Vercel AI Gateway API 密钥", + "getVercelAiGatewayApiKey": "您可以通过 获取 Vercel AI Gateway API 密钥", + "signingUpHere": "在此处注册", "providerHelpText": { "lmstudio": "启动 LM Studio 并加载模型以开始", "ollama": "运行 `ollama serve` 并拉取模型",