From 1e4b6eddc79aea542637fd8a77b1abaada2558c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E9=9C=96=E9=93=83?= Date: Wed, 27 May 2026 14:14:19 +0800 Subject: [PATCH] fix(RouterContainer): replace hardcoded Chinese with i18n t() calls Use useTranslation('common') for 404 page title and description with entryPointType interpolation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- components/RouterContainer.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/RouterContainer.tsx b/components/RouterContainer.tsx index f38db58..2689f41 100644 --- a/components/RouterContainer.tsx +++ b/components/RouterContainer.tsx @@ -1,6 +1,7 @@ import { FEATURES, getEntryPointType } from '@/config/features'; import { useRouter } from '@/providers/RouterProvider'; import { Suspense, useMemo } from 'react'; +import { useTranslation } from 'react-i18next'; import PageErrorBoundary from '@/components/PageErrorBoundary'; import PageSkeleton from '@/components/PageSkeleton'; import { cn } from '@/lib/utils'; // 1. 引入标准的 shadcn 工具函数 @@ -8,6 +9,7 @@ import { AlertTriangle } from 'lucide-react'; // 用于标准的 404 异常展 export default function RouterContainer() { const { currentPage, isLoaded } = useRouter(); + const { t } = useTranslation('common'); // 2. 稳定的动态动画类名映射 const animationClass = useMemo(() => { @@ -50,9 +52,9 @@ export default function RouterContainer() {
-

页面未找到

+

{t('router.notFound')}

- 该功能在当前运行环境({entryPointType})下不可用或已被移除。 + {t('router.notFoundDescription', { entryPointType })}

)}