diff --git a/messages/en-US.json b/messages/en-US.json index 3293323..5ce9c45 100644 --- a/messages/en-US.json +++ b/messages/en-US.json @@ -1,5 +1,16 @@ { - "DashboardPage": { - "title": "Welcome to Judge4c!" + "Page": { + "DashboardPage": { + "title": "Welcome to Judge4c!" + } + }, + "Components": { + "NavUser": { + "profile": "Profile", + "notifications": "Notifications", + "settings": "Settings", + "logout": "Log out", + "login": "Log in" + } } } \ No newline at end of file diff --git a/messages/zh-CN.json b/messages/zh-CN.json index 40c4183..1ea6175 100644 --- a/messages/zh-CN.json +++ b/messages/zh-CN.json @@ -1,5 +1,16 @@ { - "DashboardPage": { - "title": "欢迎来到 Judge4c!" + "Page": { + "DashboardPage": { + "title": "欢迎使用Judge4c!" + } + }, + "Components": { + "NavUser": { + "profile": "个人资料", + "notifications": "通知", + "settings": "设置", + "logout": "登出", + "login": "登录" + } } } \ No newline at end of file diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 4331d60..683e0fe 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -1,7 +1,7 @@ import { useTranslations } from "next-intl"; export default function DashboardPage() { - const t = useTranslations("DashboardPage"); + const t = useTranslations("Page.DashboardPage"); return (
diff --git a/src/components/nav-user.tsx b/src/components/nav-user.tsx index 4df53ac..4db161c 100644 --- a/src/components/nav-user.tsx +++ b/src/components/nav-user.tsx @@ -24,6 +24,7 @@ import { DropdownMenuTrigger, DropdownMenuSeparator, } from "@/components/ui/dropdown-menu"; +import { useTranslations } from "next-intl"; import useConfirmationStore from "@/store/confirmationStore"; import { signIn, signOut, useSession } from "next-auth/react"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; @@ -46,6 +47,7 @@ export const NavUser = ({ }) => { const { isMobile } = useSidebar(); const { data: session } = useSession(); + const t = useTranslations("Components.NavUser"); const { openConfirmation } = useConfirmationStore(); const currentUser = useMemo(() => { @@ -106,18 +108,18 @@ export const NavUser = ({ - Profile + {t("profile")} - Notifications + {t("notifications")} - Settings + {t("settings")} @@ -137,7 +139,7 @@ export const NavUser = ({ }} > - Log out + {t("logout")} @@ -145,7 +147,7 @@ export const NavUser = ({ signIn()}> - Log in + {t("login")} )}