From 12d018fdfc21b429d74d3073976c4c2c31633ec2 Mon Sep 17 00:00:00 2001 From: FliegendeWurst Date: Tue, 3 Jun 2025 17:30:36 +0200 Subject: [PATCH] feat(i18n): description for all keyboard shortcuts --- .../src/assets/translations/en/server.json | 69 +++++++++++-------- apps/server/src/services/keyboard_actions.ts | 9 +++ 2 files changed, 48 insertions(+), 30 deletions(-) diff --git a/apps/server/src/assets/translations/en/server.json b/apps/server/src/assets/translations/en/server.json index 2985cc010..33147a8d2 100644 --- a/apps/server/src/assets/translations/en/server.json +++ b/apps/server/src/assets/translations/en/server.json @@ -1,12 +1,18 @@ { "keyboard_actions": { + "back-in-note-history": "Navigate to previous note in history", + "forward-in-note-history": "Navigate to next note in history", "open-jump-to-note-dialog": "Open \"Jump to note\" dialog", + "scroll-to-active-note": "Scroll note tree to active note", + "quick-search": "Activate quick search bar", "search-in-subtree": "Search for notes in the active note's subtree", "expand-subtree": "Expand subtree of current note", "collapse-tree": "Collapses the complete note tree", "collapse-subtree": "Collapses subtree of current note", "sort-child-notes": "Sort child notes", "creating-and-moving-notes": "Creating and moving notes", + "create-note-after": "Create note after active note", + "create-note-into": "Create note as child of active note", "create-note-into-inbox": "Create a note in the inbox (if defined) or day note", "delete-note": "Delete note", "move-note-up": "Move note up", @@ -14,40 +20,44 @@ "move-note-up-in-hierarchy": "Move note up in hierarchy", "move-note-down-in-hierarchy": "Move note down in hierarchy", "edit-note-title": "Jump from tree to the note detail and edit title", - "edit-branch-prefix": "Show Edit branch prefix dialog", + "edit-branch-prefix": "Show \"Edit branch prefix\" dialog", + "cloneNotesTo": "Clone selected notes", + "moveNotesTo": "Move selected notes", "note-clipboard": "Note clipboard", "copy-notes-to-clipboard": "Copy selected notes to the clipboard", "paste-notes-from-clipboard": "Paste notes from the clipboard into active note", "cut-notes-to-clipboard": "Cut selected notes to the clipboard", "select-all-notes-in-parent": "Select all notes from the current note level", "add-note-above-to-the-selection": "Add note above to the selection", - "add-note-below-to-selection": "Add note above to the selection", + "add-note-below-to-selection": "Add note below to the selection", "duplicate-subtree": "Duplicate subtree", "tabs-and-windows": "Tabs & Windows", - "open-new-tab": "Opens new tab", - "close-active-tab": "Closes active tab", - "reopen-last-tab": "Reopens the last closed tab", - "activate-next-tab": "Activates tab on the right", - "activate-previous-tab": "Activates tab on the left", + "open-new-tab": "Open new tab", + "close-active-tab": "Close active tab", + "reopen-last-tab": "Reopen the last closed tab", + "activate-next-tab": "Activate tab on the right", + "activate-previous-tab": "Activate tab on the left", "open-new-window": "Open new empty window", - "toggle-tray": "Shows/hides the application from the system tray", - "first-tab": "Activates the first tab in the list", - "second-tab": "Activates the second tab in the list", - "third-tab": "Activates the third tab in the list", - "fourth-tab": "Activates the fourth tab in the list", - "fifth-tab": "Activates the fifth tab in the list", - "sixth-tab": "Activates the sixth tab in the list", - "seventh-tab": "Activates the seventh tab in the list", - "eight-tab": "Activates the eighth tab in the list", - "ninth-tab": "Activates the ninth tab in the list", - "last-tab": "Activates the last tab in the list", + "toggle-tray": "Show/hide the application from the system tray", + "first-tab": "Activate the first tab in the list", + "second-tab": "Activate the second tab in the list", + "third-tab": "Activate the third tab in the list", + "fourth-tab": "Activate the fourth tab in the list", + "fifth-tab": "Activate the fifth tab in the list", + "sixth-tab": "Activate the sixth tab in the list", + "seventh-tab": "Activate the seventh tab in the list", + "eight-tab": "Activate the eighth tab in the list", + "ninth-tab": "Activate the ninth tab in the list", + "last-tab": "Activate the last tab in the list", "dialogs": "Dialogs", - "show-note-source": "Shows Note Source dialog", - "show-options": "Shows Options dialog", - "show-revisions": "Shows Note Revisions dialog", - "show-recent-changes": "Shows Recent Changes dialog", - "show-sql-console": "Shows SQL Console dialog", - "show-backend-log": "Shows Backend Log dialog", + "show-note-source": "Show \"Note Source\" dialog", + "show-options": "Open \"Options\" page", + "show-revisions": "Show \"Note Revisions\" dialog", + "show-recent-changes": "Show \"Recent Changes\" dialog", + "show-sql-console": "Open \"SQL Console\" page", + "show-backend-log": "Open \"Backend Log\" page", + "show-help": "Open the built-in User Guide", + "show-cheatsheet": "Show a modal with common keyboard operations", "text-note-operations": "Text note operations", "add-link-to-text": "Open dialog to add link to the text", "follow-link-under-cursor": "Follow link within which the caret is placed", @@ -76,10 +86,11 @@ "open-note-externally": "Open note as a file with default application", "render-active-note": "Render (re-render) active note", "run-active-note": "Run active JavaScript (frontend/backend) code note", - "toggle-note-hoisting": "Toggles note hoisting of active note", + "toggle-note-hoisting": "Toggle note hoisting of active note", "unhoist": "Unhoist from anywhere", - "reload-frontend-app": "Reload frontend App", - "open-dev-tools": "Open dev tools", + "reload-frontend-app": "Reload frontend", + "open-dev-tools": "Open developer tools", + "find-in-text": "Toggle search panel", "toggle-left-note-tree-panel": "Toggle left (note tree) panel", "toggle-full-screen": "Toggle full screen", "zoom-out": "Zoom Out", @@ -88,11 +99,9 @@ "reset-zoom-level": "Reset zoom level", "copy-without-formatting": "Copy selected text without formatting", "force-save-revision": "Force creating / saving new note revision of the active note", - "show-help": "Shows the built-in User Guide", "toggle-book-properties": "Toggle Book Properties", "toggle-classic-editor-toolbar": "Toggle the Formatting tab for the editor with fixed toolbar", - "export-as-pdf": "Exports the current note as a PDF", - "show-cheatsheet": "Shows a modal with common keyboard operations", + "export-as-pdf": "Export the current note as a PDF", "toggle-zen-mode": "Enables/disables the zen mode (minimal UI for more focused editing)" }, "login": { diff --git a/apps/server/src/services/keyboard_actions.ts b/apps/server/src/services/keyboard_actions.ts index 35bfd9b6f..fe8e7c276 100644 --- a/apps/server/src/services/keyboard_actions.ts +++ b/apps/server/src/services/keyboard_actions.ts @@ -19,12 +19,14 @@ function getDefaultKeyboardActions() { actionName: "backInNoteHistory", // Mac has a different history navigation shortcuts - https://github.com/zadam/trilium/issues/376 defaultShortcuts: isMac ? ["CommandOrControl+Left"] : ["Alt+Left"], + description: t("keyboard_actions.back-in-note-history"), scope: "window" }, { actionName: "forwardInNoteHistory", // Mac has a different history navigation shortcuts - https://github.com/zadam/trilium/issues/376 defaultShortcuts: isMac ? ["CommandOrControl+Right"] : ["Alt+Right"], + description: t("keyboard_actions.forward-in-note-history"), scope: "window" }, { @@ -36,11 +38,13 @@ function getDefaultKeyboardActions() { { actionName: "scrollToActiveNote", defaultShortcuts: ["CommandOrControl+."], + description: t("keyboard_actions.scroll-to-active-note"), scope: "window" }, { actionName: "quickSearch", defaultShortcuts: ["CommandOrControl+S"], + description: t("keyboard_actions.quick-search"), scope: "window" }, { @@ -80,11 +84,13 @@ function getDefaultKeyboardActions() { { actionName: "createNoteAfter", defaultShortcuts: ["CommandOrControl+O"], + description: t("keyboard_actions.create-note-after"), scope: "window" }, { actionName: "createNoteInto", defaultShortcuts: ["CommandOrControl+P"], + description: t("keyboard_actions.create-note-into"), scope: "window" }, { @@ -138,11 +144,13 @@ function getDefaultKeyboardActions() { { actionName: "cloneNotesTo", defaultShortcuts: ["CommandOrControl+Shift+C"], + description: t("keyboard_actions.clone-notes-to"), scope: "window" }, { actionName: "moveNotesTo", defaultShortcuts: ["CommandOrControl+Shift+X"], + description: t("keyboard_actions.move-notes-to"), scope: "window" }, @@ -566,6 +574,7 @@ function getDefaultKeyboardActions() { { actionName: "findInText", defaultShortcuts: isElectron ? ["CommandOrControl+F"] : [], + description: t("keyboard_actions.find-in-text"), scope: "window" }, {