diff --git a/assets/jsons/translations/de.json b/assets/jsons/translations/de.json index b1ad0908..f3edef0c 100644 --- a/assets/jsons/translations/de.json +++ b/assets/jsons/translations/de.json @@ -201,6 +201,34 @@ "changelogs": { "open" : "🚀 Neues im Changelog entdecken!", "not-founds": "😕 Hoppla, kein Changelog zu sehen!" + }, + "advanced": { + "title": "Erweiterte", + "description": "Erweiterte Einstellungen für BSManager.", + "hardware-acceleration": { + "title": "Hardware-Beschleunigung", + "description": "Aktivieren Sie die Hardware-Beschleunigung, um Ihre GPU zu nutzen und die Leistung von BSManager zu verbessern. Deaktivieren Sie diese Option, wenn Sie Frame-Drops erleben.", + "modal": { + "title": "Neustart erforderlich", + "body": "Das Ändern der Hardware-Beschleunigungseinstellung wird BSManager beenden und neu starten. Sind Sie sicher, dass Sie dies tun möchten?", + "confirm-btn": "Ja, ich bin sicher" + }, + "error-notification": { + "message": "Ein Fehler ist aufgetreten, die Hardware-Beschleunigung kann nicht deaktiviert werden." + } + }, + "use-symlinks": { + "title": "Symbolische Links verwenden", + "description": "Verwenden Sie symbolische Links anstelle von Verknüpfungen, um Ordner zu verknüpfen. Aktivieren Sie dies nur, wenn Sie es wirklich benötigen.", + "modal": { + "title": "Berechtigungen für symbolische Links", + "body": "Beim Erstellen symbolischer Links benötigt BSManager Administratorrechte oder den aktivierten Entwicklermodus auf Ihrem System. Sind Sie sicher, dass Sie fortfahren möchten?", + "confirm-btn": "Ja, ich bin sicher" + }, + "error-notification": { + "message": "Ein Fehler ist aufgetreten, die Einstellungen für symbolische Links können nicht geändert werden." + } + } } } }, diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json index 45648c95..3d9b1392 100644 --- a/assets/jsons/translations/en.json +++ b/assets/jsons/translations/en.json @@ -206,6 +206,34 @@ "changelogs": { "open" : "🚀 Check Out the Changelog!", "not-founds": "😕 Oops, No Changelog Here!" + }, + "advanced": { + "title": "Advanced", + "description": "Advanced settings for BSManager.", + "hardware-acceleration": { + "title": "Hardware Acceleration", + "description": "Enable Hardware Acceleration to use your GPU and improve BSManager's performance. Turn this off if you're experiencing frame drops.", + "modal": { + "title": "Restart Needed", + "body": "Changing hardware acceleration setting will quit and re-launch BSManager. Are you sure you want to do this?", + "confirm-btn": "Yes I'm sure" + }, + "error-notification": { + "message": "An error occur, unable to disable hardware acceleration." + } + }, + "use-symlinks": { + "title": "Use Symlinks", + "description": "Use Symlinks instead of Junctions to link folders. Turn this on only if you really need it.", + "modal": { + "title": "Symlink Permissions", + "body": "When creating symlinks, BSManager will require administrator privileges or developer mode enabled on your system. Are you sure you want to continue?", + "confirm-btn": "Yes I'm sure" + }, + "error-notification": { + "message": "An error occur, unable to change symlinks settings." + } + } } } }, diff --git a/assets/jsons/translations/es.json b/assets/jsons/translations/es.json index a075cf42..e3122355 100644 --- a/assets/jsons/translations/es.json +++ b/assets/jsons/translations/es.json @@ -201,6 +201,34 @@ "changelogs": { "open" : "🚀 ¡Descubre lo nuevo en el Changelog!", "not-founds": "😕 Uy, ¡Changelog no encontrado!" + }, + "advanced": { + "title": "Avanzados", + "description": "Configuraciones avanzadas para BSManager.", + "hardware-acceleration": { + "title": "Aceleración de hardware", + "description": "Habilite la aceleración de hardware para usar su GPU y mejorar el rendimiento de BSManager. Desactive esta opción si experimenta caídas de fotogramas.", + "modal": { + "title": "Reinicio necesario", + "body": "Cambiar la configuración de aceleración de hardware cerrará y reiniciará BSManager. ¿Estás seguro de que quieres hacer esto?", + "confirm-btn": "Sí, estoy seguro" + }, + "error-notification": { + "message": "Ocurrió un error, no se puede desactivar la aceleración de hardware." + } + }, + "use-symlinks": { + "title": "Usar enlaces simbólicos", + "description": "Utilice enlaces simbólicos en lugar de uniones para enlazar carpetas. Actívelo solo si realmente lo necesita.", + "modal": { + "title": "Permisos de enlace simbólico", + "body": "Al crear enlaces simbólicos, BSManager requerirá privilegios de administrador o el modo desarrollador activado en su sistema. ¿Estás seguro de que quieres continuar?", + "confirm-btn": "Sí, estoy seguro" + }, + "error-notification": { + "message": "Ocurrió un error, no se pueden cambiar los ajustes de los enlaces simbólicos." + } + } } } }, diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json index 28053b11..d2748d53 100644 --- a/assets/jsons/translations/fr.json +++ b/assets/jsons/translations/fr.json @@ -201,6 +201,34 @@ "changelogs": { "open" : "🚀 Jetez un œil au Changelog !", "not-founds": "😕 Oups, Changelog introuvable !" + }, + "advanced": { + "title": "Avancés", + "description": "Paramètres avancés pour BSManager.", + "hardware-acceleration": { + "title": "Accélération matérielle", + "description": "Activez l'accélération matérielle pour utiliser votre GPU et améliorer les performances de BSManager. Désactivez cette option si vous rencontrez des chutes d'IPS.", + "modal": { + "title": "Redémarrage nécessaire", + "body": "Changer le paramètre d'accélération matérielle va quitter et relancer BSManager. Êtes-vous sûr de vouloir continuer ?", + "confirm-btn": "Oui, je suis sûr" + }, + "error-notification": { + "message": "Une erreur s'est produite, impossible de désactiver l'accélération matérielle." + } + }, + "use-symlinks": { + "title": "Utiliser des liens symboliques", + "description": "Utilisez des liens symboliques au lieu de jonctions pour lier des dossiers. Activez cette option uniquement si vous en avez besoin.", + "modal": { + "title": "Permissions des liens symboliques", + "body": "Lors de la création de liens symboliques, BSManager nécessitera des privilèges administrateur ou le mode développeur activé sur votre système. Êtes-vous sûr de vouloir continuer ?", + "confirm-btn": "Oui, je suis sûr" + }, + "error-notification": { + "message": "Une erreur s'est produite, impossible de changer les paramètres des liens symboliques." + } + } } } }, diff --git a/assets/jsons/translations/ja.json b/assets/jsons/translations/ja.json index e1636ce9..948f31e8 100644 --- a/assets/jsons/translations/ja.json +++ b/assets/jsons/translations/ja.json @@ -201,6 +201,34 @@ "changelogs": { "open" : "🚀 チェンジログを覗いてみて!", "not-founds": "😕 あれ、チェンジログが見当たらない!" + }, + "advanced": { + "title": "高度な設定", + "description": "BSManagerの高度な設定。", + "hardware-acceleration": { + "title": "ハードウェアアクセラレーション", + "description": "ハードウェアアクセラレーションを有効にしてGPUを使用し、BSManagerのパフォーマンスを向上させます。フレームドロップが発生している場合は、これをオフにしてください。", + "modal": { + "title": "再起動が必要", + "body": "ハードウェアアクセラレーションの設定を変更すると、BSManagerが終了して再起動します。本当に続行しますか?", + "confirm-btn": "はい、確かです" + }, + "error-notification": { + "message": "エラーが発生しました。ハードウェアアクセラレーションを無効にできません。" + } + }, + "use-symlinks": { + "title": "シンボリックリンクを使用", + "description": "フォルダをリンクするためにジャンクションの代わりにシンボリックリンクを使用します。本当に必要な場合にのみこれをオンにしてください。", + "modal": { + "title": "シンボリックリンクの権限", + "body": "シンボリックリンクを作成する際、BSManagerは管理者権限またはシステムで有効になっている開発者モードを必要とします。本当に続行しますか?", + "confirm-btn": "はい、確かです" + }, + "error-notification": { + "message": "エラーが発生しました。シンボリックリンク設定を変更できません。" + } + } } } }, diff --git a/assets/jsons/translations/ru.json b/assets/jsons/translations/ru.json index 1202ed50..c246de4e 100644 --- a/assets/jsons/translations/ru.json +++ b/assets/jsons/translations/ru.json @@ -201,6 +201,34 @@ "changelogs": { "open" : "🚀 Изучаем Changelog!", "not-founds": "😕 Ой, Changelog нигде не видно!" + }, + "advanced": { + "title": "Дополнительные", + "description": "Дополнительные настройки для BSManager.", + "hardware-acceleration": { + "title": "Аппаратное ускорение", + "description": "Включите аппаратное ускорение, чтобы использовать ваш GPU и улучшить производительность BSManager. Отключите эту опцию, если у вас возникают пропуски кадров.", + "modal": { + "title": "Требуется перезагрузка", + "body": "Изменение настройки аппаратного ускорения приведет к завершению и перезапуску BSManager. Вы уверены, что хотите это сделать?", + "confirm-btn": "Да, я уверен" + }, + "error-notification": { + "message": "Произошла ошибка, невозможно отключить аппаратное ускорение." + } + }, + "use-symlinks": { + "title": "Использовать символические ссылки", + "description": "Используйте символические ссылки вместо соединений для связывания папок. Включайте эту опцию только если это действительно необходимо.", + "modal": { + "title": "Разрешения для символических ссылок", + "body": "При создании символических ссылок BSManager потребуется права администратора или включенный режим разработчика на вашем устройстве. Вы уверены, что хотите продолжить?", + "confirm-btn": "Да, я уверен" + }, + "error-notification": { + "message": "Произошла ошибка, невозможно изменить настройки символических ссылок." + } + } } } }, diff --git a/assets/jsons/translations/zh-tw.json b/assets/jsons/translations/zh-tw.json index d0f83ef0..95ab1ff8 100644 --- a/assets/jsons/translations/zh-tw.json +++ b/assets/jsons/translations/zh-tw.json @@ -201,6 +201,34 @@ "changelogs": { "open" : "🚀 探索更新日誌!", "not-founds": "😕 噢,找不到更新日誌!" + }, + "advanced": { + "title": "高级设置", + "description": "BSManager的高级设置。", + "hardware-acceleration": { + "title": "硬體加速", + "description": "啟用硬體加速以使用您的GPU並提高BSManager的性能。如果您遇到幀丟失,請關閉此功能。", + "modal": { + "title": "需要重啟", + "body": "更改硬體加速設置將退出並重新啟動BSManager。您確定要這樣做嗎?", + "confirm-btn": "是的,我確定" + }, + "error-notification": { + "message": "發生錯誤,無法禁用硬體加速。" + } + }, + "use-symlinks": { + "title": "使用符號鏈接", + "description": "使用符號鏈接而不是連接來鏈接文件夾。僅在確實需要時才啟用此功能。", + "modal": { + "title": "符號鏈接權限", + "body": "創建符號鏈接時,BSManager將需要管理員權限或啟用開發者模式。您確定要繼續嗎?", + "confirm-btn": "是的,我確定" + }, + "error-notification": { + "message": "發生錯誤,無法更改符號鏈接設置。" + } + } } } }, diff --git a/assets/jsons/translations/zh.json b/assets/jsons/translations/zh.json index 4acf66d8..b052d4c2 100644 --- a/assets/jsons/translations/zh.json +++ b/assets/jsons/translations/zh.json @@ -201,6 +201,34 @@ "changelogs": { "open" : "🚀 探索更新日志!", "not-founds": "😕 哎呀,找不到更新日志!" + }, + "advanced": { + "title": "高级设置", + "description": "BSManager的高级设置。", + "hardware-acceleration": { + "title": "硬件加速", + "description": "启用硬件加速以使用您的GPU并提高BSManager的性能。如果您遇到帧丢失,请关闭此功能。", + "modal": { + "title": "需要重启", + "body": "更改硬件加速设置将退出并重新启动BSManager。您确定要这样做吗?", + "confirm-btn": "是的,我确定" + }, + "error-notification": { + "message": "发生错误,无法禁用硬件加速。" + } + }, + "use-symlinks": { + "title": "使用符号链接", + "description": "使用符号链接而不是联接来链接文件夹。仅在确实需要时才启用此功能。", + "modal": { + "title": "符号链接权限", + "body": "创建符号链接时,BSManager将需要管理员权限或启用开发者模式。您确定要继续吗?", + "confirm-btn": "是的,我确定" + }, + "error-notification": { + "message": "发生错误,无法更改符号链接设置。" + } + } } } }, diff --git a/src/renderer/components/modal/basic-modal.component.tsx b/src/renderer/components/modal/basic-modal.component.tsx index 9e8c3e3e..0e68ab16 100644 --- a/src/renderer/components/modal/basic-modal.component.tsx +++ b/src/renderer/components/modal/basic-modal.component.tsx @@ -28,10 +28,10 @@ export const BasicModal: ModalComponent +

{t(title)}

- { body &&

{t(body)}

} + { body &&

{t(body)}

}
{buttons.map(button => ( handleClick(button)} withBar={false} text={button.text} /> diff --git a/src/renderer/components/settings/setting-toogle-switch-grid.component.tsx b/src/renderer/components/settings/setting-toogle-switch-grid.component.tsx index acd79d56..f74dd4a6 100644 --- a/src/renderer/components/settings/setting-toogle-switch-grid.component.tsx +++ b/src/renderer/components/settings/setting-toogle-switch-grid.component.tsx @@ -5,7 +5,6 @@ type Item = { desc?: string; checked?: boolean; onChange?: (isChecked: boolean) => void; - middleWare?: (newState: boolean) => boolean|Promise; }; type Props = { @@ -26,7 +25,7 @@ export function SettingToogleSwitchGrid({ items }: Props) {

{item.text}

{item.desc}

- handleItemChange(item, checked)} middleWare={item.middleWare}/> + handleItemChange(item, checked)}/> ))} diff --git a/src/renderer/components/shared/toogle-switch.component.tsx b/src/renderer/components/shared/toogle-switch.component.tsx index 9bd50456..50ca287a 100644 --- a/src/renderer/components/shared/toogle-switch.component.tsx +++ b/src/renderer/components/shared/toogle-switch.component.tsx @@ -1,10 +1,8 @@ -import { useEffect, useMemo, useState } from "react" +import { useMemo } from "react" import { getCorrectTextColor } from "renderer/helpers/correct-text-color"; import { cn } from "renderer/helpers/css-class.helpers"; import { useConstant } from "renderer/hooks/use-constant.hook"; import { useThemeColor } from "renderer/hooks/use-theme-color.hook"; -import { noop } from "shared/helpers/function.helpers"; -import { isPromise } from "shared/helpers/promise.helpers"; type Props = { checked?: boolean; @@ -17,13 +15,11 @@ type Props = { } bgColor?: string; onChange?: (isChecked: boolean) => void; - middleWare?: (newState: boolean) => boolean|Promise; } -export function ToogleSwitch({ checked, className, classNames, bgColor, onChange, middleWare }: Props) { +export function ToogleSwitch({ checked, className, classNames, bgColor, onChange }: Props) { const uuid = useConstant(() => crypto.randomUUID()); - const [isChecked, setIsChecked] = useState(!!checked); const { firstColor } = useThemeColor(); const backgroundColor = useMemo(() => bgColor ?? firstColor, [bgColor, firstColor]); const dotColor = useMemo(() => { @@ -33,47 +29,17 @@ export function ToogleSwitch({ checked, className, classNames, bgColor, onChange return getCorrectTextColor(dotColor) }, [dotColor]); - useEffect(() => { - setIsChecked(checked); - }, [checked]); - const handleCheckboxChange = () => { - if (middleWare) { - setIsChecked(prev => { - const newState = !prev; - const result = middleWare(newState); - if (isPromise(result)) { - result.then(shouldChange => { - if (shouldChange) { - setIsChecked(() => { - onChange?.(newState); - return newState; - }); - } - }).catch(noop); - } else if (result) { - setIsChecked(() => { - onChange?.(newState); - return newState; - }); - } - return prev; - }); - } else { - setIsChecked(prev => { - onChange?.(!prev); - return !prev; - }); - } + onChange?.(!checked); } return (