Add missing translations.

This commit is contained in:
2025-07-31 16:32:19 +08:00
parent 4eede5e76a
commit 619dc01bf4
2 changed files with 10 additions and 5 deletions

View File

@@ -228,6 +228,7 @@ export const i18nData = {
"Data from": "数据来源", "Data from": "数据来源",
"Collections": "合集",
"Create Collection": "创建合集", "Create Collection": "创建合集",
"Create": "创建", "Create": "创建",
"Image size exceeds 5MB limit": "图片大小超过5MB限制", "Image size exceeds 5MB limit": "图片大小超过5MB限制",
@@ -481,6 +482,7 @@ export const i18nData = {
"Data from": "數據來源", "Data from": "數據來源",
"Collections": "合集",
"Create Collection": "創建合集", "Create Collection": "創建合集",
"Create": "創建", "Create": "創建",
"Image size exceeds 5MB limit": "圖片大小超過5MB限制", "Image size exceeds 5MB limit": "圖片大小超過5MB限制",

View File

@@ -23,7 +23,6 @@ import {
import { useTranslation } from "../utils/i18n"; import { useTranslation } from "../utils/i18n";
import { app } from "../app.ts"; import { app } from "../app.ts";
import Markdown from "react-markdown"; import Markdown from "react-markdown";
import { t } from "i18next";
import { Debounce } from "../utils/debounce.ts"; import { Debounce } from "../utils/debounce.ts";
export default function UserPage() { export default function UserPage() {
@@ -33,6 +32,8 @@ export default function UserPage() {
const location = useLocation(); const location = useLocation();
const navigate = useNavigate(); const navigate = useNavigate();
const { t } = useTranslation();
// 解码用户名,确保特殊字符被还原 // 解码用户名,确保特殊字符被还原
const username = rawUsername ? decodeURIComponent(rawUsername) : ""; const username = rawUsername ? decodeURIComponent(rawUsername) : "";
@@ -102,28 +103,28 @@ export default function UserPage() {
className={`tab ${page === 0 ? "tab-active" : ""} `} className={`tab ${page === 0 ? "tab-active" : ""} `}
onClick={() => updateHash(0)} onClick={() => updateHash(0)}
> >
Collections {t("Collections")}
</div> </div>
<div <div
role="tab" role="tab"
className={`tab ${page === 1 ? "tab-active" : ""} `} className={`tab ${page === 1 ? "tab-active" : ""} `}
onClick={() => updateHash(1)} onClick={() => updateHash(1)}
> >
Resources {t("Resources")}
</div> </div>
<div <div
role="tab" role="tab"
className={`tab ${page === 2 ? "tab-active" : ""}`} className={`tab ${page === 2 ? "tab-active" : ""}`}
onClick={() => updateHash(2)} onClick={() => updateHash(2)}
> >
Comments {t("Comments")}
</div> </div>
<div <div
role="tab" role="tab"
className={`tab ${page === 3 ? "tab-active" : ""}`} className={`tab ${page === 3 ? "tab-active" : ""}`}
onClick={() => updateHash(3)} onClick={() => updateHash(3)}
> >
Files {t("Files")}
</div> </div>
</div> </div>
<div className="w-full"> <div className="w-full">
@@ -501,6 +502,8 @@ function CollectionsList({
function CollectionCard({ collection }: { collection: Collection }) { function CollectionCard({ collection }: { collection: Collection }) {
const navigate = useNavigate(); const navigate = useNavigate();
const { t } = useTranslation();
return ( return (
<div <div
className={ className={