mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
feat(tray): react to language changes
This commit is contained in:
parent
54f9cf831d
commit
80ddc8b4ef
@ -10,7 +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";
|
import { default as i18next, 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
|
||||||
@ -62,6 +62,7 @@ function registerVisibilityListener() {
|
|||||||
mainWindow.on("maximize", updateTrayMenu);
|
mainWindow.on("maximize", updateTrayMenu);
|
||||||
nativeTheme.on("updated", updateTrayMenu);
|
nativeTheme.on("updated", updateTrayMenu);
|
||||||
ipcMain.on("reload-tray", updateTrayMenu);
|
ipcMain.on("reload-tray", updateTrayMenu);
|
||||||
|
i18next.on("languageChanged", updateTrayMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTrayMenu() {
|
function updateTrayMenu() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user