Skip to content

Build your personal knowledge base with Trilium Notes

feat(tray): react to language changes

Elian Doran80ddc8b4ef8d
diff --git a/src/services/tray.ts b/src/services/tray.ts
index 8ef708cb57..9aa81e12c2 100644
--- a/src/services/tray.ts
+++ b/src/services/tray.ts
@@ -10,7 +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";
+import { default as i18next, t } from "i18next";
let tray: Tray;
// `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);
nativeTheme.on("updated", updateTrayMenu);
ipcMain.on("reload-tray", updateTrayMenu);
+ i18next.on("languageChanged", updateTrayMenu);
}
function updateTrayMenu() {