From fe3b78f8441a3c71c5cdd4b7cdac2dfa94a244d4 Mon Sep 17 00:00:00 2001 From: Steven Date: Sat, 30 Sep 2023 22:57:30 +0800 Subject: [PATCH] chore: update i18n --- frontend/locales/en.json | 8 ++++++++ frontend/locales/zh.json | 8 ++++++++ frontend/web/src/components/EditUserinfoDialog.tsx | 4 ++-- frontend/web/src/components/Navigator.tsx | 6 ++++-- frontend/web/src/components/ShortcutCard.tsx | 2 +- frontend/web/src/components/ViewSetting.tsx | 8 +++++--- 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/frontend/locales/en.json b/frontend/locales/en.json index 53538d5..fab869d 100644 --- a/frontend/locales/en.json +++ b/frontend/locales/en.json @@ -31,6 +31,7 @@ "operating-system": "Operating System" }, "shortcut": { + "visits": "{{count}} visits", "visibility": { "private": { "self": "Private", @@ -46,6 +47,13 @@ } } }, + "filter": { + "all": "All", + "mine": "Mine", + "compact-mode": "Compact mode", + "order-by": "Order by", + "direction": "Direction" + }, "user": { "self": "User", "nickname": "Nickname", diff --git a/frontend/locales/zh.json b/frontend/locales/zh.json index 4f8ee8f..6b5030d 100644 --- a/frontend/locales/zh.json +++ b/frontend/locales/zh.json @@ -31,6 +31,7 @@ "operating-system": "操作系统" }, "shortcut": { + "visits": "{{count}} 次访问", "visibility": { "private": { "self": "私有的", @@ -46,6 +47,13 @@ } } }, + "filter": { + "all": "所有", + "mine": "我的", + "compact-mode": "紧凑模式", + "order-by": "排序方式", + "direction": "方向" + }, "user": { "self": "用户", "nickname": "昵称", diff --git a/frontend/web/src/components/EditUserinfoDialog.tsx b/frontend/web/src/components/EditUserinfoDialog.tsx index 30e2a54..b57b643 100644 --- a/frontend/web/src/components/EditUserinfoDialog.tsx +++ b/frontend/web/src/components/EditUserinfoDialog.tsx @@ -66,11 +66,11 @@ const EditUserinfoDialog: React.FC = (props: Props) => {
- Email + {t("common.email")}
- Nickname + {t("user.nickname")}
diff --git a/frontend/web/src/components/Navigator.tsx b/frontend/web/src/components/Navigator.tsx index 0c805b6..987d9ca 100644 --- a/frontend/web/src/components/Navigator.tsx +++ b/frontend/web/src/components/Navigator.tsx @@ -1,9 +1,11 @@ import classNames from "classnames"; +import { useTranslation } from "react-i18next"; import { useAppSelector } from "../stores"; import useViewStore from "../stores/v1/view"; import Icon from "./Icon"; const Navigator = () => { + const { t } = useTranslation(); const viewStore = useViewStore(); const { shortcutList } = useAppSelector((state) => state.shortcut); const tags = shortcutList.map((shortcut) => shortcut.tags).flat(); @@ -22,7 +24,7 @@ const Navigator = () => { onClick={() => viewStore.setFilter({ tab: "tab:all" })} > - All + {t("filter.all")} {Array.from(sortedTagMap.keys()).map((tag) => (
diff --git a/frontend/web/src/components/ViewSetting.tsx b/frontend/web/src/components/ViewSetting.tsx index 5deb504..7d60858 100644 --- a/frontend/web/src/components/ViewSetting.tsx +++ b/frontend/web/src/components/ViewSetting.tsx @@ -1,9 +1,11 @@ import { Divider, Option, Select, Switch } from "@mui/joy"; +import { useTranslation } from "react-i18next"; import useViewStore from "../stores/v1/view"; import Icon from "./Icon"; import Dropdown from "./common/Dropdown"; const ViewSetting = () => { + const { t } = useTranslation(); const viewStore = useViewStore(); const order = viewStore.getOrder(); const { field, direction } = order; @@ -20,7 +22,7 @@ const ViewSetting = () => { actions={
e.stopPropagation()}>
- Compact mode + {t("filter.compact-mode")} {
- Order by + {t("filter.order-by")}
- Direction + {t("filter.direction")}