diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json index eda98d77..4e8a9158 100644 --- a/src/locales/pt/translation.json +++ b/src/locales/pt/translation.json @@ -1,9 +1,9 @@ { "app": { - "successfully_signed_in": "Logado com sucesso" + "successfully_signed_in": "Autenticado com sucesso" }, "home": { - "featured": "Destaque", + "featured": "Destaques", "trending": "Populares", "surprise_me": "Surpreenda-me", "no_results": "Nenhum resultado encontrado" diff --git a/src/main/events/user-preferences/update-user-preferences.ts b/src/main/events/user-preferences/update-user-preferences.ts index 66d56d4a..f45af519 100644 --- a/src/main/events/user-preferences/update-user-preferences.ts +++ b/src/main/events/user-preferences/update-user-preferences.ts @@ -2,17 +2,23 @@ import { userPreferencesRepository } from "@main/repository"; import { registerEvent } from "../register-event"; import type { UserPreferences } from "@types"; +import i18next from "i18next"; const updateUserPreferences = async ( _event: Electron.IpcMainInvokeEvent, preferences: Partial -) => - userPreferencesRepository.upsert( +) => { + if (preferences.language) { + i18next.changeLanguage(preferences.language); + } + + return userPreferencesRepository.upsert( { id: 1, ...preferences, }, ["id"] ); +}; registerEvent("updateUserPreferences", updateUserPreferences); diff --git a/src/main/index.ts b/src/main/index.ts index 7b7c6390..e288302b 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -72,6 +72,10 @@ app.whenReady().then(async () => { where: { id: 1 }, }); + if (userPreferences?.language) { + i18n.changeLanguage(userPreferences.language); + } + WindowManager.createMainWindow(); WindowManager.createSystemTray(userPreferences?.language || "en"); });