@@ -9,11 +9,13 @@ import SettingsDialog from '@/components/SettingsDialog.vue'
99import BenchSwitcherDialog from ' @/components/BenchSwitcherDialog.vue'
1010import NewBenchDialog from ' @/components/NewBenchDialog.vue'
1111import PilotLogo from ' @/components/PilotLogo.vue'
12+ import { useI18n } from ' @/i18n'
1213const { setTheme } = useTheme ()
14+ const { locale , setLocale , t } = useI18n ()
1315
1416const route = useRoute ()
1517const router = useRouter ()
16- const sections = sidebarSections ()
18+ const sections = computed (() => sidebarSections (t) )
1719const isMobile = useIsMobile ()
1820
1921const showSettings = ref (false )
@@ -37,29 +39,37 @@ const header = computed(() => ({
3739 title: ' Pilot' ,
3840 menuItems: [
3941 {
40- label: ' Central ' ,
42+ label: t ( ' account.central ' ) ,
4143 icon: ' lucide-cloud' ,
4244 },
4345 {
44- label: ' Settings ' ,
46+ label: t ( ' account.settings ' ) ,
4547 icon: ' lucide-settings' ,
4648 onClick : () => (showSettings .value = true ),
4749 },
4850 {
49- label: ' Switch Bench ' ,
51+ label: t ( ' account.switchBench ' ) ,
5052 icon: ' lucide-repeat' ,
5153 onClick : () => (showBenches .value = true ),
5254 },
5355 {
54- label: ' Theme ' ,
56+ label: t ( ' account.theme ' ) ,
5557 icon: ' lucide-sun-moon' ,
5658 submenu: [
57- { label: ' Light ' , icon: ' lucide-sun' , onClick : () => setTheme (' light' ) },
58- { label: ' Dark ' , icon: ' lucide-moon' , onClick : () => setTheme (' dark' ) },
59- { label: ' System ' , icon: ' lucide-monitor' , onClick : () => setTheme (' system' ) },
59+ { label: t ( ' account.light ' ) , icon: ' lucide-sun' , onClick : () => setTheme (' light' ) },
60+ { label: t ( ' account.dark ' ) , icon: ' lucide-moon' , onClick : () => setTheme (' dark' ) },
61+ { label: t ( ' account.system ' ) , icon: ' lucide-monitor' , onClick : () => setTheme (' system' ) },
6062 ],
6163 },
62- { label: ' Logout' , icon: ' lucide-log-out' , onClick: logout },
64+ {
65+ label: t (' common.language' ),
66+ icon: ' lucide-languages' ,
67+ submenu: [
68+ { label: t (' common.english' ), onClick : () => setLocale (' en' ), disabled: locale .value === ' en' },
69+ { label: t (' common.chinese' ), onClick : () => setLocale (' zh-CN' ), disabled: locale .value === ' zh-CN' },
70+ ],
71+ },
72+ { label: t (' account.logout' ), icon: ' lucide-log-out' , onClick: logout },
6373 ],
6474}))
6575 </script >
0 commit comments