@@ -46,17 +46,17 @@ export const Entry = ({ currentLocale, locales, onSwitchLocale }: IEntry) => {
4646 } , [ getSoftwareVersionData , getSoftwareVersionLoading ] ) ;
4747
4848 const { pathname } = useLocation ( ) ;
49- const [ currentTitle , setCurrentTitle ] = useState ( globalConfig . name [ currentLocale ] ) ;
49+ const [ currentTitle , setCurrentTitle ] = useState ( t ( globalConfig . name ) ) ;
5050 useEffect ( ( ) => {
5151 for ( const key in routerConfig . routes ) {
5252 const { uri } = routerConfig . routes [ key ] ;
5353 if ( pathname === uri ) {
54- setCurrentTitle ( routerConfig . routes [ key ] . title [ currentLocale ] ) ;
54+ setCurrentTitle ( t ( routerConfig . routes [ key ] . title ) ) ;
5555 return ;
5656 }
5757 }
58- setCurrentTitle ( routerConfig . routes . default . title [ currentLocale ] ) ;
59- } , [ pathname , currentLocale ] ) ;
58+ setCurrentTitle ( t ( routerConfig . routes . default . title ) ) ;
59+ } , [ pathname , currentLocale , t ] ) ;
6060
6161 const { clearCredential } = useCredentialStore ( ) ;
6262 const handleLogoutSubmit = ( ) => {
@@ -127,17 +127,13 @@ export const Entry = ({ currentLocale, locales, onSwitchLocale }: IEntry) => {
127127 return (
128128 < div className = "animate-fade animate-duration-500 animate-delay-300" >
129129 < Header
130- title = { globalConfig . name [ currentLocale ] }
130+ title = { t ( globalConfig . name ) }
131131 onLogout = { handleLogoutSubmit }
132132 currentLocale = { currentLocale }
133133 onSwitchLocale = { onSwitchLocale }
134134 locales = { locales }
135135 />
136- < AsideMenu
137- title = { globalConfig . name [ currentLocale ] }
138- menu = { menuConfig }
139- currentLocale = { currentLocale }
140- />
136+ < AsideMenu title = { t ( globalConfig . name ) } menu = { menuConfig } />
141137
142138 < div className = "ml-10 flex min-h-screen flex-col space-y-4 p-20 px-4" >
143139 < BreadCrumb
@@ -146,8 +142,7 @@ export const Entry = ({ currentLocale, locales, onSwitchLocale }: IEntry) => {
146142 title = { currentTitle }
147143 />
148144 < RouterView
149- routerProps = { { currentLocale } }
150- currentLocale = { currentLocale }
145+ routerProps = { { currentLocale, onSwitchLocale, locales } }
151146 appName = { globalConfig . name }
152147 routes = { routerConfig . routes }
153148 suspense = { < Skeleton /> }
@@ -157,8 +152,7 @@ export const Entry = ({ currentLocale, locales, onSwitchLocale }: IEntry) => {
157152 < Footer
158153 copyright = { globalConfig . copyright }
159154 repository = { globalConfig . repository }
160- currentLocale = { currentLocale }
161- text = { globalConfig . footer }
155+ text = { t ( globalConfig . footer ) }
162156 homepage = { globalConfig . homepage }
163157 />
164158 < Scroller threshold = { 100 } />
0 commit comments