From f76608bf90a9fa8da62661e68827b8066b709c40 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 6 Oct 2022 16:01:02 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=9B=B4=E6=96=B0=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=A1=AE=E8=AE=A4=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/appearance/langs/en_US.json | 1 + app/appearance/langs/es_ES.json | 1 + app/appearance/langs/fr_FR.json | 1 + app/appearance/langs/zh_CHT.json | 1 + app/appearance/langs/zh_CN.json | 1 + app/src/editor/deleteFile.ts | 2 +- app/src/layout/dock/Bookmark.ts | 2 +- app/src/layout/dock/Files.ts | 2 +- app/src/layout/dock/Inbox.ts | 4 ++-- app/src/layout/dock/Tag.ts | 2 +- app/src/menus/navigation.ts | 2 +- app/src/mobile/util/MobileBookmarks.ts | 2 +- app/src/mobile/util/MobileFiles.ts | 2 +- app/src/mobile/util/MobileTags.ts | 2 +- app/src/util/globalShortcut.ts | 2 +- app/src/util/history.ts | 2 +- 16 files changed, 17 insertions(+), 12 deletions(-) diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index 5c03ad6df..80c1bf68e 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -1,4 +1,5 @@ { + "deleteOpConfirm": "⚠️ Delete operation confirmation", "filterDocNameEnter": "Filter doc name Enter", "defBlock": "Def block", "defBlockChildren": "Define block and its children", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index e6a049e3e..c53f02433 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -1,4 +1,5 @@ { + "deleteOpConfirm": "⚠️ Confirmación de operación de eliminación", "filterDocNameEnter": "Filtrar doc name Enter", "defBlock": "Definir bloque", "defBlockChildren": "Definir bloque y sus hijos", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 089c72c34..840a97f6e 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -1,4 +1,5 @@ { + "deleteOpConfirm": "⚠️ Supprimer la confirmation de l'opération", "filterDocNameEnter": "Filtre doc name Enter", "defBlock": "Définir le bloc", "defBlockChildren": "Définir le bloc et ses enfants", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index 5d3ac85f8..7e3ee7455 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -1,4 +1,5 @@ { + "deleteOpConfirm": "⚠️ Delete operation confirmation", "filterDocNameEnter": "過濾文檔名 Enter", "defBlock": "定義塊", "defBlockChildren": "定義塊及其子塊", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index f92f7bb42..8d6e3254f 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -1,4 +1,5 @@ { + "deleteOpConfirm": "⚠️ 删除操作确认", "filterDocNameEnter": "过滤文档名 Enter", "defBlock": "定义块", "defBlockChildren": "定义块及其子块", diff --git a/app/src/editor/deleteFile.ts b/app/src/editor/deleteFile.ts index de1be7ee4..911659acf 100644 --- a/app/src/editor/deleteFile.ts +++ b/app/src/editor/deleteFile.ts @@ -17,7 +17,7 @@ export const deleteFile = (notebookId: string, pathString: string, name: string) if (response.data.subFileCount > 0) { tip = `${window.siyuan.languages.confirmDelete} ${name} ${window.siyuan.languages.andSubFile.replace("x", response.data.subFileCount)}?`; } - confirmDialog(window.siyuan.languages.delete, tip, () => { + confirmDialog(window.siyuan.languages.deleteOpConfirm, tip, () => { fetchPost("/api/filetree/removeDoc", { notebook: notebookId, path: pathString diff --git a/app/src/layout/dock/Bookmark.ts b/app/src/layout/dock/Bookmark.ts index 1fe45e299..7d2db7840 100644 --- a/app/src/layout/dock/Bookmark.ts +++ b/app/src/layout/dock/Bookmark.ts @@ -128,7 +128,7 @@ export class Bookmark extends Model { label: window.siyuan.languages.remove, click: () => { const bookmark = (id ? element.parentElement.previousElementSibling : element).querySelector(".b3-list-item__text").textContent; - confirmDialog(window.siyuan.languages.delete, `${window.siyuan.languages.confirmDelete} ${escapeHtml(bookmark)}?`, () => { + confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} ${escapeHtml(bookmark)}?`, () => { if (id) { fetchPost("/api/attr/setBlockAttrs", {id, attrs: {bookmark: ""}}, () => { this.update(); diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts index b8dd7fad4..0ee38a6e3 100644 --- a/app/src/layout/dock/Files.ts +++ b/app/src/layout/dock/Files.ts @@ -117,7 +117,7 @@ export class Files extends Model { event.preventDefault(); break; } else if (type === "remove") { - confirmDialog(window.siyuan.languages.delete, + confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} ${escapeHtml(target.parentElement.querySelector(".b3-list-item__text").textContent)}?`, () => { fetchPost("/api/notebook/removeNotebook", { notebook: target.getAttribute("data-url"), diff --git a/app/src/layout/dock/Inbox.ts b/app/src/layout/dock/Inbox.ts index 914cfb2b7..2fd143314 100644 --- a/app/src/layout/dock/Inbox.ts +++ b/app/src/layout/dock/Inbox.ts @@ -108,7 +108,7 @@ export class Inbox extends Model { this.update(); break; case "delete": - confirmDialog(window.siyuan.languages.delete, window.siyuan.languages.confirmDelete + "?", () => { + confirmDialog(window.siyuan.languages.deleteOpConfirm, window.siyuan.languages.confirmDelete + "?", () => { this.remove(detailsElement.getAttribute("data-id")); }); break; @@ -209,7 +209,7 @@ ${(Lute.New()).MarkdownStr("", data.shorthandContent)} label: window.siyuan.languages.remove, icon: "iconTrashcan", click: () => { - confirmDialog(window.siyuan.languages.delete, window.siyuan.languages.confirmDelete + "?", () => { + confirmDialog(window.siyuan.languages.deleteOpConfirm, window.siyuan.languages.confirmDelete + "?", () => { this.remove(); }); } diff --git a/app/src/layout/dock/Tag.ts b/app/src/layout/dock/Tag.ts index b03bfd074..548bee822 100644 --- a/app/src/layout/dock/Tag.ts +++ b/app/src/layout/dock/Tag.ts @@ -114,7 +114,7 @@ export class Tag extends Model { icon: "iconTrashcan", label: window.siyuan.languages.remove, click: () => { - confirmDialog(window.siyuan.languages.delete, `${window.siyuan.languages.confirmDelete} ${escapeHtml(labelName)}?`, () => { + confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} ${escapeHtml(labelName)}?`, () => { fetchPost("/api/tag/removeTag", {label: labelName}); }); }, diff --git a/app/src/menus/navigation.ts b/app/src/menus/navigation.ts index 6f2a55c5e..ab020ca41 100644 --- a/app/src/menus/navigation.ts +++ b/app/src/menus/navigation.ts @@ -88,7 +88,7 @@ export const initNavigationMenu = (liElement: HTMLElement) => { label: window.siyuan.languages.delete, accelerator: "⌦", click: () => { - confirmDialog(window.siyuan.languages.delete, + confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} ${Lute.EscapeHTMLStr(name)}?`, () => { fetchPost("/api/notebook/removeNotebook", { notebook: notebookId, diff --git a/app/src/mobile/util/MobileBookmarks.ts b/app/src/mobile/util/MobileBookmarks.ts index c4ff716be..87c2cc86a 100644 --- a/app/src/mobile/util/MobileBookmarks.ts +++ b/app/src/mobile/util/MobileBookmarks.ts @@ -36,7 +36,7 @@ export class MobileBookmarks { if (actionElement) { const bookmark = (id ? element.parentElement.previousElementSibling : element).querySelector(".b3-list-item__text").textContent; if (actionElement.getAttribute("data-type") === "remove") { - confirmDialog(window.siyuan.languages.delete, `${window.siyuan.languages.confirmDelete} ${escapeHtml(bookmark)}?`, () => { + confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} ${escapeHtml(bookmark)}?`, () => { if (id) { fetchPost("/api/attr/setBlockAttrs", {id, attrs: {bookmark: ""}}, () => { this.update(); diff --git a/app/src/mobile/util/MobileFiles.ts b/app/src/mobile/util/MobileFiles.ts index 5b3fe9d27..d9a38005b 100644 --- a/app/src/mobile/util/MobileFiles.ts +++ b/app/src/mobile/util/MobileFiles.ts @@ -148,7 +148,7 @@ export class MobileFiles extends Model { event.preventDefault(); break; } else if (type === "remove") { - confirmDialog(window.siyuan.languages.delete, + confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} ${escapeHtml(target.parentElement.querySelector(".b3-list-item__text").textContent)}?`, () => { fetchPost("/api/notebook/removeNotebook", { notebook: target.getAttribute("data-url"), diff --git a/app/src/mobile/util/MobileTags.ts b/app/src/mobile/util/MobileTags.ts index 1af7832b9..9370f8ea5 100644 --- a/app/src/mobile/util/MobileTags.ts +++ b/app/src/mobile/util/MobileTags.ts @@ -60,7 +60,7 @@ export class MobileTags { fetchPost("/api/tag/renameTag", {oldLabel: labelName, newLabel: inputElement.value}); }); } else { - confirmDialog(window.siyuan.languages.delete, `${window.siyuan.languages.confirmDelete} ${escapeHtml(labelName)}?`, () => { + confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} ${escapeHtml(labelName)}?`, () => { fetchPost("/api/tag/removeTag", {label: labelName}); }); } diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts index 6fcb14c03..f6a291e79 100644 --- a/app/src/util/globalShortcut.ts +++ b/app/src/util/globalShortcut.ts @@ -984,7 +984,7 @@ const fileTreeKeydown = (event: KeyboardEvent) => { if (isFile) { deleteFile(notebookId, pathString, getDisplayName(liElement.getAttribute("data-name"), false, true)); } else { - confirmDialog(window.siyuan.languages.delete, + confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} ${Lute.EscapeHTMLStr(getNotebookName(notebookId))}?`, () => { fetchPost("/api/notebook/removeNotebook", { notebook: notebookId, diff --git a/app/src/util/history.ts b/app/src/util/history.ts index 00bf39cf6..f6cc9f761 100644 --- a/app/src/util/history.ts +++ b/app/src/util/history.ts @@ -451,7 +451,7 @@ export const openHistory = () => { break; } else if (type === "removeRepoTagSnapshot" || type === "removeCloudRepoTagSnapshot") { const tag = target.parentElement.getAttribute("data-tag"); - confirmDialog(window.siyuan.languages.delete, `${window.siyuan.languages.confirmDelete} ${tag}?`, () => { + confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} ${tag}?`, () => { fetchPost("/api/repo/" + type, {tag}, () => { renderRepo(repoElement, type === "removeRepoTagSnapshot" ? -1 : -2); });