diff --git a/frontend/src/i18n.ts b/frontend/src/i18n.ts index a5e2815..737761f 100644 --- a/frontend/src/i18n.ts +++ b/frontend/src/i18n.ts @@ -228,6 +228,7 @@ export const i18nData = { "Data from": "数据来源", + "Collections": "合集", "Create Collection": "创建合集", "Create": "创建", "Image size exceeds 5MB limit": "图片大小超过5MB限制", @@ -481,6 +482,7 @@ export const i18nData = { "Data from": "數據來源", + "Collections": "合集", "Create Collection": "創建合集", "Create": "創建", "Image size exceeds 5MB limit": "圖片大小超過5MB限制", diff --git a/frontend/src/pages/user_page.tsx b/frontend/src/pages/user_page.tsx index 1a1feb4..f73f09e 100644 --- a/frontend/src/pages/user_page.tsx +++ b/frontend/src/pages/user_page.tsx @@ -23,7 +23,6 @@ import { import { useTranslation } from "../utils/i18n"; import { app } from "../app.ts"; import Markdown from "react-markdown"; -import { t } from "i18next"; import { Debounce } from "../utils/debounce.ts"; export default function UserPage() { @@ -33,6 +32,8 @@ export default function UserPage() { const location = useLocation(); const navigate = useNavigate(); + const { t } = useTranslation(); + // 解码用户名,确保特殊字符被还原 const username = rawUsername ? decodeURIComponent(rawUsername) : ""; @@ -102,28 +103,28 @@ export default function UserPage() { className={`tab ${page === 0 ? "tab-active" : ""} `} onClick={() => updateHash(0)} > - Collections + {t("Collections")}