Merge branch 'main' into teste-locale2

This commit is contained in:
Zamitto 2024-05-26 19:52:19 -03:00 committed by GitHub
commit 179db348e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 101 additions and 154 deletions

View file

@ -54,7 +54,7 @@
"remove": "Eliminar",
"remove_from_list": "Quitar",
"space_left_on_disk": "{{space}} restantes en el disco",
"eta": "Finalizando en {{eta}}",
"eta": "Tiempo restante: {{eta}}",
"downloading_metadata": "Descargando metadatos…",
"checking_files": "Analizando archivos…",
"filter": "Buscar repacks",

View file

@ -72,7 +72,7 @@
"minutes": "minuti",
"amount_hours": "{{amount}} ore",
"amount_minutes": "{{amount}} minuti",
"accuracy": "{{accuratezza}}% di accuratezza",
"accuracy": "{{accuracy}}% di accuratezza",
"add_to_library": "Aggiungi alla libreria",
"remove_from_library": "Rimuovi dalla libreria",
"no_downloads": "Nessun download disponibile",
@ -86,7 +86,6 @@
"playing_now": "Stai giocando adesso",
"change": "Aggiorna",
"repacks_modal_description": "Scegli il repack che vuoi scaricare",
"downloads_path": "Percorso dei download",
"select_folder_hint": "Per cambiare la cartella predefinita, accedi alle",
"download_now": "Scarica ora",
"installation_instructions": "Istruzioni di installazione",
@ -96,7 +95,14 @@
"dont_show_it_again": "Non mostrarlo più",
"copy_to_clipboard": "Copia",
"copied_to_clipboard": "Copiato",
"got_it": "Capito"
"got_it": "Capito",
"no_shop_details": "Impossibile recuperare i dettagli del negozio.",
"download_options": "Opzioni di download",
"download_path": "Percorso di download",
"previous_screenshot": "Screenshot precedente",
"next_screenshot": "Screenshot successivo",
"screenshot": "Screenshot {{number}}",
"open_screenshot": "Apri screenshot {{number}}"
},
"activation": {
"title": "Attiva Hydra",
@ -127,7 +133,9 @@
"remove_from_list": "Rimuovi",
"delete_modal_title": "Sei sicuro?",
"delete_modal_description": "Questo rimuoverà tutti i file di installazione dal tuo computer",
"install": "Installa"
"install": "Installa",
"real_debrid": "Real Debrid",
"torrent": "Torrent"
},
"settings": {
"downloads_path": "Percorso dei download",
@ -136,7 +144,16 @@
"enable_download_notifications": "Quando un download è completo",
"enable_repack_list_notifications": "Quando viene aggiunto un nuovo repack",
"telemetry": "Telemetria",
"telemetry_description": "Abilita statistiche di utilizzo anonime"
"telemetry_description": "Abilita statistiche di utilizzo anonime",
"real_debrid_api_token_label": "Token API Real Debrid",
"quit_app_instead_hiding": "Esci da Hydra invece di nascondere nell'area di notifica",
"launch_with_system": "Apri Hydra all'avvio",
"general": "Generale",
"behavior": "Comportamento",
"enable_real_debrid": "Abilita Real Debrid",
"real_debrid": "Real Debrid",
"real_debrid_api_token_hint": "Puoi trovare la tua chiave API <0>here</0>.",
"save_changes": "Salva modifiche"
},
"notifications": {
"download_complete": "Download completato",
@ -159,5 +176,11 @@
},
"modal": {
"close": "Pulsante Chiudi"
},
"splash": {
"downloading_version": "Scaricando la versione {{version}}",
"searching_updates": "Ricerca di aggiornamenti",
"update_found": "Trovato aggiornamento {{version}}",
"restarting_and_applying": "Riavvio e applico l'aggiornamento"
}
}

View file

@ -176,5 +176,11 @@
},
"modal": {
"close": "Закрыть"
},
"splash": {
"downloading_version": "Загрузка версии {{version}}",
"searching_updates": "Поиск обновлений",
"update_found": "Найдена новая версия {{version}}",
"restarting_and_applying": "Перезапуск и внесение изменений"
}
}

View file

@ -174,5 +174,11 @@
},
"modal": {
"close": "关闭按钮"
},
"splash": {
"downloading_version": "正在下载新版本 {{version}}",
"searching_updates": "检查更新...",
"update_found": "有新版本 {{version}} 可用",
"restarting_and_applying": "重启并应用更新"
}
}

View file

@ -26,6 +26,8 @@ export const databasePath = path.join(
"hydra.db"
);
export const logsPath = path.join(app.getPath("appData"), "hydra", "logs");
export const seedsPath = app.isPackaged
? path.join(process.resourcesPath, "seeds")
: path.join(__dirname, "..", "..", "seeds");

View file

@ -1,11 +1,26 @@
import winston from "winston";
import { logsPath } from "@main/constants";
import log from "electron-log";
import path from "path";
export const logger = winston.createLogger({
level: "info",
format: winston.format.json(),
transports: [
new winston.transports.File({ filename: "error.log", level: "error" }),
new winston.transports.File({ filename: "info.log", level: "info" }),
new winston.transports.File({ filename: "combined.log" }),
],
log.transports.file.resolvePathFn = (
_: log.PathVariables,
message?: log.LogMessage | undefined
) => {
if (message?.level === "error") {
return path.join(logsPath, "error.txt");
}
if (message?.level === "info") {
return path.join(logsPath, "info.txt");
}
return path.join(logsPath, "logs.txt");
};
log.errorHandler.startCatching({
showDialog: false,
});
log.initialize();
export const logger = log.scope("main");

View file

@ -19,6 +19,7 @@ export class WindowManager {
public static mainWindow: Electron.BrowserWindow | null = null;
public static splashWindow: Electron.BrowserWindow | null = null;
public static isReadyToShowMainWindow = false;
private static isMainMaximized = false;
private static loadURL(hash = "") {
// HMR for renderer base on electron-vite cli.
@ -71,6 +72,10 @@ export class WindowManager {
this.loadSplashURL();
this.splashWindow.removeMenu();
if (this.splashWindow?.isMaximized()) {
this.splashWindow?.unmaximize();
this.isMainMaximized = true;
}
}
public static createMainWindow() {
@ -94,13 +99,16 @@ export class WindowManager {
preload: path.join(__dirname, "../preload/index.mjs"),
sandbox: false,
},
show: false,
});
this.loadURL();
this.mainWindow.removeMenu();
if (this.isMainMaximized) this.mainWindow?.maximize();
this.mainWindow.on("ready-to-show", () => {
if (!app.isPackaged) WindowManager.mainWindow?.webContents.openDevTools();
WindowManager.mainWindow?.show();
});
this.mainWindow.on("close", async () => {

View file

@ -6,7 +6,7 @@
<title>Hydra</title>
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://steamcdn-a.akamaihd.net https://cdn.cloudflare.steamstatic.com https://cdn2.steamgriddb.com https://cdn.akamai.steamstatic.com; media-src 'self' data: https://steamcdn-a.akamaihd.net https://cdn.cloudflare.steamstatic.com https://cdn2.steamgriddb.com https://cdn.akamai.steamstatic.com;"
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://steamcdn-a.akamaihd.net https://shared.akamai.steamstatic.com https://cdn.cloudflare.steamstatic.com https://cdn2.steamgriddb.com https://cdn.akamai.steamstatic.com; media-src 'self' data: https://steamcdn-a.akamaihd.net https://cdn.cloudflare.steamstatic.com https://cdn2.steamgriddb.com https://cdn.akamai.steamstatic.com https://shared.akamai.steamstatic.com;"
/>
</head>
<body style="background-color: #1c1c1c">

View file

@ -0,0 +1,3 @@
import log from "electron-log/renderer";
export const logger = log.scope("renderer");