diff --git a/apps/user/components/header.tsx b/apps/user/components/header.tsx index f6e8744..46d54c1 100644 --- a/apps/user/components/header.tsx +++ b/apps/user/components/header.tsx @@ -6,10 +6,13 @@ import Image from 'next/legacy/image'; import Link from 'next/link'; import LanguageSwitch from './language-switch'; // import { MobileSidebar } from './mobile-sidebar'; +import { useTranslations } from 'next-intl'; import ThemeSwitch from './theme-switch'; import { UserNav } from './user-nav'; export default function Header() { + const t = useTranslations('common'); + const { common, user } = useGlobalStore(); const { site } = common; const Logo = ( @@ -37,7 +40,7 @@ export default function Header() { size: 'sm', })} > - 登录/注册 + {t('login')} )} diff --git a/apps/user/locales/en-US/common.json b/apps/user/locales/en-US/common.json index 71983c9..32df615 100644 --- a/apps/user/locales/en-US/common.json +++ b/apps/user/locales/en-US/common.json @@ -16,6 +16,7 @@ "rowsPerPage": "Rows per page", "selectedItems": "{total} items selected" }, + "login": "Log in / Sign up", "request": { "10001": "Database query failed, please try again later", "10002": "Data update failed, please try again later", diff --git a/apps/user/locales/zh-CN/common.json b/apps/user/locales/zh-CN/common.json index 82b1078..24943af 100644 --- a/apps/user/locales/zh-CN/common.json +++ b/apps/user/locales/zh-CN/common.json @@ -16,6 +16,7 @@ "rowsPerPage": "每页行数", "selectedItems": "已选择 {total} 行" }, + "login": "登录/注册", "request": { "10001": "数据库查询失败,请稍后重试", "10002": "数据更新失败,请稍后重试",