diff --git a/messages/en.json b/messages/en.json index 39a9da4..a27829d 100644 --- a/messages/en.json +++ b/messages/en.json @@ -8,6 +8,7 @@ } }, "UserAvatar": { + "Dashboard": "Dashboard", "Settings": "Settings", "LogIn": "LogIn", "LogOut": "LogOut" diff --git a/messages/zh.json b/messages/zh.json index 2e7430f..79d966f 100644 --- a/messages/zh.json +++ b/messages/zh.json @@ -8,6 +8,7 @@ } }, "UserAvatar": { + "Dashboard": "仪表板", "Settings": "设置", "LogIn": "登录", "LogOut": "登出" diff --git a/src/components/dashboard-button.tsx b/src/components/dashboard-button.tsx index 93b5bc8..8e85deb 100644 --- a/src/components/dashboard-button.tsx +++ b/src/components/dashboard-button.tsx @@ -1,16 +1,18 @@ "use client"; import { useRouter } from "next/navigation"; +import { useTranslations } from "next-intl"; import { LayoutDashboardIcon } from "lucide-react"; import { DropdownMenuItem } from "./ui/dropdown-menu"; export const DashboardButton = () => { const router = useRouter(); + const t = useTranslations("UserAvatar"); return ( router.push("/dashboard")}> - Dashboard + {t("Dashboard")} ); };