mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
add translation for mobile_detail_menu.js
This commit is contained in:
parent
71c09b1d67
commit
971f52f92a
@ -4,6 +4,7 @@ import contextMenu from "../../menus/context_menu.js";
|
|||||||
import noteCreateService from "../../services/note_create.js";
|
import noteCreateService from "../../services/note_create.js";
|
||||||
import branchService from "../../services/branches.js";
|
import branchService from "../../services/branches.js";
|
||||||
import treeService from "../../services/tree.js";
|
import treeService from "../../services/tree.js";
|
||||||
|
import { t } from "../../services/i18n.js";
|
||||||
|
|
||||||
const TPL = `<button type="button" class="action-button bx bx-menu" style="padding-top: 10px;"></button>`;
|
const TPL = `<button type="button" class="action-button bx bx-menu" style="padding-top: 10px;"></button>`;
|
||||||
|
|
||||||
@ -18,9 +19,9 @@ class MobileDetailMenuWidget extends BasicWidget {
|
|||||||
x: e.pageX,
|
x: e.pageX,
|
||||||
y: e.pageY,
|
y: e.pageY,
|
||||||
items: [
|
items: [
|
||||||
{ title: "Insert child note", command: "insertChildNote", uiIcon: "bx bx-plus",
|
{ title: t("mobile_detail_menu.insert_child_note"), command: "insertChildNote", uiIcon: "bx bx-plus",
|
||||||
enabled: note.type !== 'search' },
|
enabled: note.type !== 'search' },
|
||||||
{ title: "Delete this note", command: "delete", uiIcon: "bx bx-trash",
|
{ title: t("mobile_detail_menu.delete_this_note"), command: "delete", uiIcon: "bx bx-trash",
|
||||||
enabled: note.noteId !== 'root' }
|
enabled: note.noteId !== 'root' }
|
||||||
],
|
],
|
||||||
selectMenuItemHandler: async ({command}) => {
|
selectMenuItemHandler: async ({command}) => {
|
||||||
@ -32,7 +33,7 @@ class MobileDetailMenuWidget extends BasicWidget {
|
|||||||
const branchId = await treeService.getBranchIdFromUrl(notePath);
|
const branchId = await treeService.getBranchIdFromUrl(notePath);
|
||||||
|
|
||||||
if (!branchId) {
|
if (!branchId) {
|
||||||
throw new Error(`Cannot get branchId for notePath '${notePath}'`);
|
throw new Error(t("mobile_detail_menu.error_cannot_get_branch_id", { notePath }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await branchService.deleteNotes([branchId])) {
|
if (await branchService.deleteNotes([branchId])) {
|
||||||
@ -40,7 +41,7 @@ class MobileDetailMenuWidget extends BasicWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new Error(`Unrecognized command ${command}`);
|
throw new Error(t("mobile_detail_menu.error_unrecognized_command", { command }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -650,5 +650,11 @@
|
|||||||
"backlink": "{{count}} 个反链",
|
"backlink": "{{count}} 个反链",
|
||||||
"backlinks": "{{count}} 个反链",
|
"backlinks": "{{count}} 个反链",
|
||||||
"relation": "关系"
|
"relation": "关系"
|
||||||
|
},
|
||||||
|
"mobile_detail_menu": {
|
||||||
|
"insert_child_note": "插入子笔记",
|
||||||
|
"delete_this_note": "删除此笔记",
|
||||||
|
"error_cannot_get_branch_id": "无法获取 notePath '{notePath}' 的 branchId",
|
||||||
|
"error_unrecognized_command": "无法识别的命令 {command}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -651,5 +651,11 @@
|
|||||||
"backlink": "{{count}} Backlink",
|
"backlink": "{{count}} Backlink",
|
||||||
"backlinks": "{{count}} Backlinks",
|
"backlinks": "{{count}} Backlinks",
|
||||||
"relation": "relation"
|
"relation": "relation"
|
||||||
|
},
|
||||||
|
"mobile_detail_menu": {
|
||||||
|
"insert_child_note": "Insert child note",
|
||||||
|
"delete_this_note": "Delete this note",
|
||||||
|
"error_cannot_get_branch_id": "Cannot get branchId for notePath '{notePath}'",
|
||||||
|
"error_unrecognized_command": "Unrecognized command {command}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user