From 3aab1233bbcbaadb248390e5205d7573e2770922 Mon Sep 17 00:00:00 2001 From: jmclulu <2817852344@QQ.com> Date: Sun, 31 May 2026 00:32:04 +0800 Subject: [PATCH] fix: correct typos in source code and locales (#3003) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix Countrys -> Countries in comment - Fix Scrolldown -> ScrollDown in variable name - Fix completeTowFactor -> completeTwoFactor (3x) - Fix deactiveTowFactor -> deactivateTwoFactor (3x) - Fix activeOrDeactiveTwoFactor -> activeOrDeactivateTwoFactor - Fix API route /two-factor/deactive -> /two-factor/deactivate - Fix elment -> element in function param - Fix synolog -> synology in comment - Fix Chinese comment 制定 -> 指定 - Fix swapped BARK English translations on lines 360-361 --- back/api/user.ts | 4 ++-- back/services/user.ts | 2 +- sample/notify.js | 2 +- src/components/terminal.tsx | 8 ++++---- src/locales/en-US.json | 4 ++-- src/pages/login/index.tsx | 6 +++--- src/pages/setting/security.tsx | 12 ++++++------ src/utils/config.ts | 2 +- src/utils/index.ts | 6 +++--- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/back/api/user.ts b/back/api/user.ts index bed0fd78..6155f0a4 100644 --- a/back/api/user.ts +++ b/back/api/user.ts @@ -140,12 +140,12 @@ export default (app: Router) => { ); route.put( - '/two-factor/deactive', + '/two-factor/deactivate', async (req: Request, res: Response, next: NextFunction) => { const logger: Logger = Container.get('logger'); try { const userService = Container.get(UserService); - const data = await userService.deactiveTwoFactor(); + const data = await userService.deactivateTwoFactor(); res.send({ code: 200, data }); } catch (e) { return next(e); diff --git a/back/services/user.ts b/back/services/user.ts index 068b850c..362cb693 100644 --- a/back/services/user.ts +++ b/back/services/user.ts @@ -330,7 +330,7 @@ export default class UserService { } } - public async deactiveTwoFactor() { + public async deactivateTwoFactor() { const authInfo = await this.getAuthInfo(); await this.updateAuthInfo(authInfo, { twoFactorActivated: false, diff --git a/sample/notify.js b/sample/notify.js index 49d5fdc8..2b4d91d3 100644 --- a/sample/notify.js +++ b/sample/notify.js @@ -1598,7 +1598,7 @@ async function sendNotify(text, desp, params = {}) { iGotNotify(text, desp, params), // iGot gobotNotify(text, desp), // go-cqhttp gotifyNotify(text, desp), // gotify - chatNotify(text, desp), // synolog chat + chatNotify(text, desp), // synology chat pushDeerNotify(text, desp), // PushDeer aibotkNotify(text, desp), // 智能微秘书 fsBotNotify(text, desp), // 飞书机器人 diff --git a/src/components/terminal.tsx b/src/components/terminal.tsx index 0492595b..8b4d1804 100644 --- a/src/components/terminal.tsx +++ b/src/components/terminal.tsx @@ -29,10 +29,10 @@ const Terminal = ({ const lastLineRef = useRef(null); // An effect that handles scrolling into view the last line of terminal input or output - const performScrolldown = useRef(false); + const performScrollDown = useRef(false); useEffect(() => { - if (performScrolldown.current) { - // skip scrolldown when the component first loads + if (performScrollDown.current) { + // skip scrollDown when the component first loads setTimeout( () => lastLineRef?.current?.scrollIntoView({ @@ -42,7 +42,7 @@ const Terminal = ({ 500, ); } - performScrolldown.current = true; + performScrollDown.current = true; }, [lineData.length]); const renderedLineData = lineData.map((ld, i) => { diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 29e4bdbf..4662e9b7 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -357,8 +357,8 @@ "BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)": "BARK push icon, custom push icon (requires iOS 15 or above to display)", "BARK推送铃声,铃声列表去APP查看复制填写": "BARK push ringtone, check and copy from the APP's ringtone list", "BARK推送消息的分组,默认为qinglong": "BARK push message grouping, default is qinglong", - "BARK推送消息的时效性,默认为active": "BARK push message redirecting URL", - "BARK推送消息的跳转URL": "BARK push message grouping, default is qinglong", + "BARK推送消息的时效性,默认为active": "BARK push message timeliness, default is active", + "BARK推送消息的跳转URL": "BARK push message redirecting URL", "BARK是否保存推送消息": "Does BARK save push messages", "telegram机器人的token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw": "Telegram Bot token, e.g., 1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw", "telegram用户的id,例如:129xxx206": "Telegram user ID, e.g., 129xxx206", diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index be88e737..60755c0d 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -50,7 +50,7 @@ const Login = () => { }); }; - const completeTowFactor = (values: any) => { + const completeTwoFactor = (values: any) => { setVerifying(true); request .put(`${config.apiPrefix}user/two-factor/login`, { @@ -129,7 +129,7 @@ const Login = () => { const { value } = e.target as any; const regx = /^[0-9]{6}$/; if (regx.test(value)) { - completeTowFactor({ code: value }); + completeTwoFactor({ code: value }); } }; @@ -156,7 +156,7 @@ const Login = () => {
{twoFactor ? ( -
+ { }); }; - const activeOrDeactiveTwoFactor = () => { + const activeOrDeactivateTwoFactor = () => { if (twoFactorActivated) { - deactiveTowFactor(); + deactivateTwoFactor(); } else { getTwoFactorInfo(); setTwoFactoring(true); } }; - const deactiveTowFactor = () => { + const deactivateTwoFactor = () => { request - .put(`${config.apiPrefix}user/two-factor/deactive`) + .put(`${config.apiPrefix}user/two-factor/deactivate`) .then(({ code, data }) => { if (code === 200 && data) { setTwoFactorActivated(false); @@ -60,7 +60,7 @@ const SecuritySettings = ({ user, userChange }: any) => { }); }; - const completeTowFactor = () => { + const completeTwoFactor = () => { setLoading(true); request .put(`${config.apiPrefix}user/two-factor/active`, { code }) @@ -162,7 +162,7 @@ const SecuritySettings = ({ user, userChange }: any) => { onChange={(e) => setCode(e.target.value)} placeholder="123456" /> -
diff --git a/src/utils/config.ts b/src/utils/config.ts index f15a48b5..310fa1cd 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -18,7 +18,7 @@ export default { /* I18n configuration, `languages` and `defaultLanguage` are required currently. */ i18n: { - /* Countrys flags: https://www.flaticon.com/packs/countrys-flags */ + /* Countries flags: https://www.flaticon.com/packs/countries-flags */ languages: [ { key: 'pt-br', diff --git a/src/utils/index.ts b/src/utils/index.ts index 9260a100..d393df5c 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -179,7 +179,7 @@ export default function browserType() { /** * 获取第一个表格的可视化高度 * @param {*} extraHeight 额外的高度(表格底部的内容高度 Number类型,默认为74) - * @param {*} id 当前页面中有多个table时需要制定table的id + * @param {*} id 当前页面中有多个table时需要指定table的id */ export function getTableScroll({ extraHeight, @@ -208,7 +208,7 @@ export function getTableScroll({ } // 自动触发点击事件 -function automaticClick(elment: HTMLElement) { +function automaticClick(element: HTMLElement) { const ev = document.createEvent('MouseEvents'); ev.initMouseEvent( 'click', @@ -227,7 +227,7 @@ function automaticClick(elment: HTMLElement) { 0, null, ); - elment.dispatchEvent(ev); + element.dispatchEvent(ev); } // 导出文件