From 7fafbb316edef39536255648fa2b656f3b1425fb Mon Sep 17 00:00:00 2001
From: silentrald
Date: Sat, 8 Feb 2025 20:44:09 +0800
Subject: [PATCH 1/4] [bugfix] show error when BSManager can't connect to
beatmods
---
assets/jsons/translations/en.json | 1 +
src/main/ipcs/bs-mods-ipcs.ts | 6 +++---
src/main/services/mods/beat-mods-api.service.ts | 11 +++++++++++
src/main/services/mods/bs-mods-manager.service.ts | 8 +++++++-
.../slides/mods/mods-slide.component.tsx | 11 ++++-------
src/shared/models/mods/mod-ipc.model.ts | 1 +
6 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json
index 352d6fb1..65ee205b 100644
--- a/assets/jsons/translations/en.json
+++ b/assets/jsons/translations/en.json
@@ -133,6 +133,7 @@
"mods-not-available": "No mods are available yet for this version of Beat Saber",
"status": {
"no-wineprefix": "Could not find BSManager WINEPREFIX path. Please launch Beat Saber in BSManager first.",
+ "beatmods-down": "Beatmods is currently unreachable. Please retry later. If the issue persists, inform us on Discord/GitHub.",
"unknown": "An unknown error occurred ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/src/main/ipcs/bs-mods-ipcs.ts b/src/main/ipcs/bs-mods-ipcs.ts
index 627d541d..c024037b 100644
--- a/src/main/ipcs/bs-mods-ipcs.ts
+++ b/src/main/ipcs/bs-mods-ipcs.ts
@@ -1,6 +1,6 @@
import { BsModsManagerService } from "../services/mods/bs-mods-manager.service";
import { IpcService } from "../services/ipc.service";
-import { from, of } from "rxjs";
+import { from } from "rxjs";
const ipc = IpcService.getInstance();
@@ -36,6 +36,6 @@ ipc.on("bs-mods.uninstall-all-mods", (args, reply) => {
ipc.on("bs-mods.get-mods-grid-status", (_, reply) => {
const modsManager = BsModsManagerService.getInstance();
- reply(of(modsManager.getModsGridStatus()));
-})
+ reply(from(modsManager.getModsGridStatus()));
+});
diff --git a/src/main/services/mods/beat-mods-api.service.ts b/src/main/services/mods/beat-mods-api.service.ts
index 07ba0d79..c8e4bfd6 100644
--- a/src/main/services/mods/beat-mods-api.service.ts
+++ b/src/main/services/mods/beat-mods-api.service.ts
@@ -26,6 +26,17 @@ export class BeatModsApiService {
this.requestService = RequestService.getInstance();
}
+ public async isUp(): Promise {
+ try {
+ // The data in status can be dropped
+ await this.requestService.getJSON<{}>(`${this.MODS_REPO_API_URL}/status`);
+ return true;
+ } catch (error) {
+ log.error("Could not connect to beatmods", error);
+ return false;
+ }
+ }
+
private getVersionModsUrl(version: BSVersion): string {
const platform: BbmPlatform = version.oculus || version.metadata?.store === BsStore.OCULUS ? BbmPlatform.OculusPC : BbmPlatform.SteamPC;
return `${this.MODS_REPO_API_URL}/mods?status=verified&gameVersion=${version.BSVersion}&gameName=BeatSaber&platform=${platform}`;
diff --git a/src/main/services/mods/bs-mods-manager.service.ts b/src/main/services/mods/bs-mods-manager.service.ts
index 95d66a0d..7d0997f6 100644
--- a/src/main/services/mods/bs-mods-manager.service.ts
+++ b/src/main/services/mods/bs-mods-manager.service.ts
@@ -566,7 +566,7 @@ export class BsModsManagerService {
});
}
- public getModsGridStatus(): ModsGridStatus {
+ public async getModsGridStatus(): Promise {
if (process.platform === "linux") {
const wineprefix = this.linuxService.getWinePrefixPath();
if (!wineprefix) {
@@ -575,6 +575,12 @@ export class BsModsManagerService {
}
}
+ const beatModsUp = await this.beatModsApi.isUp();
+ if (!beatModsUp) {
+ return ModsGridStatus.BEATMODS_DOWN;
+ }
+
+
return ModsGridStatus.OK;
}
}
diff --git a/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx b/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx
index 71a6d5fb..a6afcccd 100644
--- a/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx
+++ b/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx
@@ -9,7 +9,7 @@ import BeatWaitingImg from "../../../../../../assets/images/apngs/beat-waiting.p
import BeatConflictImg from "../../../../../../assets/images/apngs/beat-conflict.png";
import { useObservable } from "renderer/hooks/use-observable.hook";
import { lastValueFrom } from "rxjs";
-import { useTranslation, useTranslationV2 } from "renderer/hooks/use-translation.hook";
+import { useTranslationV2 } from "renderer/hooks/use-translation.hook";
import { LinkOpenerService } from "renderer/services/link-opener.service";
import { ModalExitCode, ModalService } from "renderer/services/modale.service";
import { ModsDisclaimerModal } from "renderer/components/modal/modal-types/mods-disclaimer-modal.component";
@@ -232,10 +232,7 @@ export const ModsSlide = forwardRef(({ version, isActive, o
return onDisclamerDecline?.();
}
- let status = ModsGridStatus.OK;
- if (window.electron.platform === "linux") {
- status = await modsManager.getModsGridStatus();
- }
+ const status = await modsManager.getModsGridStatus();
setGridStatus(status);
loadMods();
@@ -347,12 +344,12 @@ export const ModsSlide = forwardRef(({ version, isActive, o
});
function ModStatus({ text, image, spin = false, children }: { text: string; image: string; spin?: boolean, children?: ReactNode}) {
- const t = useTranslation();
+ const { text: t } = useTranslationV2();
return (

-
{t(text)}
+
{t(text)}
{children}
);
diff --git a/src/shared/models/mods/mod-ipc.model.ts b/src/shared/models/mods/mod-ipc.model.ts
index f97ddd4a..b3ce700d 100644
--- a/src/shared/models/mods/mod-ipc.model.ts
+++ b/src/shared/models/mods/mod-ipc.model.ts
@@ -16,6 +16,7 @@ export interface UninstallModsResult {
export enum ModsGridStatus {
OK = "",
NO_WINEPREFIX = "no-wineprefix",
+ BEATMODS_DOWN = "beatmods-down",
UNKNOWN = "unknown"
}
From b97484ace0962a0ad1e0597458edc4c24a2dd3db Mon Sep 17 00:00:00 2001
From: silentrald
Date: Sat, 8 Feb 2025 20:54:52 +0800
Subject: [PATCH 2/4] [bugfix] added translation for can't connect to beatmods
---
assets/jsons/translations/de.json | 1 +
assets/jsons/translations/es.json | 1 +
assets/jsons/translations/fr.json | 1 +
assets/jsons/translations/it.json | 1 +
assets/jsons/translations/ja.json | 1 +
assets/jsons/translations/ko.json | 1 +
assets/jsons/translations/pt-br.json | 1 +
assets/jsons/translations/ru.json | 1 +
assets/jsons/translations/zh-tw.json | 1 +
assets/jsons/translations/zh.json | 1 +
10 files changed, 10 insertions(+)
diff --git a/assets/jsons/translations/de.json b/assets/jsons/translations/de.json
index 21e6b152..e78e5775 100644
--- a/assets/jsons/translations/de.json
+++ b/assets/jsons/translations/de.json
@@ -133,6 +133,7 @@
"mods-not-available": "Für diese Version von Beat Saber sind noch keine Mods verfügbar.",
"status": {
"no-wineprefix": "Konnte den BSManager WINEPREFIX-Pfad nicht finden. Bitte starte Beat Saber zuerst in BSManager.",
+ "beatmods-down": "Beatmods ist derzeit nicht erreichbar. Bitte versuchen Sie es später noch einmal. Wenn das Problem weiterhin besteht, informieren Sie uns auf Discord/GitHub.",
"unknown": "Ein unbekannter Fehler ist aufgetreten ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/es.json b/assets/jsons/translations/es.json
index 5037f1f1..e72e69c2 100644
--- a/assets/jsons/translations/es.json
+++ b/assets/jsons/translations/es.json
@@ -133,6 +133,7 @@
"mods-not-available": "Aún no hay mods disponibles para esta versión de Beat Saber",
"status": {
"no-wineprefix": "No se pudo encontrar la ruta del WINEPREFIX de BSManager. Por favor, inicia Beat Saber en BSManager primero.",
+ "beatmods-down": "Beatmods no está disponible en este momento. Por favor, inténtalo más tarde. Si el problema persiste, infórmanos en Discord/GitHub.",
"unknown": "Se ha producido un error desconocido ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json
index 740de479..bb100776 100644
--- a/assets/jsons/translations/fr.json
+++ b/assets/jsons/translations/fr.json
@@ -133,6 +133,7 @@
"mods-not-available": "Aucun mod n'est encore disponible pour cette version de Beat Saber",
"status": {
"no-wineprefix": "Impossible de trouver le chemin WINEPREFIX de BSManager. Veuillez d'abord lancer Beat Saber dans BSManager.",
+ "beatmods-down": "Beatmods est actuellement inaccessible. Veuillez réessayer plus tard. Si le problème persiste, informez-nous sur Discord/GitHub.",
"unknown": "Une erreur inconnue s'est produite ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/it.json b/assets/jsons/translations/it.json
index f055732b..e882ec48 100644
--- a/assets/jsons/translations/it.json
+++ b/assets/jsons/translations/it.json
@@ -133,6 +133,7 @@
"mods-not-available": "Nessuna mod è ancora disponibile per questa versione di Beat Saber",
"status": {
"no-wineprefix": "Impossibile trovare il percorso del WINEPREFIX di BSManager. Per favore avvia prima Beat Saber in BSManager.",
+ "beatmods-down": "Beatmods non è attualmente raggiungibile. Riprova più tardi. Se il problema persiste, informaci su Discord/GitHub.",
"unknown": "È accaduto un errore sconosciuto ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/ja.json b/assets/jsons/translations/ja.json
index 923963ba..0b434ad3 100644
--- a/assets/jsons/translations/ja.json
+++ b/assets/jsons/translations/ja.json
@@ -133,6 +133,7 @@
"mods-not-available": "このバージョンで使用できるMODはまだありません。",
"status": {
"no-wineprefix": "BSManager WINEPREFIXのパスが見つかりませんでした。まずBSManagerでBeat Saberを起動してください。",
+ "beatmods-down": "現在、Beatmodsにアクセスできません。後でもう一度お試しください。問題が解決しない場合は、Discord/GitHubでお知らせください。",
"unknown": "不明なエラーが発生しました (´・ω・`)"
},
"buttons": {
diff --git a/assets/jsons/translations/ko.json b/assets/jsons/translations/ko.json
index 1e83a7d1..13269ebe 100644
--- a/assets/jsons/translations/ko.json
+++ b/assets/jsons/translations/ko.json
@@ -133,6 +133,7 @@
"mods-not-available": "이 버전에서 사용할 수 있는 모드가 아직 없습니다.",
"status": {
"no-wineprefix": "BSManager WINEPREFIX 경로를 찾을 수 없습니다. 먼저 BSManager에서 Beat Saber를 실행하세요.",
+ "beatmods-down": "현재 Beatmods에 접근할 수 없습니다. 나중에 다시 시도해 주세요. 문제가 계속되면 Discord/GitHub에서 알려주세요.",
"unknown": "알 수 없는 오류가 발생했습니다 (´・ω・`)"
},
"buttons": {
diff --git a/assets/jsons/translations/pt-br.json b/assets/jsons/translations/pt-br.json
index 7d2f6e2a..9221d604 100644
--- a/assets/jsons/translations/pt-br.json
+++ b/assets/jsons/translations/pt-br.json
@@ -133,6 +133,7 @@
"mods-not-available": "Nenhum mod está disponível para essa versão de Beat Saber ainda",
"status": {
"no-wineprefix": "Não foi possível encontrar o caminho WINEPREFIX do BSManager. Por favor, inicie o Beat Saber no BSManager primeiro.",
+ "beatmods-down": "Beatmods está atualmente inacessível. Tente novamente mais tarde. Se o problema persistir, nos avise no Discord/GitHub.",
"unknown": "Um erro desconhecido aconteceu ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/ru.json b/assets/jsons/translations/ru.json
index a1da3e10..8170706f 100644
--- a/assets/jsons/translations/ru.json
+++ b/assets/jsons/translations/ru.json
@@ -133,6 +133,7 @@
"mods-not-available": "Не найдены моды для этой версии Beat Saber",
"status": {
"no-wineprefix": "Не удалось найти путь WINEPREFIX BSManager. Пожалуйста, сначала запустите Beat Saber в BSManager.",
+ "beatmods-down": "Сейчас Beatmods недоступен. Пожалуйста, попробуйте позже. Если проблема сохраняется, сообщите нам в Discord/GitHub.",
"unknown": "Неизвестная ошибка ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/zh-tw.json b/assets/jsons/translations/zh-tw.json
index 5e2e9ebf..5f7979ea 100644
--- a/assets/jsons/translations/zh-tw.json
+++ b/assets/jsons/translations/zh-tw.json
@@ -133,6 +133,7 @@
"mods-not-available": "該版本 BeatSaber 暫無可用 Mod",
"status": {
"no-wineprefix": "找不到 BSManager WINEPREFIX 路徑。請先在 BSManager 中啟動 Beat Saber。",
+ "beatmods-down": "Beatmods 目前無法訪問。請稍後再試。如果問題持續,請在 Discord/GitHub 上告訴我們。",
"unknown": "發生了一個錯誤 ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/zh.json b/assets/jsons/translations/zh.json
index ecd9a0a9..15067d8c 100644
--- a/assets/jsons/translations/zh.json
+++ b/assets/jsons/translations/zh.json
@@ -133,6 +133,7 @@
"mods-not-available": "该版本 BeatSaber 暂无可用 Mod",
"status": {
"no-wineprefix": "找不到 BSManager WINEPREFIX 路径。请先在 BSManager 中启动 Beat Saber。",
+ "beatmods-down": "Beatmods 目前无法访问。请稍后再试。如果问题持续,请在 Discord/GitHub 上告知我们。",
"unknown": "发生了一个错误 ¯\\_(ツ)_/¯"
},
"buttons": {
From 933b642985e5f37e2b7bba1586ee7ea3c51a1d09 Mon Sep 17 00:00:00 2001
From: silentrald
Date: Sat, 8 Feb 2025 21:47:09 +0800
Subject: [PATCH 3/4] [bugfix] added hyperlinks for can't connect to beatmods
---
assets/jsons/translations/de.json | 2 +-
assets/jsons/translations/en.json | 2 +-
assets/jsons/translations/es.json | 2 +-
assets/jsons/translations/fr.json | 2 +-
assets/jsons/translations/it.json | 2 +-
assets/jsons/translations/ja.json | 2 +-
assets/jsons/translations/ko.json | 2 +-
assets/jsons/translations/pt-br.json | 2 +-
assets/jsons/translations/ru.json | 2 +-
assets/jsons/translations/zh-tw.json | 2 +-
assets/jsons/translations/zh.json | 2 +-
.../link-contents-modal.component.tsx | 3 +-
.../unlink-contents-modal.component.tsx | 3 +-
.../slides/mods/mods-slide.component.tsx | 30 +++++++++++++++++--
.../pages/settings-page.component.tsx | 3 +-
src/shared/constants.ts | 4 +++
16 files changed, 48 insertions(+), 17 deletions(-)
create mode 100644 src/shared/constants.ts
diff --git a/assets/jsons/translations/de.json b/assets/jsons/translations/de.json
index e78e5775..5c5089b2 100644
--- a/assets/jsons/translations/de.json
+++ b/assets/jsons/translations/de.json
@@ -133,7 +133,7 @@
"mods-not-available": "Für diese Version von Beat Saber sind noch keine Mods verfügbar.",
"status": {
"no-wineprefix": "Konnte den BSManager WINEPREFIX-Pfad nicht finden. Bitte starte Beat Saber zuerst in BSManager.",
- "beatmods-down": "Beatmods ist derzeit nicht erreichbar. Bitte versuchen Sie es später noch einmal. Wenn das Problem weiterhin besteht, informieren Sie uns auf Discord/GitHub.",
+ "beatmods-down": "Beatmods ist derzeit nicht erreichbar. Bitte versuchen Sie es später noch einmal. Wenn das Problem weiterhin besteht, informieren Sie uns auf {links}.",
"unknown": "Ein unbekannter Fehler ist aufgetreten ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json
index 65ee205b..5621ed3b 100644
--- a/assets/jsons/translations/en.json
+++ b/assets/jsons/translations/en.json
@@ -133,7 +133,7 @@
"mods-not-available": "No mods are available yet for this version of Beat Saber",
"status": {
"no-wineprefix": "Could not find BSManager WINEPREFIX path. Please launch Beat Saber in BSManager first.",
- "beatmods-down": "Beatmods is currently unreachable. Please retry later. If the issue persists, inform us on Discord/GitHub.",
+ "beatmods-down": "Beatmods is currently unreachable. Please retry later. If the issue persists, inform us on {links}.",
"unknown": "An unknown error occurred ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/es.json b/assets/jsons/translations/es.json
index e72e69c2..c22986f2 100644
--- a/assets/jsons/translations/es.json
+++ b/assets/jsons/translations/es.json
@@ -133,7 +133,7 @@
"mods-not-available": "Aún no hay mods disponibles para esta versión de Beat Saber",
"status": {
"no-wineprefix": "No se pudo encontrar la ruta del WINEPREFIX de BSManager. Por favor, inicia Beat Saber en BSManager primero.",
- "beatmods-down": "Beatmods no está disponible en este momento. Por favor, inténtalo más tarde. Si el problema persiste, infórmanos en Discord/GitHub.",
+ "beatmods-down": "Beatmods no está disponible en este momento. Por favor, inténtalo más tarde. Si el problema persiste, infórmanos en {links}.",
"unknown": "Se ha producido un error desconocido ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json
index bb100776..2ff64ce0 100644
--- a/assets/jsons/translations/fr.json
+++ b/assets/jsons/translations/fr.json
@@ -133,7 +133,7 @@
"mods-not-available": "Aucun mod n'est encore disponible pour cette version de Beat Saber",
"status": {
"no-wineprefix": "Impossible de trouver le chemin WINEPREFIX de BSManager. Veuillez d'abord lancer Beat Saber dans BSManager.",
- "beatmods-down": "Beatmods est actuellement inaccessible. Veuillez réessayer plus tard. Si le problème persiste, informez-nous sur Discord/GitHub.",
+ "beatmods-down": "Beatmods est actuellement inaccessible. Veuillez réessayer plus tard. Si le problème persiste, informez-nous sur {links}.",
"unknown": "Une erreur inconnue s'est produite ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/it.json b/assets/jsons/translations/it.json
index e882ec48..e1b437e1 100644
--- a/assets/jsons/translations/it.json
+++ b/assets/jsons/translations/it.json
@@ -133,7 +133,7 @@
"mods-not-available": "Nessuna mod è ancora disponibile per questa versione di Beat Saber",
"status": {
"no-wineprefix": "Impossibile trovare il percorso del WINEPREFIX di BSManager. Per favore avvia prima Beat Saber in BSManager.",
- "beatmods-down": "Beatmods non è attualmente raggiungibile. Riprova più tardi. Se il problema persiste, informaci su Discord/GitHub.",
+ "beatmods-down": "Beatmods non è attualmente raggiungibile. Riprova più tardi. Se il problema persiste, informaci su {links}.",
"unknown": "È accaduto un errore sconosciuto ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/ja.json b/assets/jsons/translations/ja.json
index 0b434ad3..ae3e4aea 100644
--- a/assets/jsons/translations/ja.json
+++ b/assets/jsons/translations/ja.json
@@ -133,7 +133,7 @@
"mods-not-available": "このバージョンで使用できるMODはまだありません。",
"status": {
"no-wineprefix": "BSManager WINEPREFIXのパスが見つかりませんでした。まずBSManagerでBeat Saberを起動してください。",
- "beatmods-down": "現在、Beatmodsにアクセスできません。後でもう一度お試しください。問題が解決しない場合は、Discord/GitHubでお知らせください。",
+ "beatmods-down": "現在、Beatmodsにアクセスできません。後でもう一度お試しください。問題が解決しない場合は、{links}でお知らせください。",
"unknown": "不明なエラーが発生しました (´・ω・`)"
},
"buttons": {
diff --git a/assets/jsons/translations/ko.json b/assets/jsons/translations/ko.json
index 13269ebe..0fb49f0e 100644
--- a/assets/jsons/translations/ko.json
+++ b/assets/jsons/translations/ko.json
@@ -133,7 +133,7 @@
"mods-not-available": "이 버전에서 사용할 수 있는 모드가 아직 없습니다.",
"status": {
"no-wineprefix": "BSManager WINEPREFIX 경로를 찾을 수 없습니다. 먼저 BSManager에서 Beat Saber를 실행하세요.",
- "beatmods-down": "현재 Beatmods에 접근할 수 없습니다. 나중에 다시 시도해 주세요. 문제가 계속되면 Discord/GitHub에서 알려주세요.",
+ "beatmods-down": "현재 Beatmods에 접근할 수 없습니다. 나중에 다시 시도해 주세요. 문제가 계속되면 {links}에서 알려주세요.",
"unknown": "알 수 없는 오류가 발생했습니다 (´・ω・`)"
},
"buttons": {
diff --git a/assets/jsons/translations/pt-br.json b/assets/jsons/translations/pt-br.json
index 9221d604..72be85fe 100644
--- a/assets/jsons/translations/pt-br.json
+++ b/assets/jsons/translations/pt-br.json
@@ -133,7 +133,7 @@
"mods-not-available": "Nenhum mod está disponível para essa versão de Beat Saber ainda",
"status": {
"no-wineprefix": "Não foi possível encontrar o caminho WINEPREFIX do BSManager. Por favor, inicie o Beat Saber no BSManager primeiro.",
- "beatmods-down": "Beatmods está atualmente inacessível. Tente novamente mais tarde. Se o problema persistir, nos avise no Discord/GitHub.",
+ "beatmods-down": "Beatmods está atualmente inacessível. Tente novamente mais tarde. Se o problema persistir, nos avise no {links}.",
"unknown": "Um erro desconhecido aconteceu ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/ru.json b/assets/jsons/translations/ru.json
index 8170706f..4067733b 100644
--- a/assets/jsons/translations/ru.json
+++ b/assets/jsons/translations/ru.json
@@ -133,7 +133,7 @@
"mods-not-available": "Не найдены моды для этой версии Beat Saber",
"status": {
"no-wineprefix": "Не удалось найти путь WINEPREFIX BSManager. Пожалуйста, сначала запустите Beat Saber в BSManager.",
- "beatmods-down": "Сейчас Beatmods недоступен. Пожалуйста, попробуйте позже. Если проблема сохраняется, сообщите нам в Discord/GitHub.",
+ "beatmods-down": "Сейчас Beatmods недоступен. Пожалуйста, попробуйте позже. Если проблема сохраняется, сообщите нам в {links}.",
"unknown": "Неизвестная ошибка ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/zh-tw.json b/assets/jsons/translations/zh-tw.json
index 5f7979ea..027a8afd 100644
--- a/assets/jsons/translations/zh-tw.json
+++ b/assets/jsons/translations/zh-tw.json
@@ -133,7 +133,7 @@
"mods-not-available": "該版本 BeatSaber 暫無可用 Mod",
"status": {
"no-wineprefix": "找不到 BSManager WINEPREFIX 路徑。請先在 BSManager 中啟動 Beat Saber。",
- "beatmods-down": "Beatmods 目前無法訪問。請稍後再試。如果問題持續,請在 Discord/GitHub 上告訴我們。",
+ "beatmods-down": "Beatmods 目前無法訪問。請稍後再試。如果問題持續,請在 {links} 上告訴我們。",
"unknown": "發生了一個錯誤 ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/zh.json b/assets/jsons/translations/zh.json
index 15067d8c..5bed5c94 100644
--- a/assets/jsons/translations/zh.json
+++ b/assets/jsons/translations/zh.json
@@ -133,7 +133,7 @@
"mods-not-available": "该版本 BeatSaber 暂无可用 Mod",
"status": {
"no-wineprefix": "找不到 BSManager WINEPREFIX 路径。请先在 BSManager 中启动 Beat Saber。",
- "beatmods-down": "Beatmods 目前无法访问。请稍后再试。如果问题持续,请在 Discord/GitHub 上告知我们。",
+ "beatmods-down": "Beatmods 目前无法访问。请稍后再试。如果问题持续,请在 {links} 上告知我们。",
"unknown": "发生了一个错误 ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/src/renderer/components/modal/modal-types/link-contents-modal.component.tsx b/src/renderer/components/modal/modal-types/link-contents-modal.component.tsx
index b0309ba6..71d74d20 100644
--- a/src/renderer/components/modal/modal-types/link-contents-modal.component.tsx
+++ b/src/renderer/components/modal/modal-types/link-contents-modal.component.tsx
@@ -16,6 +16,7 @@ import { MODEL_TYPE_FOLDERS } from "shared/models/models/constants";
import { PlaylistsManagerService } from "renderer/services/playlists-manager.service";
import { MapsManagerService } from "renderer/services/maps-manager.service";
import { map } from "rxjs";
+import { DISCORD_URL } from "shared/constants";
export const LinkContentModal: ModalComponent = ({options: { data: { version, contentType } }, resolver }) => {
const { text: t, element: te } = useTranslationV2();
@@ -97,7 +98,7 @@ export const LinkContentModal: ModalComponent{t("modals.link-contents.warning", {contentType: t(`misc.${contentType}`).toLowerCase()})}
{t("modals.link-contents.what-is-a-symbolic-link")}
- {t("modals.link-contents.i-need-help")}
+ {t("modals.link-contents.i-need-help")}
resolver({ exitCode: ModalExitCode.CANCELED })} withBar={false} text="misc.cancel" />
diff --git a/src/renderer/components/modal/modal-types/unlink-contents-modal.component.tsx b/src/renderer/components/modal/modal-types/unlink-contents-modal.component.tsx
index 21abeacd..13178d6d 100644
--- a/src/renderer/components/modal/modal-types/unlink-contents-modal.component.tsx
+++ b/src/renderer/components/modal/modal-types/unlink-contents-modal.component.tsx
@@ -16,6 +16,7 @@ import { MODEL_TYPE_FOLDERS } from "shared/models/models/constants";
import { useConstant } from "renderer/hooks/use-constant.hook";
import { MapsManagerService } from "renderer/services/maps-manager.service";
import { BsmLink } from "renderer/components/shared/bsm-link.component";
+import { DISCORD_URL } from "shared/constants";
export const UnlinkContentsModal: ModalComponent = ({options: { data: { version, contentType } }, resolver }) => {
const { text: t, element: te } = useTranslationV2();
@@ -86,7 +87,7 @@ export const UnlinkContentsModal: ModalComponent
{t("modals.link-contents.what-is-a-symbolic-link")}
- {t("modals.link-contents.i-need-help")}
+ {t("modals.link-contents.i-need-help")}
diff --git a/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx b/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx
index a6afcccd..72bfd32e 100644
--- a/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx
+++ b/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx
@@ -23,6 +23,8 @@ import Tippy from "@tippyjs/react";
import { ProgressBarService } from "renderer/services/progress-bar.service";
import { Dropzone } from "renderer/components/shared/dropzone.component";
import { ModsGridStatus } from "shared/models/mods/mod-ipc.model";
+import { BsmLink } from "renderer/components/shared/bsm-link.component";
+import { DISCORD_URL, GITHUB_URL } from "shared/constants";
export type ModsSlideRef = {
loadMods: () => Promise
;
@@ -267,12 +269,34 @@ export const ModsSlide = forwardRef(({ version, isActive, o
}
}, [modsAvailable]);
+ const renderStatus = () => {
+ if (gridStatus === ModsGridStatus.BEATMODS_DOWN) {
+ const [ textStart, textEnd ] = t("pages.version-viewer.mods.status.beatmods-down")
+ .split("{links}");
+ return
+
+ {textStart}
+
+ Discord
+
+ /
+
+ GitHub
+
+ {textEnd}
+
+
+ }
+
+ return ;
+ }
+
const renderContent = () => {
if (!isOnline) {
return ;
}
if (gridStatus !== ModsGridStatus.OK) {
- return ;
+ return renderStatus();
}
if (!modsAvailable) {
return ;
@@ -343,13 +367,13 @@ export const ModsSlide = forwardRef(({ version, isActive, o
);
});
-function ModStatus({ text, image, spin = false, children }: { text: string; image: string; spin?: boolean, children?: ReactNode}) {
+function ModStatus({ text, image, spin = false, children }: { text?: string; image: string; spin?: boolean, children?: ReactNode}) {
const { text: t } = useTranslationV2();
return (

-
{t(text)}
+ {text &&
{t(text)}}
{children}
);
diff --git a/src/renderer/pages/settings-page.component.tsx b/src/renderer/pages/settings-page.component.tsx
index 1501162d..7446ce35 100644
--- a/src/renderer/pages/settings-page.component.tsx
+++ b/src/renderer/pages/settings-page.component.tsx
@@ -47,6 +47,7 @@ import { tryit } from "shared/helpers/error.helpers";
import { InstallationLocationService } from "renderer/services/installation-location.service";
import { AutoUpdaterService } from "renderer/services/auto-updater.service";
import { OculusDownloaderService } from "renderer/services/bs-version-download/oculus-downloader.service";
+import { DISCORD_URL } from "shared/constants";
export function SettingsPage() {
@@ -240,7 +241,7 @@ export function SettingsPage() {
const openGithub = () => linkOpener.open("https://github.com/Zagrios/bs-manager");
const openReportBug = () => linkOpener.open("https://github.com/Zagrios/bs-manager/issues/new?assignees=Zagrios&labels=bug&template=-bug--bug-report.md&title=%5BBUG%5D+%3A+");
const openRequestFeatures = () => linkOpener.open("https://github.com/Zagrios/bs-manager/issues/new?assignees=Zagrios&labels=enhancement&template=-feat---feature-request.md&title=%5BFEAT.%5D+%3A+");
- const openDiscord = () => linkOpener.open("https://discord.gg/uSqbHVpKdV");
+ const openDiscord = () => linkOpener.open(DISCORD_URL);
const openTwitter = () => linkOpener.open("https://twitter.com/BSManager_");
const openLogs = () => lastValueFrom(ipcService.sendV2("open-logs"));
diff --git a/src/shared/constants.ts b/src/shared/constants.ts
new file mode 100644
index 00000000..3b897d13
--- /dev/null
+++ b/src/shared/constants.ts
@@ -0,0 +1,4 @@
+
+export const DISCORD_URL = "https://discord.gg/uSqbHVpKdV";
+export const GITHUB_URL = "https://github.com/Zagrios/bs-manager";
+
From 307bd9f2055fc3f10032bd3ea18d2b5cd1cc2cca Mon Sep 17 00:00:00 2001
From: Zagrios <40181755+Zagrios@users.noreply.github.com>
Date: Thu, 13 Feb 2025 16:20:16 +0100
Subject: [PATCH 4/4] Add tl and uk translations
---
assets/jsons/translations/tl.json | 1 +
assets/jsons/translations/uk.json | 1 +
2 files changed, 2 insertions(+)
diff --git a/assets/jsons/translations/tl.json b/assets/jsons/translations/tl.json
index 4a99478f..5fb2f246 100644
--- a/assets/jsons/translations/tl.json
+++ b/assets/jsons/translations/tl.json
@@ -133,6 +133,7 @@
"mods-not-available": "Walang mod na available pa para sa bersyon na ito ng Beat Saber",
"status": {
"no-wineprefix": "Hindi mahanap ang WINEPREFIX path ng BSManager. Pakilunsad muna ang Beat Saber sa BSManager.",
+ "beatmods-down": "Hindi ma-access ang Beatmods sa ngayon. Pakisubukang muli mamaya. Kung magpapatuloy ang problema, ipaalam sa amin sa {links}.",
"unknown": "May naganap na hindi kilalang error ¯\\_(ツ)_/¯"
},
"buttons": {
diff --git a/assets/jsons/translations/uk.json b/assets/jsons/translations/uk.json
index 1c69a75e..c41b3692 100644
--- a/assets/jsons/translations/uk.json
+++ b/assets/jsons/translations/uk.json
@@ -133,6 +133,7 @@
"mods-not-available": "Для цієї версії Beat Saber поки що немає модів",
"status": {
"no-wineprefix": "Не вдалося знайти шлях до WINEPREFIX BSManager. Будь ласка, спочатку запустіть Beat Saber у BSManager.",
+ "beatmods-down": "Beatmods зараз недоступний. Будь ласка, спробуйте пізніше. Якщо проблема не зникне, повідомте нас на {links}.",
"unknown": "Сталася невідома помилка ¯\\_(ツ)_/¯"
},
"buttons": {