mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 04:51:31 +08:00 
			
		
		
		
	feat(i18n): translate tray icon
This commit is contained in:
		
							parent
							
								
									60d8bc8238
								
							
						
					
					
						commit
						54f9cf831d
					
				| @ -10,6 +10,7 @@ import becca from "../becca/becca.js"; | |||||||
| import becca_service from "../becca/becca_service.js"; | import becca_service from "../becca/becca_service.js"; | ||||||
| import type BRecentNote from "../becca/entities/brecent_note.js"; | import type BRecentNote from "../becca/entities/brecent_note.js"; | ||||||
| import { ipcMain, nativeTheme } from "electron/main"; | import { ipcMain, nativeTheme } from "electron/main"; | ||||||
|  | import { t } from "i18next"; | ||||||
| 
 | 
 | ||||||
| let tray: Tray; | let tray: Tray; | ||||||
| // `mainWindow.isVisible` doesn't work with `mainWindow.show` and `mainWindow.hide` - it returns `false` when the window
 | // `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([ |     const contextMenu = Menu.buildFromTemplate([ | ||||||
|         { |         { | ||||||
|             label: "Show windows", |             label: t("tray.show-windows"), | ||||||
|             type: "checkbox", |             type: "checkbox", | ||||||
|             checked: isVisible, |             checked: isVisible, | ||||||
|             click: () => { |             click: () => { | ||||||
| @ -153,32 +154,32 @@ function updateTrayMenu() { | |||||||
|         }, |         }, | ||||||
|         { type: "separator" }, |         { type: "separator" }, | ||||||
|         { |         { | ||||||
|             label: "New note", |             label: t("tray.new-note"), | ||||||
|             type: "normal", |             type: "normal", | ||||||
|             icon: getIconPath("new-note"), |             icon: getIconPath("new-note"), | ||||||
|             click: () => triggerKeyboardAction("createNoteIntoInbox") |             click: () => triggerKeyboardAction("createNoteIntoInbox") | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|             label: "Open today's journal note", |             label: t("tray.today"), | ||||||
|             type: "normal", |             type: "normal", | ||||||
|             icon: getIconPath("today"), |             icon: getIconPath("today"), | ||||||
|             click: () => openInSameTab(date_notes.getTodayNote()) |             click: () => openInSameTab(date_notes.getTodayNote()) | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|             label: "Bookmarks", |             label: t("tray.bookmarks"), | ||||||
|             type: "submenu", |             type: "submenu", | ||||||
|             icon: getIconPath("bookmarks"), |             icon: getIconPath("bookmarks"), | ||||||
|             submenu: buildBookmarksMenu() |             submenu: buildBookmarksMenu() | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|             label: "Recent notes", |             label: t("tray.recents"), | ||||||
|             type: "submenu", |             type: "submenu", | ||||||
|             icon: getIconPath("recents"), |             icon: getIconPath("recents"), | ||||||
|             submenu: buildRecentNotesMenu() |             submenu: buildRecentNotesMenu() | ||||||
|         }, |         }, | ||||||
|         { type: "separator" }, |         { type: "separator" }, | ||||||
|         { |         { | ||||||
|             label: "Quit Trilium", |             label: t("tray.close"), | ||||||
|             type: "normal", |             type: "normal", | ||||||
|             icon: getIconPath("close"), |             icon: getIconPath("close"), | ||||||
|             click: () => { |             click: () => { | ||||||
| @ -210,7 +211,7 @@ function createTray() { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     tray = new Tray(getTrayIconPath()); |     tray = new Tray(getTrayIconPath()); | ||||||
|     tray.setToolTip("TriliumNext Notes"); |     tray.setToolTip(t("tray.tooltip")); | ||||||
|     // Restore focus
 |     // Restore focus
 | ||||||
|     tray.on("click", changeVisibility); |     tray.on("click", changeVisibility); | ||||||
|     updateTrayMenu(); |     updateTrayMenu(); | ||||||
|  | |||||||
| @ -260,5 +260,14 @@ | |||||||
|     "unable-to-export-message": "The current note could not be exported as a PDF.", |     "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-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." |     "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" | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
| @ -261,5 +261,14 @@ | |||||||
|     "unable-to-export-message": "Notița curentă nu a putut fi exportată ca PDF.", |     "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-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." |     "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" | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran