diff --git a/web/src/components/RenameTagDialog.tsx b/web/src/components/RenameTagDialog.tsx index 86d67ee04..6ca8fa566 100644 --- a/web/src/components/RenameTagDialog.tsx +++ b/web/src/components/RenameTagDialog.tsx @@ -24,11 +24,11 @@ const RenameTagDialog: React.FC = (props: Props) => { const handleConfirm = async () => { if (!newName || newName.includes(" ")) { - toast.error("Tag name cannot be empty or contain spaces"); + toast.error(t("tag.rename-error-empty")); return; } if (newName === tag) { - toast.error("New name cannot be the same as the old name"); + toast.error(t("tag.rename-error-repeat")); return; } @@ -38,7 +38,7 @@ const RenameTagDialog: React.FC = (props: Props) => { oldTag: tag, newTag: newName, }); - toast.success("Rename tag successfully"); + toast.success(t("tag.rename-success")); } catch (error: any) { console.error(error); toast.error(error.details); @@ -57,16 +57,16 @@ const RenameTagDialog: React.FC = (props: Props) => {
- Old Name + {t("tag.old-name")}
- New Name + {t("tag.new-name")}
-

All your memos with this tag will be updated.

+

{t("tag.rename-tip")}

diff --git a/web/src/locales/en.json b/web/src/locales/en.json index d6e1f69c2..8ee2f0064 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -395,7 +395,14 @@ "create-tags-guide": "You can create tags by inputting `#tag`.", "delete-confirm": "Are you sure to delete this tag? All related memos will be archived.", "delete-tag": "Delete Tag", - "no-tag-found": "No tag found" + "no-tag-found": "No tag found", + "rename-tag": "Rename tag", + "old-name": "Old Name", + "new-name": "New Name", + "rename-tip": "All your memos with this tag will be updated.", + "rename-error-empty": "Tag name cannot be empty or contain spaces", + "rename-error-repeat": "New name cannot be the same as the old name", + "rename-success": "Rename tag successfully" }, "markdown": { "code-block": "Code block", diff --git a/web/src/locales/zh-Hans.json b/web/src/locales/zh-Hans.json index c031dc46f..f1b86742e 100644 --- a/web/src/locales/zh-Hans.json +++ b/web/src/locales/zh-Hans.json @@ -52,7 +52,7 @@ "preview": "预览", "profile": "个人资料", "remember-me": "保持登录", - "rename": "改名", + "rename": "重命名", "reset": "重置", "resources": "资源库", "restore": "恢复", @@ -379,7 +379,14 @@ "create-tags-guide": "您可以通过输入 “#标签” 创建标签。", "delete-confirm": "您确定要删除此标签吗?所有相关的备忘录将会被归档。", "delete-tag": "删除标签", - "no-tag-found": "没找到此标签" + "no-tag-found": "没找到此标签", + "rename-tag": "标签重命名", + "old-name": "旧名称", + "new-name": "新名称", + "rename-tip": "您的所有带有此标签的备忘录将被更新。", + "rename-error-empty": "新名称不能为空或包含空格", + "rename-error-repeat": "新名称不能与旧名称相同", + "rename-success": "重命名成功" }, "markdown": { "code-block": "代码块",