Fix locale detection error

pull/359/head
aandrew-me 8 months ago
parent 22e3b79ebb
commit 7869bad44a

@ -287,7 +287,6 @@ function registerIpcHandlers() {
}
});
ipcMain.handle("open-folder", async (_event, folderPath) => {
try {
await fs.stat(folderPath);
@ -389,8 +388,8 @@ function registerIpcHandlers() {
if (response === 1) clipboard.writeText(message);
});
ipcMain.on("get-system-locale", (event) => {
event.returnValue = app.getSystemLocale();
ipcMain.handle("get-system-locale", async (_event) => {
return app.getSystemLocale();
});
ipcMain.handle("get-translation", (_event, locale) => {
@ -480,14 +479,11 @@ function registerAutoUpdaterEvents() {
autoUpdater.on("download-progress", async (info) => {
appState.mainWindow.webContents.send("download-progress", info.percent);
})
});
autoUpdater.on("error", (error) => {
console.error("Auto-update error:", error);
dialog.showErrorBox(
"Update Error",
i18n("updateError")
);
dialog.showErrorBox("Update Error", i18n("updateError"));
});
}

@ -36,7 +36,9 @@ async function getLocale() {
let locale = null;
try {
locale = await ipcRenderer.invoke("get-system-locale");
} catch (e) {}
} catch (e) {
console.log(e)
}
if (!locale && typeof navigator !== "undefined") {
locale =

Loading…
Cancel
Save