diff --git a/web/src/components/AboutSiteDialog.tsx b/web/src/components/AboutSiteDialog.tsx index 37088b75..47a88056 100644 --- a/web/src/components/AboutSiteDialog.tsx +++ b/web/src/components/AboutSiteDialog.tsx @@ -13,7 +13,7 @@ const AboutSiteDialog: React.FC = ({ destroy }: Props) => { <>

- 🤠关于 Memos + 🤠About Memos

- 把玩 flomo 后有感而作的开源项目 + Memos is an open source, self-hosted alternative to flomo.

-

特点:精美且细节的视觉样式、体验优良的交互逻辑

+

Built with `Golang` and `React`.


🏗 This project is working in progress,
and very pleasure to welcome your{" "} diff --git a/web/src/components/ChangePasswordDialog.tsx b/web/src/components/ChangePasswordDialog.tsx index e29d8fd6..8823a039 100644 --- a/web/src/components/ChangePasswordDialog.tsx +++ b/web/src/components/ChangePasswordDialog.tsx @@ -44,19 +44,19 @@ const ChangePasswordDialog: React.FC = ({ destroy }: Props) => { const handleSaveBtnClick = async () => { if (oldPassword === "" || newPassword === "" || newPasswordAgain === "") { - toastHelper.error("密码不能为空"); + toastHelper.error("Please fill in all fields."); return; } if (newPassword !== newPasswordAgain) { - toastHelper.error("新密码两次输入不一致"); + toastHelper.error("New passwords do not match."); setNewPasswordAgain(""); return; } const passwordValidResult = validate(newPassword, validateConfig); if (!passwordValidResult.result) { - toastHelper.error("密码 " + passwordValidResult.reason); + toastHelper.error("Password " + passwordValidResult.reason); return; } @@ -64,13 +64,13 @@ const ChangePasswordDialog: React.FC = ({ destroy }: Props) => { const isValid = await userService.checkPasswordValid(oldPassword); if (!isValid) { - toastHelper.error("旧密码不匹配"); + toastHelper.error("Old password is invalid."); setOldPassword(""); return; } await userService.updatePassword(newPassword); - toastHelper.info("密码修改成功!"); + toastHelper.info("Password changed."); handleCloseBtnClick(); } catch (error: any) { toastHelper.error(error); @@ -80,30 +80,30 @@ const ChangePasswordDialog: React.FC = ({ destroy }: Props) => { return ( <>

-

修改密码

+

Change Password

- 取消 + Cancel - 保存 + Save
diff --git a/web/src/components/ConfirmResetOpenIdDialog.tsx b/web/src/components/ConfirmResetOpenIdDialog.tsx index 8b3bb313..ffdc942d 100644 --- a/web/src/components/ConfirmResetOpenIdDialog.tsx +++ b/web/src/components/ConfirmResetOpenIdDialog.tsx @@ -27,29 +27,31 @@ const ConfirmResetOpenIdDialog: React.FC = ({ destroy }: Props) => { try { await userService.resetOpenId(); } catch (error) { - toastHelper.error("请求重置 Open API 失败"); + toastHelper.error("Request reset open API failed."); return; } - toastHelper.success("重置成功!"); + toastHelper.success("Reset open API succeeded."); handleCloseBtnClick(); }; return ( <>
-

重置 Open API

+

Reset Open API

-

⚠️ 现有 API 将失效,并生成新的 API,确定要重置吗?

+

+ ⚠️ The existing API will be invalidated and a new one will be generated, are you sure you want to reset? +

- 取消 + Cancel - 确定重置! + Reset!
diff --git a/web/src/components/CreateShortcutDialog.tsx b/web/src/components/CreateShortcutDialog.tsx index e327cab9..b58405f8 100644 --- a/web/src/components/CreateShortcutDialog.tsx +++ b/web/src/components/CreateShortcutDialog.tsx @@ -40,7 +40,7 @@ const CreateShortcutDialog: React.FC = (props: Props) => { const handleSaveBtnClick = async () => { if (!title) { - toastHelper.error("标题不能为空!"); + toastHelper.error("Title is required"); return; } @@ -62,7 +62,7 @@ const CreateShortcutDialog: React.FC = (props: Props) => { if (filters.length > 0) { const lastFilter = filters[filters.length - 1]; if (lastFilter.value.value === "") { - toastHelper.info("先完善上一个过滤器吧"); + toastHelper.info("Please fill in previous filter value"); return; } } @@ -90,7 +90,7 @@ const CreateShortcutDialog: React.FC = (props: Props) => {

🔖 - {shortcutId ? "编辑检索" : "创建检索"} + {shortcutId ? "Edit Shortcut" : "Create Shortcut"}

- 标题 + Title
- 过滤器 + Filter
{filters.map((f, index) => { return ( @@ -116,7 +116,7 @@ const CreateShortcutDialog: React.FC = (props: Props) => { ); })}
- 添加筛选条件 + New Filter
@@ -125,10 +125,10 @@ const CreateShortcutDialog: React.FC = (props: Props) => {
- 符合条件的 Memo 有 {shownMemoLength} 条 + {shownMemoLength} eligible memo
diff --git a/web/src/components/DailyMemoDiaryDialog.tsx b/web/src/components/DailyMemoDiaryDialog.tsx index 78d140d4..c8ac6215 100644 --- a/web/src/components/DailyMemoDiaryDialog.tsx +++ b/web/src/components/DailyMemoDiaryDialog.tsx @@ -106,11 +106,11 @@ const DailyMemoDiaryDialog: React.FC = (props: Props) => { /> {loadingState.isLoading ? (
-

努力加载中...

+

Loading...

) : memos.length === 0 ? (
-

空空如也

+

Oops, there is nothing.

) : (
diff --git a/web/src/components/DeletedMemo.tsx b/web/src/components/DeletedMemo.tsx index 5094eb09..8dcc1c9e 100644 --- a/web/src/components/DeletedMemo.tsx +++ b/web/src/components/DeletedMemo.tsx @@ -40,7 +40,7 @@ const DeletedMemo: React.FC = (props: Props) => { try { await memoService.restoreMemoById(memo.id); handleDeletedMemoAction(memo.id); - toastHelper.info("恢复成功"); + toastHelper.info("Restored successfully"); } catch (error: any) { toastHelper.error(error.message); } @@ -55,7 +55,7 @@ const DeletedMemo: React.FC = (props: Props) => { return (
- 删除于 {memo.deletedAtStr} + Deleted at {memo.deletedAtStr}
@@ -63,10 +63,10 @@ const DeletedMemo: React.FC = (props: Props) => {
- 恢复 + Restore - {showConfirmDeleteBtn ? "确定删除!" : "完全删除"} + {showConfirmDeleteBtn ? "Delete!" : "Delete"}
diff --git a/web/src/components/Editor/Editor.tsx b/web/src/components/Editor/Editor.tsx index 42aa3492..3e1165e3 100644 --- a/web/src/components/Editor/Editor.tsx +++ b/web/src/components/Editor/Editor.tsx @@ -176,12 +176,12 @@ const Editor = forwardRef((props: EditorProps, ref: React.ForwardedRef
diff --git a/web/src/components/Memo.tsx b/web/src/components/Memo.tsx index 9e82fbd0..5067e03b 100644 --- a/web/src/components/Memo.tsx +++ b/web/src/components/Memo.tsx @@ -93,19 +93,19 @@ const Memo: React.FC = (props: Props) => {
- 查看详情 + View Story Mark - 分享 + Share - 编辑 + Edit - {showConfirmDeleteBtn ? "确定删除!" : "删除"} + {showConfirmDeleteBtn ? "Delete!" : "Delete"}
@@ -151,7 +151,7 @@ export function formatMemoContent(content: string) { .replace(LINK_REG, "$1") .replace(MEMO_LINK_REG, "$1"); - // 中英文之间加空格 + // Add space in english and chinese if (shouldSplitMemoWord) { content = content .replace(/([\u4e00-\u9fa5])([A-Za-z0-9?.,;[\]]+)/g, "$1 $2") diff --git a/web/src/components/MemoCardDialog.tsx b/web/src/components/MemoCardDialog.tsx index 58c94db6..503ba308 100644 --- a/web/src/components/MemoCardDialog.tsx +++ b/web/src/components/MemoCardDialog.tsx @@ -148,7 +148,7 @@ const MemoCardDialog: React.FC = (props: Props) => {
{linkMemos.length > 0 ? (
-

关联了 {linkMemos.length} 个 MEMO

+

{linkMemos.length} related MEMO

{linkMemos.map((m) => { const rawtext = parseHtmlToRawText(formatMemoContent(m.content)).replaceAll("\n", " "); return ( @@ -162,7 +162,7 @@ const MemoCardDialog: React.FC = (props: Props) => { ) : null} {linkedMemos.length > 0 ? (
-

{linkedMemos.length} 个链接至此的 MEMO

+

{linkedMemos.length} linked MEMO

{linkedMemos.map((m) => { const rawtext = parseHtmlToRawText(formatMemoContent(m.content)).replaceAll("\n", " "); return ( diff --git a/web/src/components/MemoEditor.tsx b/web/src/components/MemoEditor.tsx index c9574d69..3c1d23a8 100644 --- a/web/src/components/MemoEditor.tsx +++ b/web/src/components/MemoEditor.tsx @@ -140,7 +140,7 @@ const MemoEditor: React.FC = () => { const handleSaveBtnClick = useCallback(async (content: string) => { if (content === "") { - toastHelper.error("内容不能为空呀"); + toastHelper.error("Content can't be empty"); return; } @@ -270,7 +270,7 @@ const MemoEditor: React.FC = () => { () => ({ className: "memo-editor", initialContent: getEditorContentCache(), - placeholder: "现在的想法是...", + placeholder: "Any thoughts...", showConfirmBtn: true, showCancelBtn: showEditStatus, onConfirmBtnClick: handleSaveBtnClick, @@ -282,7 +282,7 @@ const MemoEditor: React.FC = () => { return (
-

正在修改中...

+

Editting...

= () => { return (
- 筛选: + Filter:
{ diff --git a/web/src/components/MemoList.tsx b/web/src/components/MemoList.tsx index 87050e4f..f4169a44 100644 --- a/web/src/components/MemoList.tsx +++ b/web/src/components/MemoList.tsx @@ -83,7 +83,7 @@ const MemoList: React.FC = () => { setFetchStatus(false); }) .catch(() => { - toastHelper.error("😭 请求数据失败了"); + toastHelper.error("😭 Refresh failed, please try again later."); }); }, []); @@ -111,7 +111,13 @@ const MemoList: React.FC = () => { ))}

- {isFetching ? "努力请求数据中..." : shownMemos.length === 0 ? "空空如也" : showMemoFilter ? "" : "所有数据加载完啦 🎉"} + {isFetching + ? "Fetching data..." + : shownMemos.length === 0 + ? "Oops, there is nothing" + : showMemoFilter + ? "" + : "Fetching completed 🎉"}

diff --git a/web/src/components/MenuBtnsPopup.tsx b/web/src/components/MenuBtnsPopup.tsx index 5414ed68..aafd89f7 100644 --- a/web/src/components/MenuBtnsPopup.tsx +++ b/web/src/components/MenuBtnsPopup.tsx @@ -49,16 +49,16 @@ const MenuBtnsPopup: React.FC = (props: Props) => { return (
); diff --git a/web/src/components/MyAccountSection.tsx b/web/src/components/MyAccountSection.tsx index a8ed3469..7dfc74be 100644 --- a/web/src/components/MyAccountSection.tsx +++ b/web/src/components/MyAccountSection.tsx @@ -30,7 +30,7 @@ const MyAccountSection: React.FC = () => { const handleConfirmEditUsernameBtnClick = async () => { if (user.name === "guest") { - toastHelper.info("🈲 不要修改我的用户名"); + toastHelper.info("Do not change my username"); return; } @@ -40,7 +40,7 @@ const MyAccountSection: React.FC = () => { const usernameValidResult = validate(username, validateConfig); if (!usernameValidResult.result) { - toastHelper.error("用户名 " + usernameValidResult.reason); + toastHelper.error("Username " + usernameValidResult.reason); return; } @@ -48,13 +48,13 @@ const MyAccountSection: React.FC = () => { const isUsable = await userService.checkUsernameUsable(username); if (!isUsable) { - toastHelper.error("用户名无法使用"); + toastHelper.error("Username is not available"); return; } await userService.updateUsername(username); await userService.doSignIn(); - toastHelper.info("修改成功~"); + toastHelper.info("Username changed"); } catch (error: any) { toastHelper.error(error.message); } @@ -62,7 +62,7 @@ const MyAccountSection: React.FC = () => { const handleChangePasswordBtnClick = () => { if (user.name === "guest") { - toastHelper.info("🈲 不要修改我的密码"); + toastHelper.info("Do not change my password"); return; } @@ -81,21 +81,21 @@ const MyAccountSection: React.FC = () => { return ( <>
-

基本信息

+

Account Information

-

Open API(实验性功能)

+

Open API (Experimental feature)

{openAPIRoute}

- 重置 API + Reset API
-

使用方法:

+

Usage guide:

{`POST ${openAPIRoute}\nContent-type: application/json\n{\n  "content": "Hello, #memos ${window.location.origin}"\n}`}
diff --git a/web/src/components/PreferencesSection.tsx b/web/src/components/PreferencesSection.tsx index af8e19ec..ff61f901 100644 --- a/web/src/components/PreferencesSection.tsx +++ b/web/src/components/PreferencesSection.tsx @@ -11,7 +11,7 @@ const PreferencesSection: React.FC = () => { const { globalState } = useContext(appContext); const { useTinyUndoHistoryCache, shouldHideImageUrl, shouldSplitMemoWord, shouldUseMarkdownParser } = globalState; - const demoMemoContent = "👋 你好呀~欢迎使用memos!\n* ✨ **开源项目**;\n* 😋 精美且细节的视觉样式;\n* 📑 体验优良的交互逻辑;"; + const demoMemoContent = "👋 Hiya, welcome to memos!\n* ✨ **Open source project**;\n* 😋 What do you think;\n* 📑 Tell me something plz;"; const handleOpenTinyUndoChanged = () => { globalStateService.setAppSetting({ @@ -65,29 +65,29 @@ const PreferencesSection: React.FC = () => { return ( <>
-

Memo 显示相关

+

Memo Display

-
-

编辑器

+

Editor Extensions

-

其他

+

Others

diff --git a/web/src/components/PreviewImageDialog.tsx b/web/src/components/PreviewImageDialog.tsx index 190b7c20..23f02cb7 100644 --- a/web/src/components/PreviewImageDialog.tsx +++ b/web/src/components/PreviewImageDialog.tsx @@ -43,8 +43,8 @@ const PreviewImageDialog: React.FC = ({ destroy, imgUrl }: Props) => {
- 图片加载中... - 😟 图片加载失败,可能是无效的链接 + Loading image... + 😟 Failed to load image
diff --git a/web/src/components/SearchBar.tsx b/web/src/components/SearchBar.tsx index 9b631e69..0aaeb93b 100644 --- a/web/src/components/SearchBar.tsx +++ b/web/src/components/SearchBar.tsx @@ -36,7 +36,7 @@ const SearchBar: React.FC = () => {

QUICKLY FILTER

- 类型: + Type:
{memoSpecialTypes.map((t, idx) => { return ( diff --git a/web/src/components/ShareMemoImageDialog.tsx b/web/src/components/ShareMemoImageDialog.tsx index 76c4bb58..71d54a2d 100644 --- a/web/src/components/ShareMemoImageDialog.tsx +++ b/web/src/components/ShareMemoImageDialog.tsx @@ -65,7 +65,7 @@ const ShareMemoImageDialog: React.FC = (props: Props) => { <>

- 🥰分享 Memo 图片 + 🥰Share Memo

-

{shortcutImgUrl ? "右键或长按即可保存图片 👇" : "图片生成中..."}

+

{shortcutImgUrl ? "Right click or long press to save image 👇" : "Generating the screenshot..."}

diff --git a/web/src/components/ShortcutList.tsx b/web/src/components/ShortcutList.tsx index ffed4eec..d5f08695 100644 --- a/web/src/components/ShortcutList.tsx +++ b/web/src/components/ShortcutList.tsx @@ -37,7 +37,7 @@ const ShortcutList: React.FC = () => { return (

- 快速检索 + Shortcuts showCreateQueryDialog()}> + @@ -45,7 +45,7 @@ const ShortcutList: React.FC = () => {

showCreateQueryDialog()}> - 创建检索 + New shortcut
@@ -147,17 +147,17 @@ const ShortcutContainer: React.FC = (props: ShortcutCont
- {shortcut.rowStatus === "ARCHIVED" ? "取消置顶" : "置顶"} + {shortcut.rowStatus === "ARCHIVED" ? "Unpin" : "Pin"} - 编辑 + Edit - {showConfirmDeleteBtn ? "确定删除!" : "删除"} + {showConfirmDeleteBtn ? "Delete!" : "Delete"}
diff --git a/web/src/components/TagList.tsx b/web/src/components/TagList.tsx index 62081142..6e217f15 100644 --- a/web/src/components/TagList.tsx +++ b/web/src/components/TagList.tsx @@ -70,14 +70,14 @@ const TagList: React.FC = () => { return (
-

常用标签

+

Tags

{tags.map((t, idx) => ( ))}

- 输入# Tag 来创建标签吧~ + Enter # Tag to create a tag

diff --git a/web/src/components/common/DatePicker.tsx b/web/src/components/common/DatePicker.tsx index 3e336f8e..c6eb68df 100644 --- a/web/src/components/common/DatePicker.tsx +++ b/web/src/components/common/DatePicker.tsx @@ -58,7 +58,7 @@ const DatePicker: React.FC = (props: DatePickerProps) => { - {firstDate.getFullYear()} 年 {firstDate.getMonth() + 1} 月 + {firstDate.getFullYear()}/{firstDate.getMonth() + 1} handleChangeMonthBtnClick(1)}> @@ -66,13 +66,13 @@ const DatePicker: React.FC = (props: DatePickerProps) => {
- 周一 - 周二 - 周三 - 周四 - 周五 - 周六 - 周日 + Mon + Tue + Web + Thu + Fri + Sat + Sun
{dayList.map((d) => { diff --git a/web/src/components/common/Selector.tsx b/web/src/components/common/Selector.tsx index 5b224e6a..8135dee7 100644 --- a/web/src/components/common/Selector.tsx +++ b/web/src/components/common/Selector.tsx @@ -15,7 +15,7 @@ interface Props { } const nullItem = { - text: "请选择", + text: "Select", value: "", }; diff --git a/web/src/helpers/consts.ts b/web/src/helpers/consts.ts index 8873428f..f0d935ab 100644 --- a/web/src/helpers/consts.ts +++ b/web/src/helpers/consts.ts @@ -1,23 +1,23 @@ -// 移动端样式适配额外类名 +// mobile style addtion classname export const SHOW_SIDERBAR_MOBILE_CLASSNAME = "mobile-show-sidebar"; -// 默认动画持续时长 +// default animation duration export const ANIMATION_DURATION = 200; -// toast 动画持续时长 +// toast animation duration export const TOAST_ANIMATION_DURATION = 400; -// 一天的毫秒数 +// millisecond in a day export const DAILY_TIMESTAMP = 3600 * 24 * 1000; -// 标签 正则 +// tag regex export const TAG_REG = /#\s?(.+?)\s/g; -// URL 正则 +// URL regex export const LINK_REG = /(https?:\/\/[^\s<\\*>']+)/g; -// 图片 正则 +// image regex export const IMAGE_URL_REG = /([^\s<\\*>']+\.(jpeg|jpg|gif|png|svg))/g; -// memo 关联正则 +// linked memo regex export const MEMO_LINK_REG = /\[@(.+?)\]\((.+?)\)/g; diff --git a/web/src/helpers/filter.ts b/web/src/helpers/filter.ts index 9c6d985c..5fe0b10c 100644 --- a/web/src/helpers/filter.ts +++ b/web/src/helpers/filter.ts @@ -1,68 +1,68 @@ import { IMAGE_URL_REG, LINK_REG, MEMO_LINK_REG, TAG_REG } from "./consts"; export const relationConsts = [ - { text: "且", value: "AND" }, - { text: "或", value: "OR" }, + { text: "And", value: "AND" }, + { text: "Or", value: "OR" }, ]; export const filterConsts = { TAG: { + text: "Tag", value: "TAG", - text: "标签", operators: [ { - text: "包括", + text: "Contains", value: "CONTAIN", }, { - text: "排除", + text: "Does not contain", value: "NOT_CONTAIN", }, ], }, TYPE: { + text: "Type", value: "TYPE", - text: "类型", operators: [ { + text: "Is", value: "IS", - text: "是", }, { + text: "Is not", value: "IS_NOT", - text: "不是", }, ], values: [ { + text: "Connected", value: "CONNECTED", - text: "有关联", }, { + text: "No tags", value: "NOT_TAGGED", - text: "无标签", }, { + text: "Has links", value: "LINKED", - text: "有超链接", }, { + text: "Has images", value: "IMAGED", - text: "有图片", }, ], }, TEXT: { + text: "Text", value: "TEXT", - text: "文本", operators: [ { + text: "Contain", value: "CONTAIN", - text: "包括", }, { + text: "Does not contain", value: "NOT_CONTAIN", - text: "排除", }, ], }, diff --git a/web/src/helpers/storage.ts b/web/src/helpers/storage.ts index 542c13c9..f0f0a305 100644 --- a/web/src/helpers/storage.ts +++ b/web/src/helpers/storage.ts @@ -4,13 +4,10 @@ import { InputAction } from "tiny-undo"; * Define storage data type */ interface StorageData { - // 编辑器输入缓存内容 + // Editor content cache editorContentCache: string; - // 分词开关 shouldSplitMemoWord: boolean; - // 是否隐藏图片链接地址 shouldHideImageUrl: boolean; - // markdown 解析开关 shouldUseMarkdownParser: boolean; // Editor setting diff --git a/web/src/helpers/validator.ts b/web/src/helpers/validator.ts index cedd1dd3..d02ceab6 100644 --- a/web/src/helpers/validator.ts +++ b/web/src/helpers/validator.ts @@ -1,15 +1,15 @@ -// 验证器 -// * 主要用于验证表单 +// Validator +// * use for validating form data const chineseReg = /[\u3000\u3400-\u4DBF\u4E00-\u9FFF]/; export interface ValidatorConfig { - // 最小长度 + // min length minLength: number; - // 最大长度 + // max length maxLength: number; - // 无空格 + // no space noSpace: boolean; - // 无中文 + // no chinese noChinese: boolean; } @@ -18,7 +18,7 @@ export function validate(text: string, config: Partial): { resu if (text.length < config.minLength) { return { result: false, - reason: "长度过短", + reason: "Too short", }; } } @@ -27,7 +27,7 @@ export function validate(text: string, config: Partial): { resu if (text.length > config.maxLength) { return { result: false, - reason: "长度超出", + reason: "Too long", }; } } @@ -35,14 +35,14 @@ export function validate(text: string, config: Partial): { resu if (config.noSpace && text.includes(" ")) { return { result: false, - reason: "不应含有空格", + reason: "Don't allow space", }; } if (config.noChinese && chineseReg.test(text)) { return { result: false, - reason: "不应含有中文字符", + reason: "Don't allow chinese", }; } diff --git a/web/src/labs/createStore.ts b/web/src/labs/createStore.ts index 70ef99e3..a243ee74 100644 --- a/web/src/labs/createStore.ts +++ b/web/src/labs/createStore.ts @@ -15,8 +15,8 @@ export interface Store { } /** - * 简单实现的 Redux - * @param preloadedState 初始 state + * Toy-Redux + * @param preloadedState initial state * @param reducer reducer pure function * @returns store */ diff --git a/web/src/pages/MemoTrash.tsx b/web/src/pages/MemoTrash.tsx index 196b2689..ba6cd075 100644 --- a/web/src/pages/MemoTrash.tsx +++ b/web/src/pages/MemoTrash.tsx @@ -114,13 +114,13 @@ const MemoTrash: React.FC = () => { menu - 回收站 + Recycle Bin
{loadingState.isLoading ? (
-

努力请求数据中...

+

fetching data...

) : deletedMemos.length === 0 ? (
diff --git a/web/src/pages/Setting.tsx b/web/src/pages/Setting.tsx index 99f6039e..98fc5bd0 100644 --- a/web/src/pages/Setting.tsx +++ b/web/src/pages/Setting.tsx @@ -30,7 +30,7 @@ const Setting: React.FC = () => { menu - 账号与设置 + Settings
diff --git a/web/src/pages/Signin.tsx b/web/src/pages/Signin.tsx index d80d94c2..871f21df 100644 --- a/web/src/pages/Signin.tsx +++ b/web/src/pages/Signin.tsx @@ -55,13 +55,13 @@ const Signin: React.FC = () => { const usernameValidResult = validate(username, validateConfig); if (!usernameValidResult.result) { - toastHelper.error("用户名 " + usernameValidResult.reason); + toastHelper.error("Username: " + usernameValidResult.reason); return; } const passwordValidResult = validate(password, validateConfig); if (!passwordValidResult.result) { - toastHelper.error("密码 " + passwordValidResult.reason); + toastHelper.error("Password: " + passwordValidResult.reason); return; } @@ -77,7 +77,7 @@ const Signin: React.FC = () => { if (user) { locationService.replaceHistory("/"); } else { - toastHelper.error("😟 登录失败"); + toastHelper.error("😟 Login failed"); } } catch (error: any) { console.error(error); @@ -107,7 +107,7 @@ const Signin: React.FC = () => { if (user) { locationService.replaceHistory("/"); } else { - toastHelper.error("😟 登录失败"); + toastHelper.error("😟 Login failed"); } } catch (error: any) { console.error(error); @@ -121,7 +121,7 @@ const Signin: React.FC = () => {

- 登录 Memos ✍️ + Login to Memos ✍️

{showAutoSigninAsGuest ? ( @@ -132,13 +132,13 @@ const Signin: React.FC = () => { className={`btn guest-signin ${signinBtnsClickLoadingState.isLoading ? "requesting" : ""}`} onClick={handleAutoSigninAsGuestBtnClick} > - 👉 快速登录进行体验 + 👉 Login as Guest quickly
- 已有账号,我要自己登录 + I have an account
@@ -146,11 +146,11 @@ const Signin: React.FC = () => { <>
- 账号 + Usernmae
- 密码 + Password
@@ -161,14 +161,14 @@ const Signin: React.FC = () => { className={`btn ${signinBtnsClickLoadingState.isLoading ? "requesting" : ""}`} onClick={handleAutoSigninAsGuestBtnClick} > - 体验一下 + Login as Guest / /
diff --git a/web/src/services/resourceService.ts b/web/src/services/resourceService.ts index 8796b166..28244aeb 100644 --- a/web/src/services/resourceService.ts +++ b/web/src/services/resourceService.ts @@ -10,7 +10,7 @@ class ResourceService { const { name: filename, size } = file; if (size > 5 << 20) { - return Promise.reject("超过最大文件大小 5Mb"); + return Promise.reject("overload max size: 5Mb"); } const formData = new FormData(); diff --git a/web/src/types/basic.d.ts b/web/src/types/basic.d.ts index f767bc01..e7804f6b 100644 --- a/web/src/types/basic.d.ts +++ b/web/src/types/basic.d.ts @@ -1,9 +1,7 @@ type BasicType = undefined | null | boolean | number | string | Record | Array; -// 日期戳 type DateStamp = number; -// 时间戳 type TimeStamp = number; type FunctionType = (...args: unknown[]) => unknown;