add translation for image_context_menu.js and link_context_menu.js

This commit is contained in:
Nriver 2024-11-25 17:41:00 +08:00
parent d9ceca8cc5
commit dedef69aec
4 changed files with 28 additions and 8 deletions

View File

@ -1,3 +1,4 @@
import { t } from '../services/i18n.js';
import utils from "../services/utils.js";
import contextMenu from "./context_menu.js";
import imageService from "../services/image.js";
@ -18,14 +19,14 @@ function setupContextMenu($image) {
y: e.pageY,
items: [
{
title: "Copy reference to clipboard",
title: t("image_context_menu.copy_reference_to_clipboard"),
command: "copyImageReferenceToClipboard",
uiIcon: "bx bx-directions"
},
{
title: "Copy image to clipboard",
{
title: t("image_context_menu.copy_image_to_clipboard"),
command: "copyImageToClipboard",
uiIcon: "bx bx-copy"
uiIcon: "bx bx-copy"
},
],
selectMenuItemHandler: async ({ command }) => {
@ -61,4 +62,4 @@ function setupContextMenu($image) {
export default {
setupContextMenu
};
};

View File

@ -1,3 +1,4 @@
import { t } from "../services/i18n.js";
import contextMenu from "./context_menu.js";
import appContext from "../components/app_context.js";
@ -6,9 +7,9 @@ function openContextMenu(notePath, e, viewScope = {}, hoistedNoteId = null) {
x: e.pageX,
y: e.pageY,
items: [
{title: "Open note in a new tab", command: "openNoteInNewTab", uiIcon: "bx bx-link-external"},
{title: "Open note in a new split", command: "openNoteInNewSplit", uiIcon: "bx bx-dock-right"},
{title: "Open note in a new window", command: "openNoteInNewWindow", uiIcon: "bx bx-window-open"}
{title: t("link_context_menu.open_note_in_new_tab"), command: "openNoteInNewTab", uiIcon: "bx bx-link-external"},
{title: t("link_context_menu.open_note_in_new_split"), command: "openNoteInNewSplit", uiIcon: "bx bx-dock-right"},
{title: t("link_context_menu.open_note_in_new_window"), command: "openNoteInNewWindow", uiIcon: "bx bx-window-open"}
],
selectMenuItemHandler: ({command}) => {
if (!hoistedNoteId) {

View File

@ -1554,5 +1554,14 @@
"paste": "粘贴",
"paste-as-plain-text": "以纯文本粘贴",
"search_online": "用 {{searchEngine}} 搜索 \"{{term}}\""
},
"image_context_menu": {
"copy_reference_to_clipboard": "复制引用到剪贴板",
"copy_image_to_clipboard": "复制图片到剪贴板"
},
"link_context_menu": {
"open_note_in_new_tab": "在新标签页中打开笔记",
"open_note_in_new_split": "在新分屏中打开笔记",
"open_note_in_new_window": "在新窗口中打开笔记"
}
}

View File

@ -1554,5 +1554,14 @@
"paste": "Paste",
"paste-as-plain-text": "Paste as plain text",
"search_online": "Search for \"{{term}}\" with {{searchEngine}}"
},
"image_context_menu": {
"copy_reference_to_clipboard": "Copy reference to clipboard",
"copy_image_to_clipboard": "Copy image to clipboard"
},
"link_context_menu": {
"open_note_in_new_tab": "Open note in a new tab",
"open_note_in_new_split": "Open note in a new split",
"open_note_in_new_window": "Open note in a new window"
}
}