diff --git a/web/src/components/CreateTagDialog.tsx b/web/src/components/CreateTagDialog.tsx index 8d45d09..452534c 100644 --- a/web/src/components/CreateTagDialog.tsx +++ b/web/src/components/CreateTagDialog.tsx @@ -1,6 +1,7 @@ import { Input } from "@mui/joy"; import React, { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; +import { useTranslation } from "react-i18next"; import { useTagStore } from "../store/module"; import { getTagSuggestionList } from "../helpers/api"; import { matcher } from "../labs/marked/matcher"; @@ -21,6 +22,7 @@ const validateTagName = (tagName: string): boolean => { const CreateTagDialog: React.FC = (props: Props) => { const { destroy } = props; const tagStore = useTagStore(); + const { t } = useTranslation(); const [tagName, setTagName] = useState(""); const [suggestTagNameList, setSuggestTagNameList] = useState([]); const [showTagSuggestions, setShowTagSuggestions] = useState(false); @@ -82,7 +84,7 @@ const CreateTagDialog: React.FC = (props: Props) => { return ( <>
-

Create Tag

+

{t("tag-list.create-tag")}

@@ -91,7 +93,7 @@ const CreateTagDialog: React.FC = (props: Props) => { = (props: Props) => { /> {tagNameList.length > 0 && ( <> -

All tags

+

{t("tag-list.all-tags")}

{Array.from(tagNameList) .sort() diff --git a/web/src/locales/en.json b/web/src/locales/en.json index e7e5afa..51cb71c 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -142,7 +142,10 @@ "text-placeholder": "Starts with ^ to use regex" }, "tag-list": { - "tip-text": "Input `#tag` to create" + "tip-text": "Input `#tag` to create", + "create-tag": "Create Tag", + "all-tags": "All Tags", + "tag-name": "TAG_NAME" }, "search": { "quickly-filter": "Quickly filter" diff --git a/web/src/locales/zh.json b/web/src/locales/zh.json index abafd99..166e30c 100644 --- a/web/src/locales/zh.json +++ b/web/src/locales/zh.json @@ -142,7 +142,10 @@ "text-placeholder": "以 ^ 开头使用正则表达式" }, "tag-list": { - "tip-text": "输入`#tag `来创建标签" + "tip-text": "输入`#tag `来创建标签", + "create-tag": "创建标签", + "all-tags": "全部标签", + "tag-name": "标签名称" }, "search": { "quickly-filter": "快速过滤"