feat: 语言国际化重构
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { Suspense, lazy, useEffect, type ReactNode } from 'react';
|
||||
import { Navigate, Route, Routes, useLocation, useNavigate } from 'react-router-dom';
|
||||
import MainLayout from '../components/layout/MainLayout';
|
||||
import { useI18n } from '../i18n';
|
||||
import LoginPage from '../pages/Login';
|
||||
import { DEFAULT_PATH } from './routes';
|
||||
import { RedirectAuthenticated, RequireAuth, isAuthenticated } from './auth';
|
||||
import { onAuthLogout } from './auth-session';
|
||||
import { DEFAULT_PATH } from './routes';
|
||||
|
||||
const HomePage = lazy(() => import('../pages/Home'));
|
||||
const ChannelsPage = lazy(() => import('../pages/Channels'));
|
||||
@@ -15,9 +16,11 @@ const SettingPage = lazy(() => import('../pages/Setting'));
|
||||
const KnowledgePage = lazy(() => import('../pages/Knowledge'));
|
||||
|
||||
function RouteLoadingFallback() {
|
||||
const { t } = useI18n();
|
||||
|
||||
return (
|
||||
<div className="flex h-full min-h-0 w-full items-center justify-center bg-[#f6f9fc] text-sm text-[#99A0AE] dark:bg-[#0f0f10] dark:text-gray-500">
|
||||
页面加载中...
|
||||
{t('dashboard.route.loading')}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user