From 900bbe8feab8c07d22e566c66e2931698f70ad47 Mon Sep 17 00:00:00 2001 From: hailin Date: Fri, 18 Apr 2025 22:37:06 +0800 Subject: [PATCH] . --- components/utility/profile-settings.tsx | 84 ++++++++++++------------- public/locales/en/translation.json | 54 +++++++++++++++- public/locales/ja/translation.json | 54 +++++++++++++++- public/locales/zh/translation.json | 52 ++++++++++++++- 4 files changed, 197 insertions(+), 47 deletions(-) diff --git a/components/utility/profile-settings.tsx b/components/utility/profile-settings.tsx index c24542f..9e4b20e 100644 --- a/components/utility/profile-settings.tsx +++ b/components/utility/profile-settings.tsx @@ -467,15 +467,15 @@ export const ProfileSettings: FC = ({}) => { onClick={() => setUseAzureOpenai(!useAzureOpenai)} > {useAzureOpenai - ? "Switch To Standard OpenAI" - : "Switch To Azure OpenAI"} + ? t("profile.switchToStandardOpenAI") + : t("profile.switchToAzureOpenAI")} {useAzureOpenai ? ( <> {envKeyMap["azure"] ? ( - + ) : ( = ({}) => { ) : ( <> {envKeyMap["openai"] ? ( - + ) : ( = ({}) => {
{envKeyMap["azure_openai_endpoint"] ? ( ) : ( <> - + setAzureOpenaiEndpoint(e.target.value) @@ -530,14 +530,14 @@ export const ProfileSettings: FC = ({}) => {
{envKeyMap["azure_gpt_35_turbo_name"] ? ( ) : ( <> - + setAzureOpenai35TurboID(e.target.value) @@ -552,14 +552,14 @@ export const ProfileSettings: FC = ({}) => {
{envKeyMap["azure_gpt_45_turbo_name"] ? ( ) : ( <> - - + + setAzureOpenai45TurboID(e.target.value) @@ -574,14 +574,14 @@ export const ProfileSettings: FC = ({}) => {
{envKeyMap["azure_gpt_45_vision_name"] ? ( ) : ( <> - + setAzureOpenai45VisionID(e.target.value) @@ -596,14 +596,14 @@ export const ProfileSettings: FC = ({}) => {
{envKeyMap["azure_embeddings_name"] ? ( ) : ( <> - + setAzureEmbeddingsID(e.target.value) @@ -619,14 +619,14 @@ export const ProfileSettings: FC = ({}) => {
{envKeyMap["openai_organization_id"] ? ( ) : ( <> - + = ({}) => {
{envKeyMap["anthropic"] ? ( - + ) : ( <> - + setAnthropicAPIKey(e.target.value)} @@ -659,12 +659,12 @@ export const ProfileSettings: FC = ({}) => {
{envKeyMap["google"] ? ( - + ) : ( <> - + setGoogleGeminiAPIKey(e.target.value)} @@ -675,12 +675,12 @@ export const ProfileSettings: FC = ({}) => {
{envKeyMap["mistral"] ? ( - + ) : ( <> - + setMistralAPIKey(e.target.value)} @@ -691,12 +691,12 @@ export const ProfileSettings: FC = ({}) => {
{envKeyMap["groq"] ? ( - + ) : ( <> - + setGroqAPIKey(e.target.value)} @@ -707,12 +707,12 @@ export const ProfileSettings: FC = ({}) => {
{envKeyMap["perplexity"] ? ( - + ) : ( <> - + setPerplexityAPIKey(e.target.value)} @@ -723,12 +723,12 @@ export const ProfileSettings: FC = ({}) => {
{envKeyMap["openrouter"] ? ( - + ) : ( <> - + setOpenrouterAPIKey(e.target.value)} @@ -747,7 +747,7 @@ export const ProfileSettings: FC = ({}) => { - Download Chatbot UI 1.0 data as JSON. Import coming soon! + {t("profile.downloadTooltip")}
} trigger={ diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index ce50baa..1fbdcd8 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -53,6 +53,56 @@ "instructionsPlaceholder": "Profile context... (optional)", "profileImageLabel": "Profile Image", "cancel": "Cancel", - "save": "Save" - } + "save": "Save", + "profileUpdated": "Profile updated!", + "imageAlt": "Profile Image", + "apiKeyLabel": "API Key", + "switchToStandardOpenAI": "Switch To Standard OpenAI", + "switchToAzureOpenAI": "Switch To Azure OpenAI", + "downloadTooltip": "Download Chatbot UI 1.0 data as JSON. Import coming soon!", + "azureOpenAIKeySetByAdmin": "Azure OpenAI API key set by admin.", + "openAIAPIKeySetByAdmin": "OpenAI API key set by admin.", + "azureEndpointSetByAdmin": "Azure endpoint set by admin.", + "azureDeploymentNameSetByAdmin": "Azure deployment name set by admin.", + "geminiAPIKeySetByAdmin": "Google Gemini API key set by admin.", + "mistralAPIKeySetByAdmin": "Mistral API key set by admin.", + "groqAPIKeySetByAdmin": "Groq API key set by admin.", + "perplexityAPIKeySetByAdmin": "Perplexity API key set by admin.", + "openRouterAPIKeySetByAdmin": "OpenRouter API key set by admin.", + "azureEndpointLabel": "Azure Endpoint", + "azureGpt35TurboDeploymentName": "Azure GPT-3.5 Turbo Deployment Name", + "azureGpt45TurboDeploymentName": "Azure GPT-4.5 Turbo Deployment Name", + "azureGpt45VisionDeploymentName": "Azure GPT-4.5 Vision Deployment Name", + "azureEmbeddingsDeploymentName": "Azure Embeddings Deployment Name", + "openaiOrgIdLabel": "OpenAI Organization ID", + "anthropicApiKeyLabel": "Anthropic API Key", + "googleGeminiApiKeyLabel": "Google Gemini API Key", + "mistralApiKeyLabel": "Mistral API Key", + "groqApiKeyLabel": "Groq API Key", + "perplexityApiKeyLabel": "Perplexity API Key", + "openRouterApiKeyLabel": "OpenRouter API Key", + "azureEndpointPlaceholder": "https://your-endpoint.openai.azure.com", + "azureGpt35TurboDeploymentNamePlaceholder": "Azure GPT-3.5 Turbo Deployment Name", + "azureGpt45TurboDeploymentNamePlaceholder": "Azure GPT-4.5 Turbo Deployment Name", + "azureGpt45VisionDeploymentNamePlaceholder": "Azure GPT-4.5 Vision Deployment Name", + "azureEmbeddingsDeploymentNamePlaceholder": "Azure Embeddings Deployment Name", + "openaiOrgIdPlaceholder": "OpenAI Organization ID (optional)", + "anthropicApiKeyPlaceholder": "Anthropic API Key", + "googleGeminiApiKeyPlaceholder": "Google Gemini API Key", + "mistralApiKeyPlaceholder": "Mistral API Key", + "groqApiKeyPlaceholder": "Groq API Key", + "perplexityApiKeyPlaceholder": "Perplexity API Key", + "openRouterApiKeyPlaceholder": "OpenRouter API Key", + "azureGpt35TurboDeploymentNameSetByAdmin": "Azure GPT-3.5 Turbo Deployment Name set by admin.", + "azureGpt45TurboDeploymentNameSetByAdmin": "Azure GPT-4.5 Turbo Deployment Name set by admin.", + "azureGpt45VisionDeploymentNameSetByAdmin": "Azure GPT-4.5 Vision Deployment Name set by admin.", + "azureEmbeddingsDeploymentNameSetByAdmin": "Azure Embeddings Deployment Name set by admin.", + "openaiOrgIdSetByAdmin": "OpenAI Organization ID set by admin.", + "anthropicApiKeySetByAdmin": "Anthropic API Key set by admin.", + "googleGeminiApiKeySetByAdmin": "Google Gemini API Key set by admin.", + "mistralApiKeySetByAdmin": "Mistral API Key set by admin.", + "groqApiKeySetByAdmin": "Groq API Key set by admin.", + "perplexityApiKeySetByAdmin": "Perplexity API Key set by admin.", + "openRouterApiKeySetByAdmin": "OpenRouter API Key set by admin." + } } diff --git a/public/locales/ja/translation.json b/public/locales/ja/translation.json index c72639c..1061882 100644 --- a/public/locales/ja/translation.json +++ b/public/locales/ja/translation.json @@ -52,7 +52,57 @@ "instructionsPlaceholder": "プロフィールの説明...(オプション)", "profileImageLabel": "プロフィール画像", "cancel": "キャンセル", - "save": "保存" - } + "save": "保存", + "profileUpdated": "プロフィールが更新されました!", + "imageAlt": "プロフィール画像", + "apiKeyLabel": "APIキー", + "switchToStandardOpenAI": "標準のOpenAIに切り替え", + "switchToAzureOpenAI": "Azure OpenAIに切り替え", + "downloadTooltip": "Chatbot UI 1.0のデータをJSONとしてダウンロード。インポート機能は近日公開予定!", + "azureOpenAIKeySetByAdmin": "Azure OpenAI API キーは管理者によって設定されました。", + "openAIAPIKeySetByAdmin": "OpenAI API キーは管理者によって設定されました。", + "azureEndpointSetByAdmin": "Azure エンドポイントは管理者によって設定されました。", + "azureDeploymentNameSetByAdmin": "Azure デプロイメント名は管理者によって設定されました。", + "geminiAPIKeySetByAdmin": "Google Gemini API キーは管理者によって設定されました。", + "mistralAPIKeySetByAdmin": "Mistral API キーは管理者によって設定されました。", + "groqAPIKeySetByAdmin": "Groq API キーは管理者によって設定されました。", + "perplexityAPIKeySetByAdmin": "Perplexity API キーは管理者によって設定されました。", + "openRouterAPIKeySetByAdmin": "OpenRouter API キーは管理者によって設定されました。", + "azureEndpointLabel": "Azure エンドポイント", + "azureGpt35TurboDeploymentName": "Azure GPT-3.5 Turbo デプロイメント名", + "azureGpt45TurboDeploymentName": "Azure GPT-4.5 Turbo デプロイメント名", + "azureGpt45VisionDeploymentName": "Azure GPT-4.5 Vision デプロイメント名", + "azureEmbeddingsDeploymentName": "Azure Embeddings デプロイメント名", + "openaiOrgIdLabel": "OpenAI 組織 ID", + "anthropicApiKeyLabel": "Anthropic API キー", + "googleGeminiApiKeyLabel": "Google Gemini API キー", + "mistralApiKeyLabel": "Mistral API キー", + "groqApiKeyLabel": "Groq API キー", + "perplexityApiKeyLabel": "Perplexity API キー", + "openRouterApiKeyLabel": "OpenRouter API キー", + "azureEndpointPlaceholder": "https://your-endpoint.openai.azure.com", + "azureGpt35TurboDeploymentNamePlaceholder": "Azure GPT-3.5 Turbo デプロイメント名", + "azureGpt45TurboDeploymentNamePlaceholder": "Azure GPT-4.5 Turbo デプロイメント名", + "azureGpt45VisionDeploymentNamePlaceholder": "Azure GPT-4.5 Vision デプロイメント名", + "azureEmbeddingsDeploymentNamePlaceholder": "Azure Embeddings デプロイメント名", + "openaiOrgIdPlaceholder": "OpenAI 組織 ID(オプション)", + "anthropicApiKeyPlaceholder": "Anthropic API キー", + "googleGeminiApiKeyPlaceholder": "Google Gemini API キー", + "mistralApiKeyPlaceholder": "Mistral API キー", + "groqApiKeyPlaceholder": "Groq API キー", + "perplexityApiKeyPlaceholder": "Perplexity API キー", + "openRouterApiKeyPlaceholder": "OpenRouter API キー", + "azureGpt35TurboDeploymentNameSetByAdmin": "Azure GPT-3.5 Turbo デプロイメント名は管理者によって設定されました。", + "azureGpt45TurboDeploymentNameSetByAdmin": "Azure GPT-4.5 Turbo デプロイメント名は管理者によって設定されました。", + "azureGpt45VisionDeploymentNameSetByAdmin": "Azure GPT-4.5 Vision デプロイメント名は管理者によって設定されました。", + "azureEmbeddingsDeploymentNameSetByAdmin": "Azure Embeddings デプロイメント名は管理者によって設定されました。", + "openaiOrgIdSetByAdmin": "OpenAI 組織 ID は管理者によって設定されました。", + "anthropicApiKeySetByAdmin": "Anthropic API キーは管理者によって設定されました。", + "googleGeminiApiKeySetByAdmin": "Google Gemini API キーは管理者によって設定されました。", + "mistralApiKeySetByAdmin": "Mistral API キーは管理者によって設定されました。", + "groqApiKeySetByAdmin": "Groq API キーは管理者によって設定されました。", + "perplexityApiKeySetByAdmin": "Perplexity API キーは管理者によって設定されました。", + "openRouterApiKeySetByAdmin": "OpenRouter API キーは管理者によって設定されました。" + } } \ No newline at end of file diff --git a/public/locales/zh/translation.json b/public/locales/zh/translation.json index 54aa024..98373ab 100644 --- a/public/locales/zh/translation.json +++ b/public/locales/zh/translation.json @@ -52,6 +52,56 @@ "instructionsPlaceholder": "个人资料描述...(可选)", "profileImageLabel": "个人资料图片", "cancel": "取消", - "save": "保存" + "save": "保存", + "profileUpdated": "个人资料已更新!", + "imageAlt": "个人资料图片", + "apiKeyLabel": "API 密钥", + "switchToStandardOpenAI": "切换到标准 OpenAI", + "switchToAzureOpenAI": "切换到 Azure OpenAI", + "downloadTooltip": "下载 Chatbot UI 1.0 数据为 JSON。导入功能即将推出!", + "azureOpenAIKeySetByAdmin": "Azure OpenAI API 密钥由管理员设置。", + "openAIAPIKeySetByAdmin": "OpenAI API 密钥由管理员设置。", + "azureEndpointSetByAdmin": "Azure 端点由管理员设置。", + "azureDeploymentNameSetByAdmin": "Azure 部署名称由管理员设置。", + "geminiAPIKeySetByAdmin": "Google Gemini API 密钥由管理员设置。", + "mistralAPIKeySetByAdmin": "Mistral API 密钥由管理员设置。", + "groqAPIKeySetByAdmin": "Groq API 密钥由管理员设置。", + "perplexityAPIKeySetByAdmin": "Perplexity API 密钥由管理员设置。", + "openRouterAPIKeySetByAdmin": "OpenRouter API 密钥由管理员设置。", + "azureEndpointLabel": "Azure 端点", + "azureGpt35TurboDeploymentName": "Azure GPT-3.5 Turbo 部署名称", + "azureGpt45TurboDeploymentName": "Azure GPT-4.5 Turbo 部署名称", + "azureGpt45VisionDeploymentName": "Azure GPT-4.5 Vision 部署名称", + "azureEmbeddingsDeploymentName": "Azure Embeddings 部署名称", + "openaiOrgIdLabel": "OpenAI 组织 ID", + "anthropicApiKeyLabel": "Anthropic API 密钥", + "googleGeminiApiKeyLabel": "Google Gemini API 密钥", + "mistralApiKeyLabel": "Mistral API 密钥", + "groqApiKeyLabel": "Groq API 密钥", + "perplexityApiKeyLabel": "Perplexity API 密钥", + "openRouterApiKeyLabel": "OpenRouter API 密钥", + "azureEndpointPlaceholder": "https://your-endpoint.openai.azure.com", + "azureGpt35TurboDeploymentNamePlaceholder": "Azure GPT-3.5 Turbo 部署名称", + "azureGpt45TurboDeploymentNamePlaceholder": "Azure GPT-4.5 Turbo 部署名称", + "azureGpt45VisionDeploymentNamePlaceholder": "Azure GPT-4.5 Vision 部署名称", + "azureEmbeddingsDeploymentNamePlaceholder": "Azure Embeddings 部署名称", + "openaiOrgIdPlaceholder": "OpenAI 组织 ID(可选)", + "anthropicApiKeyPlaceholder": "Anthropic API 密钥", + "googleGeminiApiKeyPlaceholder": "Google Gemini API 密钥", + "mistralApiKeyPlaceholder": "Mistral API 密钥", + "groqApiKeyPlaceholder": "Groq API 密钥", + "perplexityApiKeyPlaceholder": "Perplexity API 密钥", + "openRouterApiKeyPlaceholder": "OpenRouter API 密钥", + "azureGpt35TurboDeploymentNameSetByAdmin": "Azure GPT-3.5 Turbo 部署名称由管理员设置。", + "azureGpt45TurboDeploymentNameSetByAdmin": "Azure GPT-4.5 Turbo 部署名称由管理员设置。", + "azureGpt45VisionDeploymentNameSetByAdmin": "Azure GPT-4.5 Vision 部署名称由管理员设置。", + "azureEmbeddingsDeploymentNameSetByAdmin": "Azure Embeddings 部署名称由管理员设置。", + "openaiOrgIdSetByAdmin": "OpenAI 组织 ID 由管理员设置。", + "anthropicApiKeySetByAdmin": "Anthropic API 密钥由管理员设置。", + "googleGeminiApiKeySetByAdmin": "Google Gemini API 密钥由管理员设置。", + "mistralApiKeySetByAdmin": "Mistral API 密钥由管理员设置。", + "groqApiKeySetByAdmin": "Groq API 密钥由管理员设置。", + "perplexityApiKeySetByAdmin": "Perplexity API 密钥由管理员设置。", + "openRouterApiKeySetByAdmin": "OpenRouter API 密钥由管理员设置。" } }