Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(i18n): translate tray icon
Elian Doran54f9cf831d2e
diff --git a/src/services/tray.ts b/src/services/tray.tsindex 319ce55fb2..8ef708cb57 100644--- a/src/services/tray.ts+++ b/src/services/tray.ts@@ -10,6 +10,7 @@ import becca from "../becca/becca.js";import becca_service from "../becca/becca_service.js";import type BRecentNote from "../becca/entities/brecent_note.js";import { ipcMain, nativeTheme } from "electron/main";+import { t } from "i18next";let tray: Tray;// `mainWindow.isVisible` doesn't work with `mainWindow.show` and `mainWindow.hide` - it returns `false` when the window@@ -140,7 +141,7 @@ function updateTrayMenu() {const contextMenu = Menu.buildFromTemplate([{- label: "Show windows",+ label: t("tray.show-windows"),type: "checkbox",checked: isVisible,click: () => {@@ -153,32 +154,32 @@ function updateTrayMenu() {},{ type: "separator" },{- label: "New note",+ label: t("tray.new-note"),type: "normal",icon: getIconPath("new-note"),click: () => triggerKeyboardAction("createNoteIntoInbox")},{- label: "Open today's journal note",+ label: t("tray.today"),type: "normal",icon: getIconPath("today"),click: () => openInSameTab(date_notes.getTodayNote())},{- label: "Bookmarks",+ label: t("tray.bookmarks"),type: "submenu",icon: getIconPath("bookmarks"),submenu: buildBookmarksMenu()},{- label: "Recent notes",+ label: t("tray.recents"),type: "submenu",icon: getIconPath("recents"),submenu: buildRecentNotesMenu()},{ type: "separator" },{- label: "Quit Trilium",+ label: t("tray.close"),type: "normal",icon: getIconPath("close"),click: () => {@@ -210,7 +211,7 @@ function createTray() {}tray = new Tray(getTrayIconPath());- tray.setToolTip("TriliumNext Notes");+ tray.setToolTip(t("tray.tooltip"));// Restore focustray.on("click", changeVisibility);updateTrayMenu();diff --git a/translations/en/server.json b/translations/en/server.jsonindex c3a840b401..a0b3e25212 100644--- a/translations/en/server.json+++ b/translations/en/server.json@@ -260,5 +260,14 @@"unable-to-export-message": "The current note could not be exported as a PDF.","unable-to-export-title": "Unable to export as PDF","unable-to-save-message": "The selected file could not be written to. Try again or select another destination."+ },+ "tray": {+ "tooltip": "TriliumNext Notes",+ "close": "Quit Trilium",+ "recents": "Recent notes",+ "bookmarks": "Bookmarks",+ "today": "Open today's journal note",+ "new-note": "New note",+ "show-windows": "Show windows"}}diff --git a/translations/ro/server.json b/translations/ro/server.jsonindex b27cec3710..6ff05b095c 100644--- a/translations/ro/server.json+++ b/translations/ro/server.json@@ -261,5 +261,14 @@"unable-to-export-message": "Notița curentă nu a putut fi exportată ca PDF.","unable-to-export-title": "Nu s-a putut exporta ca PDF","unable-to-save-message": "Nu s-a putut scrie fișierul selectat. Încercați din nou sau selectați altă destinație."+ },+ "tray": {+ "bookmarks": "Semne de carte",+ "close": "Închide Trilium",+ "new-note": "Notiță nouă",+ "recents": "Notițe recente",+ "today": "Mergi la notița de astăzi",+ "tooltip": "TriliumNext Notes",+ "show-windows": "Afișează ferestrele"}}