diff --git a/messages/en-US.json b/messages/en-US.json new file mode 100644 index 0000000..3293323 --- /dev/null +++ b/messages/en-US.json @@ -0,0 +1,5 @@ +{ + "DashboardPage": { + "title": "Welcome to Judge4c!" + } +} \ No newline at end of file diff --git a/messages/zh-CN.json b/messages/zh-CN.json new file mode 100644 index 0000000..40c4183 --- /dev/null +++ b/messages/zh-CN.json @@ -0,0 +1,5 @@ +{ + "DashboardPage": { + "title": "欢迎来到 Judge4c!" + } +} \ No newline at end of file diff --git a/next.config.ts b/next.config.ts index e9ffa30..5f57d48 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,8 @@ import type { NextConfig } from "next"; +import createNextIntlPlugin from "next-intl/plugin"; -const nextConfig: NextConfig = { - /* config options here */ -}; +const withNextIntl = createNextIntlPlugin(); -export default nextConfig; +const nextConfig: NextConfig = {}; + +export default withNextIntl(nextConfig); diff --git a/package.json b/package.json index 2f438bf..688e8e2 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "lucide-react": "^0.468.0", "next": "15.0.4", "next-auth": "^5.0.0-beta.25", + "next-intl": "^3.26.1", "next-themes": "^0.4.4", "react": "^19.0.0", "react-dom": "^19.0.0", diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 0942822..4331d60 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -1,8 +1,13 @@ +import { useTranslations } from "next-intl"; + export default function DashboardPage() { + const t = useTranslations("DashboardPage"); return (