diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index 7259b7d3a..bb7078812 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -1,5 +1,5 @@ { - "addBelowAbove": "Click to add below
Alt+Click to add above", + "addBelowAbove": "Click to add below
⌥Click to add above", "imported": "Import completed", "mirrorTip": "Mirror database, all data updates will be synchronized to all other mirrors", "includeTime": "Include time", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index f72ee493b..3b3f26966 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -1,5 +1,5 @@ { - "addBelowAbove": "Haga clic para agregar abajo
Alt+Clic para agregar arriba", + "addBelowAbove": "Haga clic para agregar abajo
⌥Clic para agregar arriba", "imported": "Importación completada", "mirrorTip": "Base de datos espejo, todas las actualizaciones de datos se sincronizarán con todos los demás espejos", "includeTime": "Incluir tiempo", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 99b279708..dc3493935 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -1,5 +1,5 @@ { - "addBelowAbove": "Cliquez pour ajouter ci-dessous
Alt+Cliquez pour ajouter ci-dessus", + "addBelowAbove": "Cliquez pour ajouter ci-dessous
⌥Cliquez pour ajouter ci-dessus", "imported": "Importation terminée", "mirrorTip": "Base de données miroir, toutes les mises à jour des données seront synchronisées avec tous les autres miroirs", "includeTime": "Inclure l'heure", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index eae7f165b..0a5d2a907 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -1,5 +1,5 @@ { - "addBelowAbove": "Click 在下方新增
Alt+Click 在上方新增", + "addBelowAbove": "Click 在下方新增
⌥Click 在上方新增", "imported": "導入完成", "mirrorTip": "鏡像資料庫,所有資料更新會同步到其他所有鏡像中", "includeTime": "具體時間", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index ea5140831..18b0d1d02 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -1,5 +1,5 @@ { - "addBelowAbove": "Click 在下方添加
Alt+Click 在上方添加", + "addBelowAbove": "Click 在下方添加
⌥Click 在上方添加", "imported": "导入完成", "mirrorTip": "镜像数据库,所有数据更新会同步到其他所有镜像中", "includeTime": "具体时间", diff --git a/app/src/protyle/breadcrumb/index.ts b/app/src/protyle/breadcrumb/index.ts index f69deaa45..bf5ee7bd6 100644 --- a/app/src/protyle/breadcrumb/index.ts +++ b/app/src/protyle/breadcrumb/index.ts @@ -28,7 +28,7 @@ import {Menu} from "../../plugin/Menu"; import {getNoContainerElement} from "../wysiwyg/getBlock"; import {openTitleMenu} from "../header/openTitleMenu"; import {emitOpenMenu} from "../../plugin/EventBus"; -import {isInAndroid} from "../util/compatibility"; +import {isInAndroid, isMac, updateHotkeyTip} from "../util/compatibility"; import {resize} from "../util/resize"; export class Breadcrumb { @@ -47,7 +47,7 @@ export class Breadcrumb { - + `; diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts index 9224900a9..0fdb0765f 100644 --- a/app/src/protyle/gutter/index.ts +++ b/app/src/protyle/gutter/index.ts @@ -3,7 +3,7 @@ import {getIconByType} from "../../editor/getIcon"; import {enterBack, iframeMenu, setFold, tableMenu, videoMenu, zoomOut} from "../../menus/protyle"; import {MenuItem} from "../../menus/Menu"; import {copySubMenu, openAttr, openWechatNotify} from "../../menus/commonMenuItem"; -import {copyPlainText, updateHotkeyTip, writeText} from "../util/compatibility"; +import {copyPlainText, isMac, updateHotkeyTip, writeText} from "../util/compatibility"; import { transaction, turnsIntoOneTransaction, @@ -42,8 +42,14 @@ import {resizeAV} from "../util/resize"; export class Gutter { public element: HTMLElement; + private gutterTip: string constructor(protyle: IProtyle) { + if (isMac()) { + this.gutterTip = window.siyuan.languages.gutterTip + } else { + this.gutterTip = window.siyuan.languages.gutterTip.replace(/⌘/g, "Ctrl+").replace(/⌥/g, "Alt+").replace(/⇧/g, "Shift+").replace(/⌃/g, "Ctrl+") + } this.element = document.createElement("div"); this.element.className = "protyle-gutters"; this.element.addEventListener("dragstart", (event: DragEvent & { target: HTMLElement }) => { @@ -1836,7 +1842,7 @@ export class Gutter { html = ""; } index += 1; - const buttonHTML = ` +
`; diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.ts index 2c6926a0f..4b9e33cbd 100644 --- a/app/src/protyle/util/compatibility.ts +++ b/app/src/protyle/util/compatibility.ts @@ -115,7 +115,7 @@ export const isInIOS = () => { // Mac,Windows 快捷键展示 export const updateHotkeyTip = (hotkey: string) => { - if (/Mac/.test(navigator.platform) || navigator.platform === "iPhone") { + if (isMac()) { return hotkey; }