mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
feat: add strings to translations file
This commit is contained in:
parent
39ceb38ecd
commit
5667c813d9
@ -176,5 +176,11 @@
|
|||||||
},
|
},
|
||||||
"modal": {
|
"modal": {
|
||||||
"close": "Close button"
|
"close": "Close button"
|
||||||
|
},
|
||||||
|
"splash": {
|
||||||
|
"downloading_version": "Downloading version {{version}}",
|
||||||
|
"searching_updates": "Searching for updates",
|
||||||
|
"update_found": "Update {{version}} found",
|
||||||
|
"restarting_and_applying": "Restarting and applying update"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,5 +176,11 @@
|
|||||||
},
|
},
|
||||||
"modal": {
|
"modal": {
|
||||||
"close": "Botão de fechar"
|
"close": "Botão de fechar"
|
||||||
|
},
|
||||||
|
"splash": {
|
||||||
|
"downloading_version": "Baixando versão {{version}}",
|
||||||
|
"searching_updates": "Buscando atualizações",
|
||||||
|
"update_found": "Versão {{version}} encontrada",
|
||||||
|
"restarting_and_applying": "Reiniciando e aplicando atualização"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import { themeClass } from "../../theme.css";
|
|||||||
import "../../app.css";
|
import "../../app.css";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { AppUpdaterEvents } from "@types";
|
import { AppUpdaterEvents } from "@types";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
document.body.classList.add(themeClass);
|
document.body.classList.add(themeClass);
|
||||||
|
|
||||||
@ -12,8 +13,9 @@ export default function Splash() {
|
|||||||
const [status, setStatus] = useState<AppUpdaterEvents | null>(null);
|
const [status, setStatus] = useState<AppUpdaterEvents | null>(null);
|
||||||
const [newVersion, setNewVersion] = useState("");
|
const [newVersion, setNewVersion] = useState("");
|
||||||
|
|
||||||
|
const { t } = useTranslation("splash");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("subscribing");
|
|
||||||
const unsubscribe = window.electron.onAutoUpdaterEvent(
|
const unsubscribe = window.electron.onAutoUpdaterEvent(
|
||||||
(event: AppUpdaterEvents) => {
|
(event: AppUpdaterEvents) => {
|
||||||
setStatus(event);
|
setStatus(event);
|
||||||
@ -50,7 +52,7 @@ export default function Splash() {
|
|||||||
case "download-progress":
|
case "download-progress":
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<p>Baixando versão {newVersion}</p>
|
<p>{t("downloading_version", { version: newVersion })}</p>
|
||||||
<div className={styles.progressBarContainer}>
|
<div className={styles.progressBarContainer}>
|
||||||
<div
|
<div
|
||||||
className={styles.progressBarFill}
|
className={styles.progressBarFill}
|
||||||
@ -63,11 +65,11 @@ export default function Splash() {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
case "checking-for-updates":
|
case "checking-for-updates":
|
||||||
return <p>Buscando atualizações</p>;
|
return <p>{t("searching_updates")}</p>;
|
||||||
case "update-available":
|
case "update-available":
|
||||||
return <p>Versão {status.info.version} encontrada</p>;
|
return <p>{t("update_found", { version: newVersion })}</p>;
|
||||||
case "update-downloaded":
|
case "update-downloaded":
|
||||||
return <p>Reiniciando e aplicando atualização</p>;
|
return <p>{t("restarting_and_applying")}</p>;
|
||||||
default:
|
default:
|
||||||
return <></>;
|
return <></>;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user