From 3a20ed1559fc7016cc3f643b40378de49e771124 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 10 Sep 2023 15:31:09 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/9148 --- app/appearance/langs/en_US.json | 2 ++ app/appearance/langs/es_ES.json | 2 ++ app/appearance/langs/fr_FR.json | 2 ++ app/appearance/langs/zh_CHT.json | 2 ++ app/appearance/langs/zh_CN.json | 2 ++ app/src/protyle/breadcrumb/index.ts | 2 +- app/src/protyle/util/onGet.ts | 5 +++++ 7 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index 4c927c3e5..22511dd53 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -1,4 +1,6 @@ { + "lockEdit": "Make doc read-only", + "unlockEdit": "Make doc writable", "enable": "Enable", "disable": "Disable", "removeWorkspacePhysically": "Do you want to physically delete the data in workspace ${x}? (Physical deletion cannot be recovered)", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index df8ff22d8..83f293c78 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -1,4 +1,6 @@ { + "lockEdit": "Hacer que el documento sea de sólo lectura", + "unlockEdit": "Hacer que el documento sea escribible", "enable": "Habilitar", "disable": "Desactivar", "removeWorkspacePhysically": "¿Quieres eliminar físicamente los datos en el espacio de trabajo ${x}? (La eliminación física no se puede recuperar)", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 156f4ddc7..686046624 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -1,4 +1,6 @@ { + "lockEdit": "Rendre le document en lecture seule", + "unlockEdit": "Rendre le document accessible en écriture", "enable": "Activer", "disable": "Désactiver", "removeWorkspacePhysically": "Voulez-vous supprimer physiquement les données de l'espace de travail ${x} ? (La suppression physique ne peut pas être récupérée)", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index f2379d442..b84abd192 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -1,4 +1,6 @@ { + "lockEdit": "鎖定編輯", + "unlockEdit": "解除鎖定", "enable": "啟用", "disable": "禁用", "removeWorkspacePhysically": "是否物理刪除工作空間 ${x} 的數據?(物理刪除無法恢復)", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index 23f7cea8e..35fc19072 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -1,4 +1,6 @@ { + "lockEdit": "锁定编辑", + "unlockEdit": "解除锁定", "enable": "启用", "disable": "禁用", "removeWorkspacePhysically": "是否物理删除工作空间 ${x} 的数据?(物理删除无法恢复)", diff --git a/app/src/protyle/breadcrumb/index.ts b/app/src/protyle/breadcrumb/index.ts index b00e7ecb7..c42304f67 100644 --- a/app/src/protyle/breadcrumb/index.ts +++ b/app/src/protyle/breadcrumb/index.ts @@ -46,7 +46,7 @@ export class Breadcrumb { '
'} - + diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts index a6f53450a..b4971587f 100644 --- a/app/src/protyle/util/onGet.ts +++ b/app/src/protyle/util/onGet.ts @@ -17,6 +17,7 @@ import {isMobile} from "../../util/functions"; import {foldPassiveType} from "../wysiwyg/renderBacklink"; import {showMessage} from "../../dialog/message"; import {avRender} from "../render/av/render"; +import {hideTooltip} from "../../dialog/tooltip"; export const onGet = (options: { data: IWebSocketData, @@ -328,6 +329,8 @@ export const disabledProtyle = (protyle: IProtyle) => { item.setAttribute("contenteditable", "false"); }); protyle.breadcrumb.element.parentElement.querySelector('[data-type="readonly"] use').setAttribute("xlink:href", "#iconLock"); + protyle.breadcrumb.element.parentElement.querySelector('[data-type="readonly"]').setAttribute("aria-label", window.siyuan.languages.unlockEdit); + hideTooltip(); }; /** 解除编辑器禁用 */ @@ -358,6 +361,8 @@ export const enableProtyle = (protyle: IProtyle) => { } }); protyle.breadcrumb.element.parentElement.querySelector('[data-type="readonly"] use').setAttribute("xlink:href", "#iconUnlock"); + protyle.breadcrumb.element.parentElement.querySelector('[data-type="readonly"]').setAttribute("aria-label", window.siyuan.languages.lockEdit); + hideTooltip(); };