From 16cfef32d6b51c70ed5083b11c814fda24345633 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 26 Mar 2024 23:49:37 +0800 Subject: [PATCH] chore: tweak statistics translation --- web/src/components/MemoContent/index.tsx | 2 +- web/src/components/MemoView.tsx | 5 ++++- web/src/components/PersonalStatistics.tsx | 10 ++++++---- web/src/locales/en.json | 5 ++++- web/src/locales/zh-Hans.json | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/web/src/components/MemoContent/index.tsx b/web/src/components/MemoContent/index.tsx index f64878e8b..f5b2918cd 100644 --- a/web/src/components/MemoContent/index.tsx +++ b/web/src/components/MemoContent/index.tsx @@ -68,7 +68,7 @@ const MemoContent: React.FC = (props: Props) => { embeddedMemos: embeddedMemos || new Set(), }} > -
+
= (props: Props) => { {creator.nickname || creator.username} -
+
diff --git a/web/src/components/PersonalStatistics.tsx b/web/src/components/PersonalStatistics.tsx index f923d81a4..b3175dae7 100644 --- a/web/src/components/PersonalStatistics.tsx +++ b/web/src/components/PersonalStatistics.tsx @@ -3,6 +3,7 @@ import { memoServiceClient } from "@/grpcweb"; import { useTagStore } from "@/store/module"; import { useMemoStore } from "@/store/v1"; import { User } from "@/types/proto/api/v2/user_service"; +import { useTranslate } from "@/utils/i18n"; import Icon from "./Icon"; interface Props { @@ -11,6 +12,7 @@ interface Props { const PersonalStatistics = (props: Props) => { const { user } = props; + const t = useTranslate(); const tagStore = useTagStore(); const memoStore = useMemoStore(); const [memoAmount, setMemoAmount] = useState(0); @@ -37,25 +39,25 @@ const PersonalStatistics = (props: Props) => { return (
-

Statistics

+

{t("common.statistics")}

- Days + {t("common.days")}
{days}
- Memos + {t("common.memos")}
{isRequesting ? : {memoAmount}}
- Tags + {t("common.tags")}
{tags}
diff --git a/web/src/locales/en.json b/web/src/locales/en.json index e5aaf4d24..4967dfa28 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -61,7 +61,10 @@ "inbox": "Inbox", "search": "Search", "role": "Role", - "description": "Description" + "description": "Description", + "statistics": "Statistics", + "days": "Days", + "memos": "Memos" }, "router": { "go-to-home": "Go to Home", diff --git a/web/src/locales/zh-Hans.json b/web/src/locales/zh-Hans.json index cdf1d1515..4645458fb 100644 --- a/web/src/locales/zh-Hans.json +++ b/web/src/locales/zh-Hans.json @@ -69,7 +69,7 @@ "sign-in-with": "使用 {{provider}} 登录", "sign-out": "退出登录", "sign-up": "注册", - "tags": "全部标签", + "tags": "标签", "title": "标题", "type": "类型", "unpin": "取消置顶",