This commit is contained in:
Biki Kalita
2026-01-17 23:10:57 +05:30
parent 92e908aed8
commit 31d0e6d3dc
7 changed files with 94 additions and 7 deletions

View File

@@ -168,6 +168,13 @@ function SettingsContent({
// Save locale to localStorage for persistence across restarts
localStorage.setItem("next-ai-draw-io-locale", lang)
// Notify Electron main process to update its menu language
if (window.electronAPI?.setUserLocale) {
window.electronAPI.setUserLocale(lang).catch((error) => {
console.error("Failed to sync locale with Electron:", error)
})
}
const parts = pathname.split("/")
if (parts.length > 1 && i18n.locales.includes(parts[1] as Locale)) {
parts[1] = lang