From b263b6adba806249a2599e68c43c8a61238e5d72 Mon Sep 17 00:00:00 2001 From: brownrw8 Date: Tue, 21 Jan 2025 13:21:02 -1000 Subject: [PATCH] more translations, mostly settings --- .../src/components/settings/ApiOptions.tsx | 168 ++++++++---------- webview-ui/src/i18n.ts | 2 +- webview-ui/src/locales/de/translation.json | 47 +++++ webview-ui/src/locales/en/translation.json | 46 +++++ webview-ui/src/locales/ja/translation.json | 47 +++++ webview-ui/src/locales/zh-cn/translation.json | 47 +++++ webview-ui/src/locales/zh-tw/translation.json | 47 +++++ 7 files changed, 314 insertions(+), 90 deletions(-) diff --git a/webview-ui/src/components/settings/ApiOptions.tsx b/webview-ui/src/components/settings/ApiOptions.tsx index 07f0076dc3..b3e57a43e2 100644 --- a/webview-ui/src/components/settings/ApiOptions.tsx +++ b/webview-ui/src/components/settings/ApiOptions.tsx @@ -32,6 +32,8 @@ import { vertexDefaultModelId, vertexModels, } from "../../../../src/shared/api" +import { useTranslation } from "react-i18next" +import { Trans } from "react-i18next" import { ExtensionMessage } from "../../../../src/shared/ExtensionMessage" import { useExtensionState } from "../../context/ExtensionStateContext" import { vscode } from "../../utils/vscode" @@ -72,6 +74,7 @@ declare module "vscode" { } const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, isPopup }: ApiOptionsProps) => { + const { t, ready } = useTranslation("translation", { keyPrefix: "apiOptions", useSuspense: false }) const { apiConfiguration, setApiConfiguration, uriScheme } = useExtensionState() const [ollamaModels, setOllamaModels] = useState([]) const [lmStudioModels, setLmStudioModels] = useState([]) @@ -144,7 +147,7 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is value={selectedModelId} onChange={handleInputChange("apiModelId")} style={{ width: "100%" }}> - Select a model... + {t("selectModel")} {Object.keys(models).map((modelId) => ( GCP Vertex AI AWS Bedrock OpenAI - OpenAI Compatible + {t("getCompatibleVendor", { vendor: "OpenAI" })} VS Code LM API LM Studio Ollama @@ -197,7 +200,7 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is style={{ width: "100%" }} type="password" onInput={handleInputChange("apiKey")} - placeholder="Enter API Key..."> + placeholder={t("enterApiKey")}> Anthropic API Key @@ -213,7 +216,7 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is }) } }}> - Use custom base URL + {t("useCustomBaseUrl")} {anthropicBaseUrlSelected && ( @@ -232,7 +235,7 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is marginTop: 3, color: "var(--vscode-descriptionForeground)", }}> - This key is stored locally and only used to make API requests from this extension. + {t("apiKeyInfo")} {!apiConfiguration?.apiKey && ( - You can get an Anthropic API key by signing up here. + {t("getApiKeyMessage", { vendor: "Anthropic" })} )}

@@ -254,8 +257,8 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is style={{ width: "100%" }} type="password" onInput={handleInputChange("openAiNativeApiKey")} - placeholder="Enter API Key..."> - OpenAI API Key + placeholder={t("enterApiKey")}> + {t("getApiVendorKey", { vendor: "OpenAI" })}

- This key is stored locally and only used to make API requests from this extension. + {t("apiKeyInfo")} {!apiConfiguration?.openAiNativeApiKey && ( - You can get an OpenAI API key by signing up here. + {t("getApiKeyMessage", { vendor: "OpenAI" })} )}

@@ -285,8 +288,8 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is style={{ width: "100%" }} type="password" onInput={handleInputChange("deepSeekApiKey")} - placeholder="Enter API Key..."> - DeepSeek API Key + placeholder={t("enterApiKey")}> + {t("getApiVendorKey", { vendor: "DeepSeek" })}

- This key is stored locally and only used to make API requests from this extension. + {t("apiKeyInfo")} {!apiConfiguration?.deepSeekApiKey && ( - You can get a DeepSeek API key by signing up here. + {t("getApiKeyMessage", { vendor: "DeepSeek" })} )}

@@ -316,8 +319,8 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is style={{ width: "100%" }} type="password" onInput={handleInputChange("mistralApiKey")} - placeholder="Enter API Key..."> - Mistral API Key + placeholder={t("enterApiKey")}> + {t("getApiVendorKey", { vendor: "Mistral" })}

- This key is stored locally and only used to make API requests from this extension. + {t("apiKeyInfo")} {!apiConfiguration?.mistralApiKey && ( - You can get a Mistral API key by signing up here. + {t("getApiKeyMessage", { vendor: "Mistral" })} )}

@@ -347,15 +350,15 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is style={{ width: "100%" }} type="password" onInput={handleInputChange("openRouterApiKey")} - placeholder="Enter API Key..."> - OpenRouter API Key + placeholder={t("enterApiKey")}> + {t("getApiVendorKey", { vendor: "OpenRouter" })} {!apiConfiguration?.openRouterApiKey && ( - Get OpenRouter API Key + {t("getApiKeyMessage", { vendor: "OpenRouter" })} )}

- This key is stored locally and only used to make API requests from this extension.{" "} - {/* {!apiConfiguration?.openRouterApiKey && ( - - (Note: OpenRouter is recommended for high rate - limits, prompt caching, and wider selection of models.) - - )} */} + {t("apiKeyInfo")}

)} @@ -387,35 +384,35 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is style={{ width: "100%" }} type="password" onInput={handleInputChange("awsAccessKey")} - placeholder="Enter Access Key..."> - AWS Access Key + placeholder={t("enterAwsAccessKey")}> + {t("awsAccessKey")} - AWS Secret Key + placeholder={t("enterAwsSecretKey")}> + {t("awsSecretKey")} - AWS Session Token + placeholder={t("enterAwsSessionToken")}> + {t("awsSessionToken")}
- Select a region... + {t("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. */} us-east-1 us-east-2 @@ -452,7 +449,7 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is awsUseCrossRegionInference: isChecked, }) }}> - Use cross-region inference + {t("useCrossRegionInference")}

- 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("awsInfo")}

)} @@ -478,19 +473,19 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is value={apiConfiguration?.vertexProjectId || ""} style={{ width: "100%" }} onInput={handleInputChange("vertexProjectId")} - placeholder="Enter Project ID..."> - Google Cloud Project ID + placeholder={t("enterGcpProjectId")}> + {t("gcpProjectId")}
- Select a region... + {t("selectRegion")} us-east5 us-central1 europe-west1 @@ -504,17 +499,12 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is marginTop: "5px", color: "var(--vscode-descriptionForeground)", }}> - To use Google Cloud Vertex AI, you need to - - {"1) create a Google Cloud account › enable the Vertex AI API › enable the desired Claude models,"} - {" "} - - {"2) install the Google Cloud CLI › configure Application Default Credentials."} - + , + }} + />

)} @@ -527,7 +517,7 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is type="password" onInput={handleInputChange("geminiApiKey")} placeholder="Enter API Key..."> - Gemini API Key + {t("getApiVendorKey", { vendor: "Gemini" })}

- This key is stored locally and only used to make API requests from this extension. + {t("apiKeyInfo")} {!apiConfiguration?.geminiApiKey && ( - You can get a Gemini API key by signing up here. + {t("getApiKeyMessage", { vendor: "Gemini" })} )}

@@ -557,23 +547,23 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is style={{ width: "100%" }} type="url" onInput={handleInputChange("openAiBaseUrl")} - placeholder={"Enter base URL..."}> - Base URL + placeholder={t("enterBaseUrl")}> + {t("baseUrl")} - API Key + placeholder={t("enterApiKey")}> + {t("apiKey")} - Model ID + placeholder={t("enterModelId")}> + {t("modelId")}
{vsCodeLmModels.length > 0 ? ( - Select a model... + {t("selectModel")} {vsCodeLmModels.map((model) => ( - The VS Code Language Model API allows you to run models provided by other VS Code extensions - (including but not limited to GitHub Copilot). The easiest way to get started is to install the - Copilot extension from the VS Marketplace and enabling Claude 3.5 Sonnet. + {t("vscodeLanguageModelsInfo")}

)} @@ -667,7 +655,7 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is color: "var(--vscode-errorForeground)", fontWeight: 500, }}> - Note: This is a very experimental integration and may not work as expected. + {t("experimentalFeature")}

@@ -688,7 +676,7 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is style={{ width: "100%" }} onInput={handleInputChange("lmStudioModelId")} placeholder={"e.g. meta-llama-3.1-8b-instruct"}> - Model ID + {t("modelId")} {lmStudioModels.length > 0 && (
{selectedProvider === "anthropic" && createDropdown(anthropicModels)} {selectedProvider === "bedrock" && createDropdown(bedrockModels)} @@ -884,6 +872,7 @@ export const ModelInfoView = ({ isPopup?: boolean }) => { const isGemini = Object.keys(geminiModels).includes(selectedModelId) + const { t, ready } = useTranslation("translation", { keyPrefix: "apiOptions", useSuspense: false }) const infoItems = [ modelInfo.description && ( @@ -898,56 +887,57 @@ export const ModelInfoView = ({ , , !isGemini && ( ), modelInfo.maxTokens !== undefined && modelInfo.maxTokens > 0 && ( - Max output: {modelInfo.maxTokens?.toLocaleString()} tokens + {t("maxOutput")}: {modelInfo.maxTokens?.toLocaleString()} {t("tokens")} ), modelInfo.inputPrice !== undefined && modelInfo.inputPrice > 0 && ( - Input price: {formatPrice(modelInfo.inputPrice)}/million tokens + {t("inputPrice")}: {formatPrice(modelInfo.inputPrice)}/ + {t("millionTokens")} ), modelInfo.supportsPromptCache && modelInfo.cacheWritesPrice && ( - Cache writes price: {formatPrice(modelInfo.cacheWritesPrice || 0)} - /million tokens + {t("cacheWritesPrice")}: {formatPrice(modelInfo.cacheWritesPrice || 0)}/ + {t("millionTokens")} ), modelInfo.supportsPromptCache && modelInfo.cacheReadsPrice && ( - Cache reads price: {formatPrice(modelInfo.cacheReadsPrice || 0)}/million - tokens + {t("cacheReadsPrice")}: {formatPrice(modelInfo.cacheReadsPrice || 0)}/ + {t("millionTokens")} ), modelInfo.outputPrice !== undefined && modelInfo.outputPrice > 0 && ( - Output price: {formatPrice(modelInfo.outputPrice)}/million tokens + {t("outputPrice")}: {formatPrice(modelInfo.outputPrice)}/ + {t("millionTokens")} ), isGemini && ( - * Free up to {selectedModelId && selectedModelId.includes("flash") ? "15" : "2"} requests per minute. After that, - billing depends on prompt size.{" "} + {t("geminiInfo", { selectedModelId })}{" "} - For more info, see pricing details. + {t("pricingDetails")} ), diff --git a/webview-ui/src/i18n.ts b/webview-ui/src/i18n.ts index bcc68a1080..bbd1c27ad8 100644 --- a/webview-ui/src/i18n.ts +++ b/webview-ui/src/i18n.ts @@ -14,7 +14,7 @@ i18n.use(initReactI18next) // passes i18n down to react-i18next react: { bindI18n: "languageChanged", transSupportBasicHtmlNodes: true, - transKeepBasicHtmlNodesFor: ["b", "i", "strong", "em"], + transKeepBasicHtmlNodesFor: ["b", "i", "strong", "em", "br"], }, }) diff --git a/webview-ui/src/locales/de/translation.json b/webview-ui/src/locales/de/translation.json index 88cf789383..96137caea2 100644 --- a/webview-ui/src/locales/de/translation.json +++ b/webview-ui/src/locales/de/translation.json @@ -22,5 +22,52 @@ "resetStateDescription": "Dies setzt den gesamten globalen Zustand und die geheime Speicherung in der Erweiterung zurück.", "feedback": "Wenn Sie Fragen oder Feedback haben, können Sie gerne ein Issue eröffnen unter", "version": "v" + }, + "apiOptions": { + "selectModel": "Modell auswählen...", + "model": "Modell", + "apiProvider": "API-Anbieter", + "enterApiKey": "API-Schlüssel eingeben...", + "apiKey": "API-Schlüssel", + "enterBaseUrl": "Basis-URL eingeben...", + "baseUrl": "Basis-URL", + "enterModelId": "Modell-ID eingeben...", + "modelId": "Modell-ID", + "useCustomBaseUrl": "Benutzerdefinierte Basis-URL verwenden", + "apiKeyInfo": "Dieser Schlüssel wird lokal gespeichert und nur verwendet, um API-Anfragen von dieser Erweiterung zu stellen.", + "getApiKeyMessage": "Sie können einen {{vendor}}-API-Schlüssel erhalten, indem Sie sich hier anmelden.", + "getApiVendorKey": "{{vendor}}-API-Schlüssel", + "getCompatibleVendor": "{{vendor}} kompatibel", + "enterGcpProjectId": "Projekt-ID eingeben...", + "gcpProjectId": "Google Cloud Projekt-ID", + "gcpLinks": "Um Google Cloud Vertex AI zu verwenden, müssen Sie 1) ein Google Cloud-Konto erstellen › die Vertex AI API aktivieren › die gewünschten Claude-Modelle aktivieren,
2) die Google Cloud CLI installieren › Anwendungsstandardanmeldeinformationen konfigurieren. ", + "enterAwsAccessKey": "Zugriffsschlüssel eingeben...", + "awsAccessKey": "AWS-Zugriffsschlüssel", + "enterAwsSecretKey": "Geheimschlüssel eingeben...", + "awsSecretKey": "AWS-Geheimschlüssel", + "enterAwsSessionToken": "Sitzungstoken eingeben...", + "awsSessionToken": "AWS-Sitzungstoken", + "awsRegion": "AWS-Region", + "getRegion": "{{vendor}}-Region", + "selectRegion": "Region auswählen...", + "useCrossRegionInference": "Regionsübergreifende Inferenz verwenden", + "awsInfo": "Authentifizieren Sie sich entweder durch Eingabe der oben genannten Schlüssel oder verwenden Sie die Standard-AWS-Anmeldeinformationen, d.h. ~/.aws/credentials oder Umgebungsvariablen. Diese Anmeldeinformationen werden nur lokal verwendet, um API-Anfragen von dieser Erweiterung zu stellen.", + "vscodeLanguageModelsInfo": "Die VS Code Language Model API ermöglicht es Ihnen, Modelle zu verwenden, die von anderen VS Code-Erweiterungen bereitgestellt werden (einschließlich, aber nicht beschränkt auf GitHub Copilot). Der einfachste Weg, um loszulegen, ist die Installation der Copilot-Erweiterung aus dem VS Marketplace und die Aktivierung von Claude 3.5 Sonnet.", + "experimentalFeature": "Hinweis: Dies ist eine sehr experimentelle Integration und funktioniert möglicherweise nicht wie erwartet.", + "supportsImages": "Unterstützt Bilder", + "doesNotSupportImages": "Unterstützt keine Bilder", + "supportsComputerUse": "Unterstützt Computernutzung", + "doesNotSupportComputerUse": "Unterstützt keine Computernutzung", + "supportsPromptCache": "Unterstützt Prompt-Caching", + "doesNotSupportPromptCache": "Unterstützt kein Prompt-Caching", + "maxOutput": "Maximale Ausgabe", + "tokens": "Token", + "inputPrice": "Eingabepreis", + "millionTokens": "Millionen Token", + "cacheWritesPrice": "Preis für Cache-Schreibvorgänge", + "cacheReadsPrice": "Preis für Cache-Lesevorgänge", + "outputPrice": "Ausgabepreis", + "geminiInfo": "* Kostenlos bis zu {{selectedModelId}} Anfragen pro Minute. Danach hängt die Abrechnung von der Promptgröße ab.", + "pricingDetails": "Weitere Informationen finden Sie in den Preisdaten." } } diff --git a/webview-ui/src/locales/en/translation.json b/webview-ui/src/locales/en/translation.json index 0251226e61..666578a8a1 100644 --- a/webview-ui/src/locales/en/translation.json +++ b/webview-ui/src/locales/en/translation.json @@ -22,5 +22,51 @@ "resetStateDescription": "This will reset all global state and secret storage in the extension.", "feedback": "If you have any questions or feedback, feel free to open an issue at", "version": "v" + }, + "apiOptions": { + "selectModel": "Select a Model...", + "model": "Model", + "apiProvider": "API Provider", + "enterApiKey": "Enter API Key...", + "apiKey": "API Key", + "enterBaseUrl": "Enter Base URL...", + "baseUrl": "Base URL", + "enterModelId": "Enter Model ID...", + "modelId": "Model ID", + "useCustomBaseUrl": "Use custom base URL", + "apiKeyInfo": "This key is stored locally and only used to make API requests from this extension.", + "getApiKeyMessage": "You can get an {{vendor}} API key by signing up here.", + "getApiVendorKey": "{{vendor}} API Key", + "getCompatibleVendor": "{{vendor}} Compatible", + "enterGcpProjectId": "Enter Project ID...", + "gcpProjectId": "Google Cloud Project ID", + "gcpLinks": "To use Google Cloud Vertex AI, you need to 1) create a Google Cloud account › enable the Vertex AI API › enable the desired Claude models,
2) install the Google Cloud CLI › configure Application Default Credentials. ", + "enterAwsAccessKey": "Enter Access Key...", + "awsAccessKey": "AWS Access Key", + "enterAwsSecretKey": "Enter Secret Key...", + "awsSecretKey": "AWS Secret Key", + "enterAwsSessionToken": "Enter Session Token...", + "awsSessionToken": "AWS Session Token", + "getRegion": "{{vendor}} Region", + "selectRegion": "Select a Region...", + "useCrossRegionInference": "Use cross-region inference", + "awsInfo": "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.", + "vscodeLanguageModelsInfo": "The VS Code Language Model API allows you to run models provided by other VS Code extensions (including but not limited to GitHub Copilot). The easiest way to get started is to install the Copilot extension from the VS Marketplace and enabling Claude 3.5 Sonnet.", + "experimentalFeature": "Note: This is a very experimental integration and may not work as expected.", + "supportsImages": "Supports images", + "doesNotSupportImages": "Does not support images", + "supportsComputerUse": "Supports computer use", + "doesNotSupportComputerUse": "Does not support computer use", + "supportsPromptCache": "Supports prompt caching", + "doesNotSupportPromptCache": "Does not support prompt caching", + "maxOutput": "Max output", + "tokens": "tokens", + "inputPrice": "Input price", + "millionTokens": "million tokens", + "cacheWritesPrice": "Cache writes price", + "cacheReadsPrice": "Cache reads price", + "outputPrice": "Output price", + "geminiInfo": "* Free up to {{selectedModelId}} requests per minute. After that, billing depends on prompt size.", + "pricingDetails": "For more info, see pricing details." } } diff --git a/webview-ui/src/locales/ja/translation.json b/webview-ui/src/locales/ja/translation.json index 4e8c23dddd..5918af5dfe 100644 --- a/webview-ui/src/locales/ja/translation.json +++ b/webview-ui/src/locales/ja/translation.json @@ -22,5 +22,52 @@ "resetStateDescription": "これにより、拡張機能のすべてのグローバル状態と秘密のストレージがリセットされます。", "feedback": "ご質問やフィードバックがある場合は、気軽に問題を開いてください", "version": "バージョン" + }, + "apiOptions": { + "selectModel": "Select a Model...", + "model": "Model", + "apiProvider": "API Provider", + "enterApiKey": "Enter API Key...", + "apiKey": "API Key", + "enterBaseUrl": "Enter Base URL...", + "baseUrl": "Base URL", + "enterModelId": "Enter Model ID...", + "modelId": "Model ID", + "useCustomBaseUrl": "Use custom base URL", + "apiKeyInfo": "This key is stored locally and only used to make API requests from this extension.", + "getApiKeyMessage": "You can get an {{vendor}} API key by signing up here.", + "getApiVendorKey": "{{vendor}} API Key", + "getCompatibleVendor": "{{vendor}} Compatible", + "enterGcpProjectId": "Enter Project ID...", + "gcpProjectId": "Google Cloud Project ID", + "gcpLinks": "To use Google Cloud Vertex AI, you need to 1) create a Google Cloud account › enable the Vertex AI API › enable the desired Claude models,
2) install the Google Cloud CLI › configure Application Default Credentials. ", + "enterAwsAccessKey": "Enter Access Key...", + "awsAccessKey": "AWS Access Key", + "enterAwsSecretKey": "Enter Secret Key...", + "awsSecretKey": "AWS Secret Key", + "enterAwsSessionToken": "Enter Session Token...", + "awsSessionToken": "AWS Session Token", + "awsRegion": "AWS Region", + "getRegion": "{{vendor}} Region", + "selectRegion": "Select a Region...", + "useCrossRegionInference": "Use cross-region inference", + "awsInfo": "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.", + "vscodeLanguageModelsInfo": "The VS Code Language Model API allows you to run models provided by other VS Code extensions (including but not limited to GitHub Copilot). The easiest way to get started is to install the Copilot extension from the VS Marketplace and enabling Claude 3.5 Sonnet.", + "experimentalFeature": "Note: This is a very experimental integration and may not work as expected.", + "supportsImages": "Supports images", + "doesNotSupportImages": "Does not support images", + "supportsComputerUse": "Supports computer use", + "doesNotSupportComputerUse": "Does not support computer use", + "supportsPromptCache": "Supports prompt caching", + "doesNotSupportPromptCache": "Does not support prompt caching", + "maxOutput": "Max output", + "tokens": "tokens", + "inputPrice": "Input price", + "millionTokens": "million tokens", + "cacheWritesPrice": "Cache writes price", + "cacheReadsPrice": "Cache reads price", + "outputPrice": "Output price", + "geminiInfo": "* Free up to {{selectedModelId}} requests per minute. After that, billing depends on prompt size.", + "pricingDetails": "For more info, see pricing details." } } diff --git a/webview-ui/src/locales/zh-cn/translation.json b/webview-ui/src/locales/zh-cn/translation.json index 6735f565b9..0044f842a1 100644 --- a/webview-ui/src/locales/zh-cn/translation.json +++ b/webview-ui/src/locales/zh-cn/translation.json @@ -22,5 +22,52 @@ "resetStateDescription": "这将重置扩展中的所有全局状态和秘密存储。", "feedback": "如果您有任何问题或反馈,请随时在以下网址提交问题", "version": "版本" + }, + "apiOptions": { + "selectModel": "选择模型...", + "model": "模型", + "apiProvider": "API 提供商", + "enterApiKey": "输入 API 密钥...", + "apiKey": "API 密钥", + "enterBaseUrl": "输入基本 URL...", + "baseUrl": "基本 URL", + "enterModelId": "输入模型 ID...", + "modelId": "模型 ID", + "useCustomBaseUrl": "使用自定义基本 URL", + "apiKeyInfo": "此密钥存储在本地,仅用于从此扩展进行 API 请求。", + "getApiKeyMessage": "您可以通过在此处注册来获取 {{vendor}} API 密钥。", + "getApiVendorKey": "{{vendor}} API 密钥", + "getCompatibleVendor": "{{vendor}} 兼容", + "enterGcpProjectId": "输入项目 ID...", + "gcpProjectId": "Google Cloud 项目 ID", + "gcpLinks": "要使用 Google Cloud Vertex AI,您需要 1) 创建一个 Google Cloud 帐户 › 启用 Vertex AI API › 启用所需的 Claude 模型,
2) 安装 Google Cloud CLI › 配置应用程序默认凭据。", + "enterAwsAccessKey": "输入访问密钥...", + "awsAccessKey": "AWS 访问密钥", + "enterAwsSecretKey": "输入秘密密钥...", + "awsSecretKey": "AWS 秘密密钥", + "enterAwsSessionToken": "输入会话令牌...", + "awsSessionToken": "AWS 会话令牌", + "awsRegion": "AWS 区域", + "getRegion": "{{vendor}} 区域", + "selectRegion": "选择区域...", + "useCrossRegionInference": "使用跨区域推理", + "awsInfo": "通过提供上述密钥或使用默认的 AWS 凭证提供程序进行身份验证,即 ~/.aws/credentials 或环境变量。这些凭证仅在本地用于从此扩展进行 API 请求。", + "vscodeLanguageModelsInfo": "VS Code 语言模型 API 允许您运行其他 VS Code 扩展提供的模型(包括但不限于 GitHub Copilot)。最简单的方法是从 VS Marketplace 安装 Copilot 扩展并启用 Claude 3.5 Sonnet。", + "experimentalFeature": "注意:这是一个非常实验性的集成,可能无法按预期工作。", + "supportsImages": "支持图像", + "doesNotSupportImages": "不支持图像", + "supportsComputerUse": "支持计算机使用", + "doesNotSupportComputerUse": "不支持计算机使用", + "supportsPromptCache": "支持提示缓存", + "doesNotSupportPromptCache": "不支持提示缓存", + "maxOutput": "最大输出", + "tokens": "令牌", + "inputPrice": "输入价格", + "millionTokens": "百万令牌", + "cacheWritesPrice": "缓存写入价格", + "cacheReadsPrice": "缓存读取价格", + "outputPrice": "输出价格", + "geminiInfo": "* 每分钟最多 {{selectedModelId}} 次请求免费。之后,费用取决于提示大小。", + "pricingDetails": "有关更多信息,请参阅定价详情。" } } diff --git a/webview-ui/src/locales/zh-tw/translation.json b/webview-ui/src/locales/zh-tw/translation.json index faf42cff63..2b42408367 100644 --- a/webview-ui/src/locales/zh-tw/translation.json +++ b/webview-ui/src/locales/zh-tw/translation.json @@ -22,5 +22,52 @@ "resetStateDescription": "這將重置擴展中的所有全局狀態和秘密存儲。", "feedback": "如果您有任何問題或反饋,請隨時在以下網址提交問題", "version": "版本" + }, + "apiOptions": { + "selectModel": "選擇模型...", + "model": "模型", + "apiProvider": "API 提供者", + "enterApiKey": "輸入 API 金鑰...", + "apiKey": "API 金鑰", + "enterBaseUrl": "輸入基本 URL...", + "baseUrl": "基本 URL", + "enterModelId": "輸入模型 ID...", + "modelId": "模型 ID", + "useCustomBaseUrl": "使用自定義基本 URL", + "apiKeyInfo": "此金鑰僅存儲在本地,僅用於從此擴展進行 API 請求。", + "getApiKeyMessage": "您可以通過在此處註冊來獲取 {{vendor}} API 金鑰。", + "getApiVendorKey": "{{vendor}} API 金鑰", + "getCompatibleVendor": "{{vendor}} 兼容", + "enterGcpProjectId": "輸入項目 ID...", + "gcpProjectId": "Google Cloud 項目 ID", + "gcpLinks": "要使用 Google Cloud Vertex AI,您需要 1) 創建 Google Cloud 帳戶 › 啟用 Vertex AI API › 啟用所需的 Claude 模型,
2) 安裝 Google Cloud CLI › 配置應用程序默認憑據。 ", + "enterAwsAccessKey": "輸入訪問金鑰...", + "awsAccessKey": "AWS 訪問金鑰", + "enterAwsSecretKey": "輸入秘密金鑰...", + "awsSecretKey": "AWS 秘密金鑰", + "enterAwsSessionToken": "輸入會話令牌...", + "awsSessionToken": "AWS 會話令牌", + "awsRegion": "AWS 區域", + "getRegion": "{{vendor}} 區域", + "selectRegion": "選擇區域...", + "useCrossRegionInference": "使用跨區域推理", + "awsInfo": "通過提供上述金鑰或使用默認的 AWS 憑據提供者進行身份驗證,即 ~/.aws/credentials 或環境變量。這些憑據僅在本地用於從此擴展進行 API 請求。", + "vscodeLanguageModelsInfo": "VS Code 語言模型 API 允許您運行其他 VS Code 擴展提供的模型(包括但不限於 GitHub Copilot)。最簡單的入門方法是從 VS Marketplace 安裝 Copilot 擴展並啟用 Claude 3.5 Sonnet。", + "experimentalFeature": "注意:這是一個非常實驗性的集成,可能無法按預期工作。", + "supportsImages": "支持圖片", + "doesNotSupportImages": "不支持圖片", + "supportsComputerUse": "支持電腦使用", + "doesNotSupportComputerUse": "不支持電腦使用", + "supportsPromptCache": "支持提示緩存", + "doesNotSupportPromptCache": "不支持提示緩存", + "maxOutput": "最大輸出", + "tokens": "標記", + "inputPrice": "輸入價格", + "millionTokens": "百萬標記", + "cacheWritesPrice": "緩存寫入價格", + "cacheReadsPrice": "緩存讀取價格", + "outputPrice": "輸出價格", + "geminiInfo": "* 每分鐘最多免費 {{selectedModelId}} 次請求。之後,計費取決於提示大小。", + "pricingDetails": "更多信息,請參見定價詳情。" } }