notifications fully translated

This commit is contained in:
MathieuG-P
2022-07-14 18:37:40 +02:00
parent ded026e9bd
commit 3f9b79bf36
13 changed files with 447 additions and 71 deletions
+92 -1
View File
@@ -20,7 +20,8 @@
}
},
"available-versions":{
"title": "Select a version"
"title": "Select a version",
"steam-release":"Release page"
},
"settings":{
"steam":{
@@ -61,5 +62,95 @@
}
}
}
},
"notifications":{
"types":{
"error": "🚨 Error",
"warning": "⚠️ Warning",
"success": "🎉 Success"
},
"bs-download":{
"success":{
"titles":{
"download-success": "Download complete",
"verification-finished":"Verification complete"
}
},
"warnings":{
"msg":{
"ManifestChecksum": "The previously downloaded manifest does not match the new 🤔",
"ConnectionTimeout": "Your internet connection seems unstable 🥶",
"Unknown": "Something strange has happened 🤔 Your connection is probably unstable."
}
},
"errors":{
"titles":{
"verification-failed":"The verification failed."
},
"msg":{
"Password": "Password is invalid.",
"InvalidCredentials": "Your e-mail or password is invalid 😴",
"NoManifest": "No manifest was found",
"DirectoryCreate": "Unable to install the necessary folders.",
"NotAvailableApp": "Are you trying to download BeatSaber when you don't have it ? 🤣",
"DepotNotFound": "Unable to download BeatSaber 😥 try again later 😕",
"NotCompleted": "The download could not complete ¯\\_(ツ)_/¯",
"InvalidManifest": "Unable to download BeatSaber 😥 try again later 😕",
"NoValidKey": "Unable to download BeatSaber 😥 try again later 😕",
"NoManifestCode": "Unable to download BeatSaber 😥 try again later 😕",
"401": "Steam doesn't seem to want to let us download BeatSaber 😢",
"404": "Unable to contact Steam servers.",
"Unknown": "An unknown error occurred ¯\\_(ツ)_/¯",
"NoServer": "Unable to contact Steam servers.",
"NotAllowed": "Apparently you are not allowed to download BeatSaber 🥱",
"ConnectionTimeout": "Cannot connect to Steam 😕",
"SteamLib": "If you have this error, report the bug on GitHub with the logs pls.",
"ConnectionError": "Unable to connect to Steam after 10 tries 🤯",
"LicenceError": "Unable to get the list of licenses.",
"verification-failed": "Verification failed, try again later."
}
}
},
"settings":{
"move-folder":{
"success":{
"titles":{
"transfer-finished":"Transfer complete"
}
},
"errors":{
"titles":{
"transfer-failed":"Transfer failed 😕"
}
}
},
"steam":{
"success":{
"titles":{
"logout": "Disconnected from Steam."
}
}
}
},
"bs-launch":{
"success":{
"titles":{
"launching": "Launching...🚀"
}
},
"errors":{
"titles":{
"UNABLE_TO_LAUNCH": "Unable to launch",
"STEAM_NOT_RUNNING": "Steam is not running",
"BS_ALREADY_RUNNING": "BeatSaber already running",
"EXE_NOT_FINDED": "Missing files"
},
"msg":{
"STEAM_NOT_RUNNING": "Steam must be running to launch BeatSaber.",
"BS_ALREADY_RUNNING": "Close BeatSaber before launching it again.",
"EXE_NOT_FINDED": "Some files seem to be missing, try to verify the files."
}
}
}
}
}
+95 -4
View File
@@ -20,7 +20,8 @@
}
},
"available-versions":{
"title": "Select a version"
"title": "Select a version",
"steam-release":"Release page"
},
"settings":{
"steam":{
@@ -30,7 +31,7 @@
},
"appearance":{
"title":"Appearance",
"description":"Choose the two main colors of BSManager.",
"description":"Choose the two main colours of BSManager.",
"reset":"Reset",
"sub-title":"Theme",
"themes":{
@@ -46,7 +47,7 @@
},
"language":{
"title":"Language",
"description":"Selects a language.",
"description":"Select a language.",
"languages":{
"en-EN": "English, UK",
"en-US": "English, US",
@@ -54,11 +55,101 @@
"es-ES": "Español",
"translated":{
"en-EN": "English, United Kingdom",
"en-US": "English, United States",
"en-US": "English, USA",
"fr-FR": "French",
"es-ES": "Spanish"
}
}
}
}
},
"notifications":{
"types":{
"error": "🚨 Error",
"warning": "⚠️ Warning",
"success": "🎉 Success"
},
"bs-download":{
"success":{
"titles":{
"download-success": "Download complete",
"verification-finished":"Verification complete"
}
},
"warnings":{
"msg":{
"ManifestChecksum": "The previously downloaded manifest does not match the new 🤔",
"ConnectionTimeout": "Your internet connection seems unstable 🥶",
"Unknown": "Something strange has happened 🤔 Your connection is probably unstable."
}
},
"errors":{
"titles":{
"verification-failed":"The verification failed."
},
"msg":{
"Password": "Password is invalid.",
"InvalidCredentials": "Your e-mail or password is invalid 😴",
"NoManifest": "No manifest was found",
"DirectoryCreate": "Unable to install the necessary folders.",
"NotAvailableApp": "Are you trying to download BeatSaber when you don't have it ? 🤣",
"DepotNotFound": "Unable to download BeatSaber 😥 try again later 😕",
"NotCompleted": "The download could not complete ¯\\_(ツ)_/¯",
"InvalidManifest": "Unable to download BeatSaber 😥 try again later 😕",
"NoValidKey": "Unable to download BeatSaber 😥 try again later 😕",
"NoManifestCode": "Unable to download BeatSaber 😥 try again later 😕",
"401": "Steam doesn't seem to want to let us download BeatSaber 😢",
"404": "Unable to contact Steam servers.",
"Unknown": "An unknown error occurred ¯\\_(ツ)_/¯",
"NoServer": "Unable to contact Steam servers.",
"NotAllowed": "Apparently you are not allowed to download BeatSaber 🥱",
"ConnectionTimeout": "Cannot connect to Steam 😕",
"SteamLib": "If you have this error, report the bug on GitHub with the logs pls.",
"ConnectionError": "Unable to connect to Steam after 10 tries 🤯",
"LicenceError": "Unable to get the list of licenses.",
"verification-failed": "Verification failed, try again later."
}
}
},
"settings":{
"move-folder":{
"success":{
"titles":{
"transfer-finished":"Transfer complete"
}
},
"errors":{
"titles":{
"transfer-failed":"Transfer failed 😕"
}
}
},
"steam":{
"success":{
"titles":{
"logout": "Disconnected from Steam."
}
}
}
},
"bs-launch":{
"success":{
"titles":{
"launching": "Launching...🚀"
}
},
"errors":{
"titles":{
"UNABLE_TO_LAUNCH": "Unable to launch",
"STEAM_NOT_RUNNING": "Steam is not running",
"BS_ALREADY_RUNNING": "BeatSaber already running",
"EXE_NOT_FINDED": "Missing files"
},
"msg":{
"STEAM_NOT_RUNNING": "Steam must be running to launch BeatSaber.",
"BS_ALREADY_RUNNING": "Close BeatSaber before launching it again.",
"EXE_NOT_FINDED": "Some files seem to be missing, try to verify the files."
}
}
}
}
+94 -2
View File
@@ -20,7 +20,8 @@
}
},
"available-versions":{
"title": "Seleccione una versión"
"title": "Seleccione una versión",
"steam-release":"Publicación Página"
},
"settings":{
"steam":{
@@ -61,5 +62,96 @@
}
}
}
}
},
"notifications":{
"types":{
"error": "🚨 Error",
"warning": "⚠️ Advertencia",
"success": "🎉 Éxito"
},
"bs-download":{
"success":{
"titles":{
"download-success": "Descargar completo",
"verification-finished":"Verificación completa"
}
},
"warnings":{
"msg":{
"ManifestChecksum": "El manifiesto descargado anteriormente no coincide con el nuevo 🤔",
"ConnectionTimeout": "Su conexión a Internet parece inestable 🥶",
"Unknown": "Algo extraño ha ocurrido 🤔 Tu conexión es probablemente inestable."
}
},
"errors":{
"titles":{
"verification-failed":"La verificación falló."
},
"msg":{
"Password": "La contraseña es inválida.",
"InvalidCredentials": "Su correo electrónico o contraseña no son válidos 😴",
"NoManifest": "No se ha encontrado el manifiesto",
"DirectoryCreate": "No se pueden instalar las carpetas necesarias.",
"NotAvailableApp": "¿Intentas descargar BeatSaber cuando no lo tienes? 🤣",
"DepotNotFound": "No se puede descargar BeatSaber 😥 inténtalo más tarde 😕",
"NotCompleted": "La descarga no pudo completarse ¯\\_(ツ)_/¯",
"InvalidManifest": "No se puede descargar BeatSaber 😥 inténtalo más tarde 😕",
"NoValidKey": "No se puede descargar BeatSaber 😥 inténtalo más tarde 😕",
"NoManifestCode": "No se puede descargar BeatSaber 😥 inténtalo más tarde 😕",
"401": "Parece que Steam no quiere dejarnos descargar BeatSaber 😢",
"404": "No se puede contactar con los servidores de Steam",
"Unknown": "Se ha producido un error desconocido ¯\\_(ツ)_/¯",
"NoServer": "No se puede contactar con los servidores de Steam.",
"NotAllowed": "Aparentemente no tienes permiso para descargar BeatSaber 🥱",
"ConnectionTimeout": "No se puede conectar a Steam 😕",
"SteamLib": "Si tienes este error, reporta el bug en GitHub con los logs por favor.",
"ConnectionError": "No se puede conectar a Steam después de 10 intentos 🤯",
"LicenceError": "No se puede obtener la lista de licencias.",
"verification-failed": "Verificación fallida, inténtelo más tarde."
}
}
},
"settings":{
"move-folder":{
"success":{
"titles":{
"transfer-finished":"Transferencia completa"
}
},
"errors":{
"titles":{
"transfer-failed":"Transferencia fallida 😕"
}
}
},
"steam":{
"success":{
"titles":{
"logout": "Desconectado de Steam."
}
}
}
},
"bs-launch":{
"success":{
"titles":{
"launching": "Lanzamiento...🚀"
}
},
"errors":{
"titles":{
"UNABLE_TO_LAUNCH": "No se puede lanzar",
"STEAM_NOT_RUNNING": "Steam no funciona",
"BS_ALREADY_RUNNING": "BeatSaber ya está en marcha",
"EXE_NOT_FINDED": "Archivos perdidos"
},
"msg":{
"STEAM_NOT_RUNNING": "Para iniciar BeatSaber es necesario que Steam esté en funcionamiento.",
"BS_ALREADY_RUNNING": "Cierra BeatSaber antes de volver a lanzarlo.",
"EXE_NOT_FINDED": "Parece que faltan algunos archivos, intente verificar los archivos."
}
}
}
}
}
+92 -1
View File
@@ -20,7 +20,8 @@
}
},
"available-versions":{
"title": "Choisi une version"
"title": "Choisi une version",
"steam-release":"Notes de version"
},
"settings":{
"steam":{
@@ -61,5 +62,95 @@
}
}
}
},
"notifications":{
"types":{
"error": "🚨 Erreur",
"warning": "⚠️ Attention",
"success": "🎉 Succès"
},
"bs-download":{
"success":{
"titles":{
"download-success": "Téléchargement terminé",
"verification-finished":"Vérification terminée"
}
},
"warnings":{
"msg":{
"ManifestChecksum": "Le manifest télécharger précédemment ne correspond pas au nouveau 🤔",
"ConnectionTimeout": "Ta connexion internet semble instable 🥶",
"Unknown": "Quelque chose d'étrange c'est produit 🤔 Votre connexion est surement instable."
}
},
"errors":{
"titles":{
"verification-failed":"La vérification a échoué."
},
"msg":{
"Password": "Le mot de passe est invalide.",
"InvalidCredentials": "Ton e-mail ou mot de passe est invalide 😴",
"NoManifest": "Aucun manifest n'a été trouvé.",
"DirectoryCreate": "Impossible d'installer les dossiers nécessaires.",
"NotAvailableApp": "Tu essayes de télécharger BeatSaber alors que tu ne l'as pas ? 🤣",
"DepotNotFound": "Impossible de télécharger BeatSaber 😥 réessaye plus tard 😕",
"NotCompleted": "Le téléchargement n'a pas pu se terminer ¯\\_(ツ)_/¯",
"InvalidManifest": "Impossible de télécharger BeatSaber 😥 réessaye plus tard 😕",
"NoValidKey": "Impossible de télécharger BeatSaber 😥 réessaye plus tard 😕",
"NoManifestCode": "Impossible de télécharger BeatSaber 😥 réessaye plus tard 😕",
"401": "Steam semble pas vouloir nous laisser télécharger BeatSaber 😢",
"404": "Impossible de contacter les serveurs de Steam.",
"Unknown": "Une erreur inconnue c'est produite ¯\\_(ツ)_/¯",
"NoServer": "Impossible de contacter les serveurs de Steam.",
"NotAllowed": "Apparemment tu n'es pas autorisé à télécharger BeatSaber 🥱",
"ConnectionTimeout": "Impossible de se connecter à Steam 😕",
"SteamLib": "Si tu à cette erreur, report le bug sur GitHub avec les logs stp.",
"ConnectionError": "Impossible de se connecter à Steam après 10 essais 🤯",
"LicenceError": "Impossible d'obtenir la liste des licences.",
"verification-failed": "La vérification a échoué, réessaye plus tard."
}
}
},
"settings":{
"move-folder":{
"success":{
"titles":{
"transfer-finished":"Transfert terminé 👌"
}
},
"errors":{
"titles":{
"transfer-failed":"Le transfert a échoué 😕"
}
}
},
"steam":{
"success":{
"titles":{
"logout": "Déconnecté de Steam."
}
}
}
},
"bs-launch":{
"success":{
"titles":{
"launching": "Lancement...🚀"
}
},
"errors":{
"titles":{
"UNABLE_TO_LAUNCH": "Lancement impossible",
"STEAM_NOT_RUNNING": "Steam n'est pas lancé",
"BS_ALREADY_RUNNING": "BeatSaber est déjà lancé",
"EXE_NOT_FINDED": "Fichiers manquants"
},
"msg":{
"STEAM_NOT_RUNNING": "Steam doit être en cours d'exécution pour lancer BeatSaber.",
"BS_ALREADY_RUNNING": "Ferme BeatSaber avant de le lancer à nouveau.",
"EXE_NOT_FINDED": "Quelques fichiers semblent manquants. Essaye de vérifier les fichiers."
}
}
}
}
}
+1 -1
View File
@@ -47,7 +47,7 @@ ipcMain.on('bs-download.set-installation-folder', (event, request: IpcRequest<st
UtilsService.getInstance().newIpcSenc(request.responceChannel, {success: true, data: res});
}).catch(err => {
console.log(err);
UtilsService.getInstance().newIpcSenc(request.responceChannel, {success: false, error: err});
UtilsService.getInstance().newIpcSenc(request.responceChannel, {success: false, error: {title: err, type: 'error'}});
});
})
+4 -4
View File
@@ -25,13 +25,13 @@ export default function App() {
else { document.documentElement.classList.remove('dark'); }
});
bsDownloadService.downloadWarning$.pipe(filter(v => !!v), distinctUntilChanged(), debounceTime(100)).subscribe(() => {
notificationService.notifyWarning({title: "Warning", desc: "Your connection seems unstable"});
bsDownloadService.downloadWarning$.pipe(filter(v => !!v), distinctUntilChanged(), debounceTime(100)).subscribe((warning) => {
notificationService.notifyWarning({title: "notifications.types.warning", desc: `notifications.bs-download.warnings.msg.${warning}`});
});
bsDownloadService.downloadError$.pipe(filter(v => !!v), distinctUntilChanged(), debounceTime(100)).subscribe(err => {
notificationService.notifyError({title: "Error", desc: err});
})
notificationService.notifyError({title: "notifications.types.error", desc: `notifications.bs-download.errors.msg.${err}`});
});
}, [])
@@ -8,6 +8,7 @@ import defaultImage from '../../../../assets/images/default-version-img.jpg'
import dateFormat from "dateformat";
import { BsmImage } from "../shared/bsm-image.component";
import { IpcService } from "renderer/services/ipc.service";
import { useTranslation } from "renderer/hooks/use-translation.hook";
export const AvailableVersionItem = memo(function AvailableVersionItem(props: {version: BSVersion}) {
@@ -15,6 +16,7 @@ export const AvailableVersionItem = memo(function AvailableVersionItem(props: {v
const ipcService = IpcService.getInstance();
const [selected, setSelected] = useState(false);
const t = useTranslation();
const formatedDate = (() => { return dateFormat(+props.version.ReleaseDate*1000, "ddd. dS mmm yyyy"); })()
@@ -50,7 +52,7 @@ export const AvailableVersionItem = memo(function AvailableVersionItem(props: {v
{ props.version.ReleaseURL && (
<a onClickCapture={e => { e.stopPropagation(); openReleasePage(); }} className="relative flex flex-row justify-between items-center rounded-full bg-black bg-opacity-30 text-white pb-[1px] hover:bg-opacity-50">
<SteamIcon className="w-[25px] h-[25px] transition-transform group-hover:rotate-[-360deg] duration-300"/>
<span className="relative -left-[2px] text-sm w-0 text-center overflow-hidden h-full whitespace-nowrap pb-[3px] transition-all group-hover:w-24 duration-300">Release Page</span>
<span className="relative -left-[2px] text-sm w-fit max-w-0 text-center overflow-hidden h-full whitespace-nowrap pb-[3px] transition-all group-hover:max-w-[200px] group-hover:px-1 duration-300">{t("pages.available-versions.steam-release")}</span>
</a>
)}
</div>
@@ -6,41 +6,44 @@ import BeatConflictImg from "../../../../assets/images/apngs/beat-conflict.png";
import BeatWaitingImg from "../../../../assets/images/apngs/beat-waiting.png";
import BeatImpatientImg from "../../../../assets/images/apngs/beat-impatient.png";
import { BsmButton } from "../shared/bsm-button.component";
import { useTranslation } from "renderer/hooks/use-translation.hook";
export function NotificationItem({resolver, notification}: {resolver?: (value: NotificationResult|string) => void, notification: Notification}) {
const renderImage = () => {
if(notification.type === NotificationType.SUCCESS){ return BeatRunningImg; }
if(notification.type === NotificationType.WARNING){ return BeatWaitingImg; }
if(notification.type === NotificationType.ERROR){ return BeatConflictImg; }
return BeatImpatientImg;
}
const t = useTranslation();
const renderNeonColors = () => {
if(notification.type === NotificationType.SUCCESS){ return "bg-green-400 shadow-green-400"; }
if(notification.type === NotificationType.WARNING){ return "bg-yellow-400 shadow-yellow-400"; }
if(notification.type === NotificationType.ERROR){ return "bg-red-500 shadow-red-500"; }
return "bg-gray-800 shadow-gray-800 dark:bg-white dark:shadow-white";
}
const renderImage = () => {
if(notification.type === NotificationType.SUCCESS){ return BeatRunningImg; }
if(notification.type === NotificationType.WARNING){ return BeatWaitingImg; }
if(notification.type === NotificationType.ERROR){ return BeatConflictImg; }
return BeatImpatientImg;
}
const renderNeonColors = () => {
if(notification.type === NotificationType.SUCCESS){ return "bg-green-400 shadow-green-400"; }
if(notification.type === NotificationType.WARNING){ return "bg-yellow-400 shadow-yellow-400"; }
if(notification.type === NotificationType.ERROR){ return "bg-red-500 shadow-red-500"; }
return "bg-gray-800 shadow-gray-800 dark:bg-white dark:shadow-white";
}
return (
<motion.div layout initial={{x: "110%"}} animate={{x: "0%"}} exit={{x:"110%"}} className="relative w-[270px] rounded-md overflow-hidden -left-[285px] mb-4 shadow-md shadow-black bg-gradient-to-br from-light-main-color-2 to-light-main-color-2 dark:from-main-color-2 dark:to-main-color-2 text-gray-800 dark:text-white">
<div className="w-full flex flex-col">
<div className="flex items-center justify-start pl-1">
<BsmImage className="h-14 mr-1" image={renderImage()}/>
<div className="flex flex-col py-2">
<h1 className="font-bold leading-4 tracking-wide pr-5 my-1">{notification.title}</h1>
{notification.desc && <p className="text-xs">{notification.desc}</p>}
</div>
<motion.div layout initial={{x: "110%"}} animate={{x: "0%"}} exit={{x:"110%"}} className="relative w-[270px] rounded-md overflow-hidden -left-[285px] mb-4 shadow-md shadow-black bg-gradient-to-br from-light-main-color-2 to-light-main-color-2 dark:from-main-color-2 dark:to-main-color-2 text-gray-800 dark:text-white">
<div className="w-full flex flex-col">
<div className="flex items-center justify-start pl-1">
<BsmImage className="h-14 mr-1" image={renderImage()}/>
<div className="flex flex-col py-2">
<h1 className="font-bold leading-4 tracking-wide pr-5 my-1">{t(notification.title)}</h1>
{notification.desc && <p className="text-xs">{t(notification.desc)}</p>}
</div>
{notification.actions && (
<div className="flex pb-1 w-full flex-wrap px-[2px]">
{notification.actions.map(a => <span onClick={() => resolver(a.id)} className={`px-1 cursor-pointer flex-1 grow rounded-md text-center bg-blue-500 hover:brightness-110 transition-all text-gray-200 whitespace-nowrap m-[3px] ${a.cancel && "!bg-gray-500"}`}>{a.title}</span>)}
</div>
)}
</div>
<span className={`absolute w-full h-1 shadow-center left-0 top-0 ${renderNeonColors()}`}/>
<BsmButton icon="cross" className="absolute top-2 right-2" withBar={false} onClick={() => resolver(NotificationResult.CLOSE)}/>
</motion.div>
</div>
{notification.actions && (
<div className="flex pb-1 w-full flex-wrap px-[2px]">
{notification.actions.map(a => <span onClick={() => resolver(a.id)} className={`px-1 cursor-pointer flex-1 grow rounded-md text-center bg-blue-500 hover:brightness-110 transition-all text-gray-200 whitespace-nowrap m-[3px] ${a.cancel && "!bg-gray-500"}`}>{t(a.title)}</span>)}
</div>
)}
</div>
<span className={`absolute w-full h-1 shadow-center left-0 top-0 ${renderNeonColors()}`}/>
<BsmButton icon="cross" className="absolute top-2 right-2" withBar={false} onClick={() => resolver(NotificationResult.CLOSE)}/>
</motion.div>
)
}
@@ -5,6 +5,7 @@ export function useTranslation(): (translationKey: string) => string{
const i18nService = I18nService.getInstance();
return (key: string) => {
if(!key){ return ""; }
const tranlatables = key.split(" ");
return tranlatables.map((key) => i18nService.translate(key)).join(" ");
}
@@ -38,7 +38,7 @@ export function AvailableVersionsList() {
progressBarService.hide(true);
if(res.success){
notificationService.notifySuccess({title: 'Download Complete', duration: 3000});
notificationService.notifySuccess({title: "notifications.bs-download.success.titles.download-success", duration: 3000});
}
});
}
+22 -19
View File
@@ -75,31 +75,34 @@ export function SettingsPage() {
}
const setDefaultInstallationFolder = () => {
modalService.openModal(ModalType.INSTALLATION_FOLDER).then(async res => {
if(res.exitCode !== ModalExitCode.COMPLETED){ return; }
const fileChooserRes = await ipcService.send<{canceled: boolean, filePaths: string[]}>("choose-folder");
modalService.openModal(ModalType.INSTALLATION_FOLDER).then(async res => {
if(res.exitCode !== ModalExitCode.COMPLETED){ return; }
const fileChooserRes = await ipcService.send<{canceled: boolean, filePaths: string[]}>("choose-folder");
if(fileChooserRes.success && !fileChooserRes.data.canceled && fileChooserRes.data.filePaths?.length){
progressBarService.showFake(.008);
downloaderService.setInstallationFolder(fileChooserRes.data.filePaths[0]).then(res => {
setTimeout(() => {
progressBarService.complete();
setTimeout(() => progressBarService.hide(true), 1000);
}, 1000);
if(res.success){
setInstallationFolder(res.data);
notificationService.notifySuccess({title: "Transfer completed", duration: 3000});
}
});
}
if(fileChooserRes.success && !fileChooserRes.data.canceled && fileChooserRes.data.filePaths?.length){
progressBarService.showFake(.008);
downloaderService.setInstallationFolder(fileChooserRes.data.filePaths[0]).then(res => {
setTimeout(() => {
progressBarService.complete();
setTimeout(() => progressBarService.hide(true), 1000);
}, 1000);
if(res.success){
setInstallationFolder(res.data);
notificationService.notifySuccess({title: "notifications.settings.move-folder.success.titles.transfer-finished", duration: 3000});
}
else{
notificationService.notifyError({title: "notifications.settings.move-folder.errors.titles.transfer-failed", desc: res?.error?.title});
}
});
}
})
}
});
}
const deleteSteamSession = () => {
if(!sessionExist){ return; }
authService.deleteSteamSession();
notificationService.notifySuccess({title: "Disconnected from Steam", duration: 3000});
notificationService.notifySuccess({title: "notifications.settings.steam.success.titles.logout", duration: 3000});
};
return (
@@ -73,6 +73,9 @@ export function VersionViewer() {
.catch((e) => {console.log("*** ", e)})
}
}
else if(id === 2){
verifyFiles();
}
else if(id === 1){
window.electron.ipcRenderer.sendMessage("bs-version.open-folder", state);
}
@@ -82,23 +85,23 @@ export function VersionViewer() {
progressService.show(bsDownloaderService.downloadProgress$);
bsDownloaderService.download(state).then(res => {
progressService.hide(true);
if(!res.success){ notificationService.notifyError({title: "Unable to verify", desc: "Unable to verify, please try later"}); }
else(notificationService.notifySuccess({title: "Verification complete"}));
if(!res.success){ notificationService.notifyError({title: "notifications.bs-download.errors.titles.verification-failed", desc: "notifications.bs-download.errors.msg.verification-failed"}); }
else(notificationService.notifySuccess({title: "notifications.bs-download.success.titles.verification-finished"}));
})
}
const launchBs = () => {
bsLauncherService.launch(state, oculusMode, desktopMode, debugMode).then(res => {
if(!res.success){ notificationService.notifyError({title: 'Unable to launch', desc: res.error.title}); }
else if(res.data === "STEAM_NOT_RUNNING"){ notificationService.notifyWarning({title: "Steam not running", desc: "Steam must be running to launch Beat Saber."}); }
else if(res.data === "BS_ALREADY_RUNNING"){ notificationService.notifyWarning({title: "Beat Saber already running", desc: "Please close Beat Saber to launch."}); }
if(!res.success){ notificationService.notifyError({title: "notifications.bs-launch.errors.titles.UNABLE_TO_LAUNCH", desc: res.error.title}); }
else if(res.data === "STEAM_NOT_RUNNING"){ notificationService.notifyError({title: "notifications.bs-launch.errors.titles.STEAM_NOT_RUNNING", desc: "notifications.bs-launch.errors.msg.STEAM_NOT_RUNNING"}); }
else if(res.data === "BS_ALREADY_RUNNING"){ notificationService.notifyError({title: "notifications.bs-launch.errors.titles.UNABLE_TO_LAUNCH", desc: "notifications.bs-launch.errors.msg.UNABLE_TO_LAUNCH"}); }
else if(res.data === "EXE_NOT_FINDED"){
notificationService.notifyError({title: "Files missing", desc: "Some files are missing, please verify the download", actions: [{id: "0", title:"Verfiy"}]}).then(res => {
notificationService.notifyError({title: "notifications.bs-launch.errors.titles.EXE_NOT_FINDED", desc: "notifications.bs-launch.errors.msg.EXE_NOT_FINDED", actions: [{id: "0", title:"misc.verify"}]}).then(res => {
if(res !== "0"){ return; }
verifyFiles();
});
}
else if(res.data === "LAUNCHED"){ notificationService.notifySuccess({title: "Launching..."}) }
else if(res.data === "LAUNCHED"){ notificationService.notifySuccess({title: "notifications.bs-launch.success.titles.launching"}) }
else(notificationService.notifyError({title: res.data || res.error.title}));
});
}
-1
View File
@@ -47,7 +47,6 @@ export class I18nService {
public translate(translationKey: string): string{
const cachedTranlation = this.cache.get(translationKey);
if(!!cachedTranlation){ return cachedTranlation; }
console.log(translationKey);
const tranlated = getProperty(this.dictionary, translationKey);
tranlated && this.cache.set(translationKey, tranlated);
return tranlated || translationKey;