feat: add strings to translations file

This commit is contained in:
Zamitto 2024-05-20 16:05:33 -03:00
parent 39ceb38ecd
commit 5667c813d9
3 changed files with 19 additions and 5 deletions

View File

@ -176,5 +176,11 @@
},
"modal": {
"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"
}
}

View File

@ -176,5 +176,11 @@
},
"modal": {
"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"
}
}

View File

@ -5,6 +5,7 @@ import { themeClass } from "../../theme.css";
import "../../app.css";
import { useEffect, useState } from "react";
import { AppUpdaterEvents } from "@types";
import { useTranslation } from "react-i18next";
document.body.classList.add(themeClass);
@ -12,8 +13,9 @@ export default function Splash() {
const [status, setStatus] = useState<AppUpdaterEvents | null>(null);
const [newVersion, setNewVersion] = useState("");
const { t } = useTranslation("splash");
useEffect(() => {
console.log("subscribing");
const unsubscribe = window.electron.onAutoUpdaterEvent(
(event: AppUpdaterEvents) => {
setStatus(event);
@ -50,7 +52,7 @@ export default function Splash() {
case "download-progress":
return (
<>
<p>Baixando versão {newVersion}</p>
<p>{t("downloading_version", { version: newVersion })}</p>
<div className={styles.progressBarContainer}>
<div
className={styles.progressBarFill}
@ -63,11 +65,11 @@ export default function Splash() {
</>
);
case "checking-for-updates":
return <p>Buscando atualizações</p>;
return <p>{t("searching_updates")}</p>;
case "update-available":
return <p>Versão {status.info.version} encontrada</p>;
return <p>{t("update_found", { version: newVersion })}</p>;
case "update-downloaded":
return <p>Reiniciando e aplicando atualização</p>;
return <p>{t("restarting_and_applying")}</p>;
default:
return <></>;
}