diff --git a/web/public/locales/en/translation.json b/web/public/locales/en/translation.json index 0973ef7840..18e0380afb 100644 --- a/web/public/locales/en/translation.json +++ b/web/public/locales/en/translation.json @@ -63,7 +63,8 @@ "Page": "Page", "Save": "Save", "Search": "Search", - "ToConfirm": "to determine", + "ToConfirm": "to confirm", + "NameNotMatch": "Name not match", "Total": "Total", "Update": "Update ", "UpdateSuccess": "Update Success", @@ -581,7 +582,9 @@ "SettingModal": { "Exchange": "Exchange", "FunctionName": "Funciton Name", - "FunctionDesc": "Function Description" + "FunctionDesc": "Function Description", + "FunctionDesc_Name": "Function Description - Name", + "FunctionName_Desc": "Function Name - Description" }, "Expenses": "Expenses", "OrderNumber": "Order Number", @@ -648,4 +651,4 @@ "LastPage": "Last Page", "FirstPage": "First Page", "SavedSuccessfully": "Saved Successfully" -} +} \ No newline at end of file diff --git a/web/public/locales/zh-CN/translation.json b/web/public/locales/zh-CN/translation.json index 3908e7747a..3afe1e8fb9 100644 --- a/web/public/locales/zh-CN/translation.json +++ b/web/public/locales/zh-CN/translation.json @@ -64,6 +64,7 @@ "Save": "保存", "Search": "搜索", "ToConfirm": "进行确定", + "NameNotMatch": "名称不匹配", "Total": "总数", "Update": "更新", "UpdateSuccess": "更新成功", @@ -581,7 +582,9 @@ "SettingModal": { "Exchange": "兑换", "FunctionName": "函数名", - "FunctionDesc": "函数描述" + "FunctionDesc": "函数描述", + "FunctionDesc_Name": "函数描述 - 函数名", + "FunctionName_Desc": "函数名 - 函数描述" }, "Expenses": "支出", "OrderNumber": "订单号", @@ -648,4 +651,4 @@ "LastPage": "最后一页", "FirstPage": "第一页", "SavedSuccessfully": "保存成功" -} +} \ No newline at end of file diff --git a/web/public/locales/zh/translation.json b/web/public/locales/zh/translation.json index b8425f6f1a..e20d2af3b0 100644 --- a/web/public/locales/zh/translation.json +++ b/web/public/locales/zh/translation.json @@ -64,6 +64,7 @@ "Save": "保存", "Search": "搜索", "ToConfirm": "进行确定", + "NameNotMatch": "名称不匹配", "Total": "总数", "Update": "更新", "UpdateSuccess": "更新成功", @@ -581,7 +582,9 @@ "SettingModal": { "Exchange": "兑换", "FunctionName": "函数名", - "FunctionDesc": "函数描述" + "FunctionDesc": "函数描述", + "FunctionDesc_Name": "函数描述 - 函数名", + "FunctionName_Desc": "函数名 - 函数描述" }, "MyIncomeAndExpenses": "我的收支", "Expenses": "支出", @@ -648,4 +651,4 @@ "LastPage": "最后一页", "FirstPage": "第一页", "SavedSuccessfully": "保存成功" -} +} \ No newline at end of file diff --git a/web/src/pages/app/database/mods/DeleteCollectionModal/index.tsx b/web/src/pages/app/database/mods/DeleteCollectionModal/index.tsx index 8834c015c3..7a823ca92c 100644 --- a/web/src/pages/app/database/mods/DeleteCollectionModal/index.tsx +++ b/web/src/pages/app/database/mods/DeleteCollectionModal/index.tsx @@ -3,7 +3,6 @@ import { useTranslation } from "react-i18next"; import { Button, FormControl, - FormErrorMessage, Input, Modal, ModalBody, @@ -19,6 +18,8 @@ import { RecycleDeleteIcon } from "@/components/CommonIcon"; import IconText from "@/components/IconText"; import { useDeleteDBMutation } from "../../service"; + +import useGlobalStore from "@/pages/globalStore"; function DeleteCollectionModal(props: { database: any }) { const { database } = props; const { t } = useTranslation(); @@ -28,14 +29,9 @@ function DeleteCollectionModal(props: { database: any }) { onClose(); }, }); + const { showError } = useGlobalStore(); - const { - register, - handleSubmit, - setFocus, - reset, - formState: { errors }, - } = useForm<{ + const { register, handleSubmit, setFocus, reset, setValue } = useForm<{ name: string; }>(); @@ -63,32 +59,33 @@ function DeleteCollectionModal(props: { database: any }) {

{t("CollectionPanel.DeleteCollectionTip")} {database.name} - {t("DeleteTip")}。 + {t("DeleteTip")}

{t("CollectionPanel.InputName")} {database.name} - {t("ToConfirm")}。 + {t("ToConfirm")}

{ + setValue("name", e.target.value.trim()); + }} /> - {errors.name && errors.name.message}