Merge branch 'main' into hyd-226-investigate-if-its-possible-to-use-psutil-to-list-processes

This commit is contained in:
Zamitto 2024-07-03 16:20:55 -03:00
commit d2e3d48ef8
3 changed files with 14 additions and 4 deletions

View File

@ -1,9 +1,9 @@
{ {
"app": { "app": {
"successfully_signed_in": "Logado com sucesso" "successfully_signed_in": "Autenticado com sucesso"
}, },
"home": { "home": {
"featured": "Destaque", "featured": "Destaques",
"trending": "Populares", "trending": "Populares",
"surprise_me": "Surpreenda-me", "surprise_me": "Surpreenda-me",
"no_results": "Nenhum resultado encontrado" "no_results": "Nenhum resultado encontrado"

View File

@ -2,17 +2,23 @@ import { userPreferencesRepository } from "@main/repository";
import { registerEvent } from "../register-event"; import { registerEvent } from "../register-event";
import type { UserPreferences } from "@types"; import type { UserPreferences } from "@types";
import i18next from "i18next";
const updateUserPreferences = async ( const updateUserPreferences = async (
_event: Electron.IpcMainInvokeEvent, _event: Electron.IpcMainInvokeEvent,
preferences: Partial<UserPreferences> preferences: Partial<UserPreferences>
) => ) => {
userPreferencesRepository.upsert( if (preferences.language) {
i18next.changeLanguage(preferences.language);
}
return userPreferencesRepository.upsert(
{ {
id: 1, id: 1,
...preferences, ...preferences,
}, },
["id"] ["id"]
); );
};
registerEvent("updateUserPreferences", updateUserPreferences); registerEvent("updateUserPreferences", updateUserPreferences);

View File

@ -72,6 +72,10 @@ app.whenReady().then(async () => {
where: { id: 1 }, where: { id: 1 },
}); });
if (userPreferences?.language) {
i18n.changeLanguage(userPreferences.language);
}
WindowManager.createMainWindow(); WindowManager.createMainWindow();
WindowManager.createSystemTray(userPreferences?.language || "en"); WindowManager.createSystemTray(userPreferences?.language || "en");
}); });