diff --git a/ui/desktop/frontend/src/components/onboarding/OnboardingWizard.tsx b/ui/desktop/frontend/src/components/onboarding/OnboardingWizard.tsx index 71f2cc2e..996d6004 100644 --- a/ui/desktop/frontend/src/components/onboarding/OnboardingWizard.tsx +++ b/ui/desktop/frontend/src/components/onboarding/OnboardingWizard.tsx @@ -1,17 +1,28 @@ import { useState, useEffect } from 'react' +import { useTranslation } from 'react-i18next' import { useBootstrapStatus, type SetupStep } from '../../hooks/use-bootstrap-status' +import { useUiStore } from '../../stores/ui-store' import { SetupStepper } from './SetupStepper' import { ProviderStep } from './ProviderStep' import { ModelVerifyStep } from './ModelVerifyStep' import { AgentStep } from './AgentStep' import type { ProviderData } from '../../types/provider' +const LANGUAGES = [ + { value: 'en', label: 'EN' }, + { value: 'vi', label: 'VI' }, + { value: 'zh', label: '中文' }, +] as const + interface OnboardingWizardProps { onComplete: () => void } export function OnboardingWizard({ onComplete }: OnboardingWizardProps) { const { currentStep, loading, providers } = useBootstrapStatus() + const locale = useUiStore((s) => s.locale) + const setLocale = useUiStore((s) => s.setLocale) + const { t, i18n } = useTranslation('desktop') const [step, setStep] = useState<1 | 2 | 3>(1) const [createdProvider, setCreatedProvider] = useState(null) const [selectedModel, setSelectedModel] = useState(null) @@ -46,12 +57,32 @@ export function OnboardingWizard({ onComplete }: OnboardingWizardProps) { return (
+ {/* Language switcher */} +
+
+ {LANGUAGES.map((lang) => ( + + ))} +
+
+ {/* Header */}
GoClaw -

GoClaw Setup

+

{t('onboarding.welcome')}

- Let's get your gateway up and running + {t('onboarding.welcomeDesc')}

diff --git a/ui/desktop/frontend/src/i18n/index.ts b/ui/desktop/frontend/src/i18n/index.ts index 20939c6e..f4a6683f 100644 --- a/ui/desktop/frontend/src/i18n/index.ts +++ b/ui/desktop/frontend/src/i18n/index.ts @@ -60,7 +60,7 @@ function getInitialLanguage(): string { const lang = navigator.language.toLowerCase() if (lang.startsWith('vi')) return 'vi' if (lang.startsWith('zh')) return 'zh' - return 'en' + return 'vi' } i18n.use(initReactI18next).init({ diff --git a/ui/desktop/frontend/src/stores/ui-store.ts b/ui/desktop/frontend/src/stores/ui-store.ts index 3a4da2fa..6663fc5d 100644 --- a/ui/desktop/frontend/src/stores/ui-store.ts +++ b/ui/desktop/frontend/src/stores/ui-store.ts @@ -32,7 +32,7 @@ export const useUiStore = create()( persist( (set) => ({ theme: 'light', - locale: 'en', + locale: 'vi', timezone: Intl.DateTimeFormat().resolvedOptions().timeZone, sidebarOpen: true, sidebarWidth: 260,