This commit is contained in:
hailin 2025-04-18 09:21:20 +08:00
parent d0c310aba8
commit f533724db5
5 changed files with 38 additions and 25 deletions

View File

@ -164,9 +164,9 @@ export default function SetupPage() {
case 1:
return (
<StepContainer
stepDescription={t("Let's create your profile.")}
stepDescription={t("setup.LetsCreateYourProfile")}
stepNum={currentStep}
stepTitle={t("Welcome to Chatbot UI")}
stepTitle={t("setup.WelcomeToChatbotUI")}
onShouldProceed={handleShouldProceed}
showNextButton={!!(username && usernameAvailable)}
showBackButton={false}
@ -186,9 +186,9 @@ export default function SetupPage() {
case 2:
return (
<StepContainer
stepDescription={t("Enter API keys for each service you'd like to use.")}
stepDescription={t("setup.EnterAPIKeysForEachServiceYoudLikeToUse")}
stepNum={currentStep}
stepTitle={t("Set API Keys (optional)")}
stepTitle={t("SetAPIKeysOptional")}
onShouldProceed={handleShouldProceed}
showNextButton={true}
showBackButton={true}
@ -232,9 +232,9 @@ export default function SetupPage() {
case 3:
return (
<StepContainer
stepDescription={t("You are all set up!")}
stepDescription={t("setup.YouAreAllSetUp")}
stepNum={currentStep}
stepTitle={t("Setup Complete")}
stepTitle={t("setup.SetupComplete")}
onShouldProceed={handleShouldProceed}
showNextButton={true}
showBackButton={true}

View File

@ -4,12 +4,14 @@ import i18nConfig from '@/i18nConfig'
import { usePathname, useRouter } from 'next/navigation'
import { useEffect, useTransition } from 'react'
import { Globe } from 'lucide-react'
import { useTranslation } from 'react-i18next'
export function LanguageSwitcher() {
const router = useRouter()
const pathname = usePathname()
const [isPending, startTransition] = useTransition()
const { i18n } = useTranslation() // 获取 i18n 实例
const currentLocale = pathname.split('/')[1] || i18nConfig.defaultLocale
useEffect(() => {
@ -45,6 +47,10 @@ export function LanguageSwitcher() {
const cookieValue = document.cookie
console.log('[LanguageSwitcher] Check writed Cookie value:', cookieValue)
// 更新 i18n 的语言
i18n.changeLanguage(newLocale) // 修改 TranslationProvider 中的 locale
let segments = pathname === '/' ? [] : pathname.split('/').filter(Boolean)
const isLocaleInPath = i18nConfig.locales.includes(segments[0] as any)

View File

@ -2,12 +2,15 @@
"Ask anything. Type \"/\" for prompts, \"@\" for files, and \"#\" for tools.": "Ask anything. Type \"/\" for prompts, \"@\" for files, and \"#\" for tools.",
"Company Name": "Jelly Drops LLC",
"Clock In": "Clock In",
"Let's create your profile.": "Let's create your profile.",
"Welcome to Chatbot UI": "Welcome to Chatbot UI",
"Enter API keys for each service you'd like to use.": "Enter API keys for each service you'd like to use.",
"Set API Keys (optional)": "Set API Keys (optional)",
"You are all set up!": "You are all set up!",
"Setup Complete": "Setup Complete",
"setup": {
"LetsCreateYourProfile": "Let's create your profile.",
"WelcomeToChatbotUI": "Welcome to Chatbot UI",
"EnterAPIKeysForEachServiceYoudLikeToUse": "Enter API keys for each service you'd like to use.",
"SetAPIKeysOptional": "Set API Keys (optional)",
"YouAreAllSetUp": "You are all set up!",
"SetupComplete": "Setup Complete"
},
"login": {
"email": "Email",

View File

@ -2,11 +2,13 @@
"Ask anything. Type \"/\" for prompts, \"@\" for files, and \"#\" for tools.": "何でも聞いてください。「/」でプロンプト、「@」でファイル、「#」でツールを入力してください。",
"Company Name": "Jelly Drops LLC",
"Clock In": "出勤する",
"Let's create your profile.": "プロフィールを作成しましょう。",
"Welcome to Chatbot UI": "Chatbot UIへようこそ",
"Enter API keys for each service you'd like to use.": "使用する各サービスのAPIキーを入力してください。",
"Set API Keys (optional)": "APIキーの設定オプション",
"You are all set up!": "設定が完了しました!",
"Setup Complete": "セットアップ完了"
"setup": {
"LetsCreateYourProfile": "プロフィールを作成しましょう。",
"WelcomeToChatbotUI": "Chatbot UIへようこそ",
"EnterAPIKeysForEachServiceYoudLikeToUse": "使用する各サービスのAPIキーを入力してください。",
"SetAPIKeysOptional": "APIキーの設定オプション",
"YouAreAllSetUp": "設定が完了しました!",
"SetupComplete": "セットアップ完了"
}
}

View File

@ -2,13 +2,15 @@
"Ask anything. Type \"/\" for prompts, \"@\" for files, and \"#\" for tools.": "随便问点什么。输入“/”查找提示,“@”查找文件,“#”查找工具。",
"Company Name": "深圳果冻移民咨询有限责任公司",
"Clock In": "打卡",
"Let's create your profile.": "让我们来创建您的个人资料。",
"Welcome to Chatbot UI": "欢迎使用 Chatbot UI",
"Enter API keys for each service you'd like to use.": "输入您希望使用的每个服务的 API 密钥。",
"Set API Keys (optional)": "设置 API 密钥(可选)",
"You are all set up!": "设置完成!",
"Setup Complete": "设置完成",
"setup": {
"LetsCreateYourProfile": "让我们来创建您的个人资料。",
"WelcomeToChatbotUI": "欢迎使用 Chatbot UI",
"EnterAPIKeysForEachServiceYoudLikeToUse": "输入您希望使用的每个服务的 API 密钥。",
"SetAPIKeysOptional": "设置 API 密钥(可选)",
"YouAreAllSetUp": "设置完成!",
"SetupComplete": "设置完成"
},
"login": {
"email": "电子邮件",
"emailPlaceholder": "you@example.com",