diff --git a/web/src/components/ArchivedMemo.tsx b/web/src/components/ArchivedMemo.tsx index 7b237ba4..c378fdda 100644 --- a/web/src/components/ArchivedMemo.tsx +++ b/web/src/components/ArchivedMemo.tsx @@ -1,4 +1,3 @@ -import { IMAGE_URL_REG } from "../helpers/marked"; import * as utils from "../helpers/utils"; import useI18n from "../hooks/useI18n"; import useToggle from "../hooks/useToggle"; @@ -44,7 +43,7 @@ const ArchivedMemo: React.FC = (props: Props) => { rowStatus: "NORMAL", }); await memoService.fetchMemos(); - toastHelper.info(t("common.restored-successfully")); + toastHelper.info(t("message.restored-successfully")); } catch (error: any) { console.error(error); toastHelper.error(error.response.data.message); diff --git a/web/src/components/ChangeMemoCreatedTsDialog.tsx b/web/src/components/ChangeMemoCreatedTsDialog.tsx index fd0f3187..cc2ddf86 100644 --- a/web/src/components/ChangeMemoCreatedTsDialog.tsx +++ b/web/src/components/ChangeMemoCreatedTsDialog.tsx @@ -23,7 +23,7 @@ const ChangeMemoCreatedTsDialog: React.FC = (props: Props) => { const datetime = dayjs(memo.createdTs).format("YYYY-MM-DDTHH:mm"); setCreatedAt(datetime); } else { - toastHelper.error(t("common.memo-not-found")); + toastHelper.error(t("message.memo-not-found")); destroy(); } }, []); @@ -42,7 +42,7 @@ const ChangeMemoCreatedTsDialog: React.FC = (props: Props) => { const createdTs = dayjs(createdAt).unix(); if (createdTs > nowTs) { - toastHelper.error(t("common.invalid-created-datetime")); + toastHelper.error(t("message.invalid-created-datetime")); return; } @@ -51,7 +51,7 @@ const ChangeMemoCreatedTsDialog: React.FC = (props: Props) => { id: memoId, createdTs, }); - toastHelper.info(t("common.memo-updated-datetime")); + toastHelper.info(t("message.memo-updated-datetime")); handleCloseBtnClick(); } catch (error: any) { console.error(error); @@ -62,7 +62,7 @@ const ChangeMemoCreatedTsDialog: React.FC = (props: Props) => { return ( <>
-

{t("common.change-memo-created-time")}

+

{t("message.change-memo-created-time")}

diff --git a/web/src/components/ChangePasswordDialog.tsx b/web/src/components/ChangePasswordDialog.tsx index 6d3ca3a9..a565d045 100644 --- a/web/src/components/ChangePasswordDialog.tsx +++ b/web/src/components/ChangePasswordDialog.tsx @@ -41,12 +41,12 @@ const ChangePasswordDialog: React.FC = ({ destroy }: Props) => { const handleSaveBtnClick = async () => { if (newPassword === "" || newPasswordAgain === "") { - toastHelper.error(t("common.fill-all")); + toastHelper.error(t("message.fill-all")); return; } if (newPassword !== newPasswordAgain) { - toastHelper.error(t("common.new-password-not-match")); + toastHelper.error(t("message.new-password-not-match")); setNewPasswordAgain(""); return; } diff --git a/web/src/components/CreateShortcutDialog.tsx b/web/src/components/CreateShortcutDialog.tsx index afb60dc0..ab40200b 100644 --- a/web/src/components/CreateShortcutDialog.tsx +++ b/web/src/components/CreateShortcutDialog.tsx @@ -113,7 +113,7 @@ const CreateShortcutDialog: React.FC = (props: Props) => { diff --git a/web/src/components/Memo.tsx b/web/src/components/Memo.tsx index 866bd469..fa6858eb 100644 --- a/web/src/components/Memo.tsx +++ b/web/src/components/Memo.tsx @@ -105,7 +105,7 @@ const Memo: React.FC = (props: Props) => { if (memoTemp) { showMemoCardDialog(memoTemp); } else { - toastHelper.error(t("common.memo-not-found")); + toastHelper.error(t("message.memo-not-found")); targetEl.classList.remove("memo-link-text"); } } else if (targetEl.className === "tag-span") { diff --git a/web/src/components/MemoCardDialog.tsx b/web/src/components/MemoCardDialog.tsx index 4de8e29d..7b89fc2d 100644 --- a/web/src/components/MemoCardDialog.tsx +++ b/web/src/components/MemoCardDialog.tsx @@ -97,7 +97,7 @@ const MemoCardDialog: React.FC = (props: Props) => { setLinkedMemos([]); setMemo(nextMemo); } else { - toastHelper.error(t("common.memo-not-found")); + toastHelper.error(t("message.memo-not-found")); targetEl.classList.remove("memo-link-text"); } } diff --git a/web/src/components/MemoList.tsx b/web/src/components/MemoList.tsx index b39956f1..6ec896aa 100644 --- a/web/src/components/MemoList.tsx +++ b/web/src/components/MemoList.tsx @@ -108,7 +108,7 @@ const MemoList = () => { ))}
-

{sortedMemos.length === 0 ? t("common.no-memos") : showMemoFilter ? "" : t("common.memos-ready")}

+

{sortedMemos.length === 0 ? t("message.no-memos") : showMemoFilter ? "" : t("message.memos-ready")}

diff --git a/web/src/components/Settings/MemberSection.tsx b/web/src/components/Settings/MemberSection.tsx index 8644eb49..be1bee01 100644 --- a/web/src/components/Settings/MemberSection.tsx +++ b/web/src/components/Settings/MemberSection.tsx @@ -48,7 +48,7 @@ const PreferencesSection = () => { const handleCreateUserBtnClick = async () => { if (isEmpty(state.createUserEmail) || isEmpty(state.createUserPassword)) { - toastHelper.error(t("common.fill-form")); + toastHelper.error(t("message.fill-form")); return; } diff --git a/web/src/components/ShareMemoImageDialog.tsx b/web/src/components/ShareMemoImageDialog.tsx index 786d68db..e7648953 100644 --- a/web/src/components/ShareMemoImageDialog.tsx +++ b/web/src/components/ShareMemoImageDialog.tsx @@ -59,7 +59,7 @@ const ShareMemoImageDialog: React.FC = (props: Props) => { const handleImageOnLoad = (event: React.SyntheticEvent) => { if (event.type === "error") { - toastHelper.error(t("common.image-load-failed")); + toastHelper.error(t("message.image-load-failed")); (event.target as HTMLImageElement).remove(); } setImgAmount(imgAmount - 1); diff --git a/web/src/locales/en.json b/web/src/locales/en.json index 81bd29b2..0f25eaab 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -30,27 +30,12 @@ "back-to-home": "Back to Home", "type": "Type", "shortcuts": "Shortcuts", - "shortcut-title": "shortcut title", "title": "Title", "filter": "Filter", "tags": "Tags", - "no-memos": "no memos 🌃", - "memos-ready": "all memos are ready 🎉", "yourself": "Yourself", "archived-at": "Archived at", - "restored-successfully": "Restored successfully", - "memo-updated-datetime":"Memo created datetime changed.", - "invalid-created-datetime": "Invalid created datetime.", - "change-memo-created-time": "Change memo created time", - "memo-not-found": "Memo not found.", - "fill-all": "Please fill in all fields.", - "new-password-not-match": "New passwords do not match.", - "changed": "changed", - "image-load-failed": "Image load failed", - "fill-form": "Please fill out this form", - "login-failed": "Login failed", - "signup-failed": "Signup failed", - "user-not-found": "User not found" + "changed": "changed" }, "slogan": "An open source, self-hosted knowledge base that works with a SQLite db file.", "auth": { @@ -94,6 +79,7 @@ "fetching-data": "fetching data..." }, "shortcut-list": { + "shortcut-title": "shortcut title", "create-shortcut": "Create Shortcut", "edit-shortcut": "Edit Shortcut", "new-filter": "New Filter", @@ -122,5 +108,21 @@ "member-section": { "create-a-member": "Create a member" } + }, + "message": { + "no-memos": "no memos 🌃", + "memos-ready": "all memos are ready 🎉", + "restored-successfully": "Restored successfully", + "memo-updated-datetime": "Memo created datetime changed.", + "invalid-created-datetime": "Invalid created datetime.", + "change-memo-created-time": "Change memo created time", + "memo-not-found": "Memo not found.", + "fill-all": "Please fill in all fields.", + "new-password-not-match": "New passwords do not match.", + "image-load-failed": "Image load failed", + "fill-form": "Please fill out this form", + "login-failed": "Login failed", + "signup-failed": "Signup failed", + "user-not-found": "User not found" } } diff --git a/web/src/locales/vi.json b/web/src/locales/vi.json index aabdea33..30d996e8 100644 --- a/web/src/locales/vi.json +++ b/web/src/locales/vi.json @@ -30,27 +30,12 @@ "back-to-home": "Quay về trang chủ", "type": "Kiểu", "shortcuts": "Lối tắt", - "shortcut-title": "Tên lối tắt", "title": "Tên", "filter": "Bộ lọc", "tags": "Thẻ", - "no-memos": "Không có memo nào 🌃", - "memos-ready": "Tất cả memo ở đây rồi 🎉", "yourself": "Của bạn", "archived-at": "Lưu trữ lúc", - "restored-successfully": "Đã khôi phục thành công", - "memo-updated-datetime":"Memo đã thay đổi ngày giờ tạo.", - "invalid-created-datetime": "Ngày giờ tạo không hợp lệ.", - "change-memo-created-time": "Thay đổi thời gian tạo memo", - "memo-not-found": "Không tìm thấy memo.", - "fill-all": "Vui lòng nhập tất cả các mục.", - "new-password-not-match": "Mật khẩu mới không giống nhau.", - "changed": "đã thay đổi", - "image-load-failed": "Tải ảnh bị lỗi", - "fill-form": "Please fill out this form", - "login-failed": "Đăng nhập thất bại", - "signup-failed": "Đăng ký thất bại", - "user-not-found": "Không tìm thấy người dùng này" + "changed": "đã thay đổi" }, "slogan": "Một mã nguồn mở, tự lưu lại mọi thứ bạn biết dựa trên SQLite db.", "auth": { @@ -94,6 +79,7 @@ "fetching-data": "đang tải dữ liệu..." }, "shortcut-list": { + "shortcut-title": "Tên lối tắt", "create-shortcut": "Tạo lối tắt", "edit-shortcut": "Chỉnh sửa lối tắt", "new-filter": "Bộ lọc mới", @@ -122,5 +108,21 @@ "member-section": { "create-a-member": "Tạo một thành viên" } + }, + "message": { + "no-memos": "Không có memo nào 🌃", + "memos-ready": "Tất cả memo ở đây rồi 🎉", + "restored-successfully": "Đã khôi phục thành công", + "memo-updated-datetime": "Memo đã thay đổi ngày giờ tạo.", + "invalid-created-datetime": "Ngày giờ tạo không hợp lệ.", + "change-memo-created-time": "Thay đổi thời gian tạo memo", + "memo-not-found": "Không tìm thấy memo.", + "fill-all": "Vui lòng nhập tất cả các mục.", + "new-password-not-match": "Mật khẩu mới không giống nhau.", + "image-load-failed": "Tải ảnh bị lỗi", + "fill-form": "Please fill out this form", + "login-failed": "Đăng nhập thất bại", + "signup-failed": "Đăng ký thất bại", + "user-not-found": "Không tìm thấy người dùng này" } } diff --git a/web/src/locales/zh.json b/web/src/locales/zh.json index b384b037..3448f9d7 100644 --- a/web/src/locales/zh.json +++ b/web/src/locales/zh.json @@ -30,27 +30,12 @@ "back-to-home": "回到主页", "type": "类型", "shortcuts": "捷径", - "shortcut-title": "捷径标题", "title": "标题", "filter": "过滤器", "tags": "全部标签", - "no-memos": "没有 memo 了 🌃", - "memos-ready": "所有 memo 已就绪 🎉", "yourself": "你自己", "archived-at": "归档于", - "restored-successfully": "恢复成功", - "memo-updated-datetime": "Memo创建日期时间已更改。", - "invalid-created-datetime": "创建的日期时间无效。", - "change-memo-created-time": "更改Memo创建时间", - "memo-not-found": "找不到Memo。", - "fill-all": "请填写所有字段。", - "new-password-not-match": "新密码不匹配。", - "changed": "已更改", - "image-load-failed": "图片加载失败", - "fill-form": "请填写此表单", - "login-failed": "登录失败", - "signup-failed": "注册失败", - "user-not-found": "未找到用户" + "changed": "已更改" }, "slogan": "一个开源的、支持私有化部署的碎片化知识卡片管理工具。", "auth": { @@ -94,6 +79,7 @@ "fetching-data": "请求数据中..." }, "shortcut-list": { + "shortcut-title": "捷径标题", "create-shortcut": "创建捷径", "edit-shortcut": "编辑捷径", "new-filter": "新建过滤器", @@ -122,5 +108,21 @@ "member-section": { "create-a-member": "创建成员" } + }, + "message": { + "no-memos": "没有 memo 了 🌃", + "memos-ready": "所有 memo 已就绪 🎉", + "restored-successfully": "恢复成功", + "memo-updated-datetime": "Memo创建日期时间已更改。", + "invalid-created-datetime": "创建的日期时间无效。", + "change-memo-created-time": "更改Memo创建时间", + "memo-not-found": "找不到Memo。", + "fill-all": "请填写所有字段。", + "new-password-not-match": "新密码不匹配。", + "image-load-failed": "图片加载失败", + "fill-form": "请填写此表单", + "login-failed": "登录失败", + "signup-failed": "注册失败", + "user-not-found": "未找到用户" } } diff --git a/web/src/pages/Auth.tsx b/web/src/pages/Auth.tsx index 6125a5b0..dfbcd0a0 100644 --- a/web/src/pages/Auth.tsx +++ b/web/src/pages/Auth.tsx @@ -70,7 +70,7 @@ const Auth = () => { if (user) { locationService.replaceHistory("/"); } else { - toastHelper.error(t("common.login-failed")); + toastHelper.error(t("message.login-failed")); } } catch (error: any) { console.error(error); diff --git a/web/src/pages/Home.tsx b/web/src/pages/Home.tsx index e8f1b671..0f93ff2a 100644 --- a/web/src/pages/Home.tsx +++ b/web/src/pages/Home.tsx @@ -31,7 +31,7 @@ function Home() { if (userService.isVisitorMode()) { if (!owner) { - toastHelper.error(t("common.user-not-found")); + toastHelper.error(t("message.user-not-found")); } } else { if (!user) {