refactor: 完成全站国际化改造,统一多语言支持

此提交完成了全项目的国际化适配:
1. 新增多语言翻译文件与基础配置
2. 替换所有硬编码文本为i18n调用
3. 优化语言切换与文档语言同步逻辑
4. 重构部分业务逻辑以支持动态翻译
5. 移除过时代码与硬编码配置
This commit is contained in:
2026-05-15 10:41:14 +08:00
parent ac612cb32c
commit f2c7f5e4f1
53 changed files with 2179 additions and 767 deletions

View File

@@ -2,8 +2,10 @@
import Link from "next/link";
import { FileQuestion, Home } from "lucide-react";
import { useTranslation } from "react-i18next";
import { ERROR_COLORS } from "@/stores/error-store";
import "@/i18n";
/**
* 全局 404 页面
@@ -13,6 +15,8 @@ import { ERROR_COLORS } from "@/stores/error-store";
* 使用中性颜色 #d9d9d9 作为背景/插图
*/
export default function NotFoundPage(): React.ReactElement {
const { t } = useTranslation("player");
return (
<div
className="flex min-h-screen flex-col items-center justify-center p-4"
@@ -42,12 +46,12 @@ export default function NotFoundPage(): React.ReactElement {
{/* 标题 */}
<h1 className="mb-3 text-2xl font-bold text-gray-800">
{t("notFound.title")}
</h1>
{/* 描述 */}
<p className="mb-8 text-base text-gray-500">
访
{t("notFound.description")}
</p>
{/* 返回首页按钮 */}
@@ -57,21 +61,21 @@ export default function NotFoundPage(): React.ReactElement {
style={{ backgroundColor: "#333" }}
>
<Home className="size-5" />
{t("notFound.home")}
</Link>
{/* 帮助链接 */}
<div className="mt-8 flex gap-4 text-sm text-gray-400">
<Link href="/hall" className="hover:text-gray-600 hover:underline">
{t("notFound.hall")}
</Link>
<span>|</span>
<Link href="/results" className="hover:text-gray-600 hover:underline">
{t("notFound.results")}
</Link>
<span>|</span>
<Link href="/wallet" className="hover:text-gray-600 hover:underline">
{t("notFound.wallet")}
</Link>
</div>
</div>