feat: i18n

This commit is contained in:
Zamitto
2025-05-17 18:53:39 -03:00
parent c85f46844e
commit 5475708b36
7 changed files with 61 additions and 21 deletions

View File

@@ -366,23 +366,31 @@ export class WindowManager {
this.loadNotificationWindowURL();
this.notificationWindow.once("ready-to-show", () => {
if (isStaging) {
this.notificationWindow?.webContents.openDevTools();
}
if (showTestNotification) {
const language = userPreferences.language ?? "en";
setTimeout(() => {
this.notificationWindow?.webContents.send(
"on-achievement-unlocked",
userPreferences.achievementCustomNotificationPosition ?? "top_left",
[generateAchievementCustomNotificationTest(t, language)]
);
this.showTestNotification();
}, 1000);
}
});
}
public static async showTestNotification() {
const userPreferences = await db.get<string, UserPreferences>(
levelKeys.userPreferences,
{
valueEncoding: "json",
}
);
const language = userPreferences.language ?? "en";
this.notificationWindow?.webContents.send(
"on-achievement-unlocked",
userPreferences.achievementCustomNotificationPosition ?? "top_left",
[generateAchievementCustomNotificationTest(t, language)]
);
}
public static async closeNotificationWindow() {
if (this.notificationWindow) {
this.notificationWindow.close();