diff --git a/frontend/src/locales/bg_BG/play.json b/frontend/src/locales/bg_BG/play.json index 696eb403d..75fe370e0 100644 --- a/frontend/src/locales/bg_BG/play.json +++ b/frontend/src/locales/bg_BG/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom} работи в този контейнер. Първо прекратете тази сесия.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/cs_CZ/play.json b/frontend/src/locales/cs_CZ/play.json index a51e1f780..82c810495 100644 --- a/frontend/src/locales/cs_CZ/play.json +++ b/frontend/src/locales/cs_CZ/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom} běží v tomto kontejneru. Nejprve ukončete tuto relaci.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/de_DE/play.json b/frontend/src/locales/de_DE/play.json index 0cd2ad70b..8a920e5c9 100644 --- a/frontend/src/locales/de_DE/play.json +++ b/frontend/src/locales/de_DE/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom} läuft auf diesem Container. Beende zuerst diese Sitzung.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/en_GB/play.json b/frontend/src/locales/en_GB/play.json index 015cd3cbd..d08727364 100644 --- a/frontend/src/locales/en_GB/play.json +++ b/frontend/src/locales/en_GB/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom} is running on this container. End that session first.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/en_US/play.json b/frontend/src/locales/en_US/play.json index 65efe65cb..15b672c55 100644 --- a/frontend/src/locales/en_US/play.json +++ b/frontend/src/locales/en_US/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom} is running on this container. End that session first.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/es_ES/play.json b/frontend/src/locales/es_ES/play.json index b1c372f57..4e1563970 100644 --- a/frontend/src/locales/es_ES/play.json +++ b/frontend/src/locales/es_ES/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom} se está ejecutando en este contenedor. Finaliza primero esa sesión.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/fr_FR/play.json b/frontend/src/locales/fr_FR/play.json index fe84f5371..3b81161e6 100644 --- a/frontend/src/locales/fr_FR/play.json +++ b/frontend/src/locales/fr_FR/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom} est en cours d'exécution sur ce conteneur. Terminez d'abord cette session.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/hu_HU/play.json b/frontend/src/locales/hu_HU/play.json index 1483bc9d6..ac70db4e8 100644 --- a/frontend/src/locales/hu_HU/play.json +++ b/frontend/src/locales/hu_HU/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "A(z) {rom} fut ezen a konténeren. Előbb fejezd be azt a munkamenetet.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/it_IT/play.json b/frontend/src/locales/it_IT/play.json index b1149f1bb..29322be3b 100644 --- a/frontend/src/locales/it_IT/play.json +++ b/frontend/src/locales/it_IT/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom} è in esecuzione su questo container. Termina prima quella sessione.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/ja_JP/play.json b/frontend/src/locales/ja_JP/play.json index 8595044ac..5ac976981 100644 --- a/frontend/src/locales/ja_JP/play.json +++ b/frontend/src/locales/ja_JP/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom} がこのコンテナで実行中です。先にそのセッションを終了してください。", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/ko_KR/play.json b/frontend/src/locales/ko_KR/play.json index b396e6d40..d5b0294db 100644 --- a/frontend/src/locales/ko_KR/play.json +++ b/frontend/src/locales/ko_KR/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom}이(가) 이 컨테이너에서 실행 중입니다. 먼저 해당 세션을 종료하세요.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/pl_PL/play.json b/frontend/src/locales/pl_PL/play.json index d1b368b27..498e86424 100644 --- a/frontend/src/locales/pl_PL/play.json +++ b/frontend/src/locales/pl_PL/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom} działa w tym kontenerze. Najpierw zakończ tę sesję.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/pt_BR/play.json b/frontend/src/locales/pt_BR/play.json index ac63aebea..6eb3d92ae 100644 --- a/frontend/src/locales/pt_BR/play.json +++ b/frontend/src/locales/pt_BR/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom} está em execução neste contêiner. Encerre essa sessão primeiro.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/ro_RO/play.json b/frontend/src/locales/ro_RO/play.json index 62c4e2dc1..6b22a00dc 100644 --- a/frontend/src/locales/ro_RO/play.json +++ b/frontend/src/locales/ro_RO/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom} rulează pe acest container. Încheie mai întâi acea sesiune.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/ru_RU/play.json b/frontend/src/locales/ru_RU/play.json index 2383a587e..79f35876d 100644 --- a/frontend/src/locales/ru_RU/play.json +++ b/frontend/src/locales/ru_RU/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "В этом контейнере запущена игра {rom}. Сначала завершите этот сеанс.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/tr_TR/play.json b/frontend/src/locales/tr_TR/play.json index 1028183f0..d8cba49a0 100644 --- a/frontend/src/locales/tr_TR/play.json +++ b/frontend/src/locales/tr_TR/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom} bu konteynerde çalışıyor. Önce o oturumu sonlandırın.", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/locales/zh_CN/play.json b/frontend/src/locales/zh_CN/play.json index 6993fd2f2..a6ac8cb79 100644 --- a/frontend/src/locales/zh_CN/play.json +++ b/frontend/src/locales/zh_CN/play.json @@ -25,6 +25,7 @@ "desktop-back": "返回管理后台", "desktop-error-no-container": "未配置该串流容器。", "desktop-error-occupied": "此容器正在使用中。请先结束占用它的会话。", + "desktop-error-occupied-by": "{rom} 正在此容器上运行。请先结束该会话。", "desktop-error-release": "无法释放桌面会话。容器可能仍在使用中。", "desktop-error-server": "无法打开桌面会话。", "desktop-exit": "结束桌面会话", diff --git a/frontend/src/locales/zh_TW/play.json b/frontend/src/locales/zh_TW/play.json index d22aea8f4..08613e0ae 100644 --- a/frontend/src/locales/zh_TW/play.json +++ b/frontend/src/locales/zh_TW/play.json @@ -25,6 +25,7 @@ "desktop-back": "Back to administration", "desktop-error-no-container": "That streaming container is not configured.", "desktop-error-occupied": "This container is already in use. End the session holding it first.", + "desktop-error-occupied-by": "{rom} 正在此容器上執行。請先結束該工作階段。", "desktop-error-release": "The desktop session could not be released. The container may still be in use.", "desktop-error-server": "The desktop session could not be opened.", "desktop-exit": "End desktop session", diff --git a/frontend/src/v2/views/Player/Desktop.test.ts b/frontend/src/v2/views/Player/Desktop.test.ts index 12d88b9e1..cacee43cc 100644 --- a/frontend/src/v2/views/Player/Desktop.test.ts +++ b/frontend/src/v2/views/Player/Desktop.test.ts @@ -15,7 +15,10 @@ const mocks = vi.hoisted(() => ({ })); vi.mock("vue-i18n", () => ({ - useI18n: () => ({ t: (key: string) => key }), + useI18n: () => ({ + t: (key: string, params?: Record) => + params ? `${key}:${Object.values(params).join(",")}` : key, + }), })); vi.mock("vue-router", () => ({ @@ -139,7 +142,7 @@ describe("Desktop session-ended notices", () => { await flushPromises(); expect(vmOf(wrapper).state).toBe("error"); - expect(vmOf(wrapper).errorMessage).toBe("play.session-ended-by"); + expect(vmOf(wrapper).errorMessage).toBe("play.session-ended-by:admin"); }); it("shows the reason the notice gives", async () => { @@ -215,7 +218,7 @@ describe("Desktop heartbeats", () => { window.dispatchEvent(new Event("pagehide")); expect(vmOf(wrapper).state).toBe("error"); - expect(vmOf(wrapper).errorMessage).toBe("play.session-ended-by"); + expect(vmOf(wrapper).errorMessage).toBe("play.session-ended-by:admin"); expect(vmOf(wrapper).endedReason).toBe("Maintenance"); expect(mocks.releaseSessionKeepalive).not.toHaveBeenCalled(); }); @@ -287,6 +290,18 @@ describe("Desktop refused claims", () => { draining: false, }); + expect(vmOf(wrapper).errorMessage).toBe( + "play.desktop-error-occupied-by:Ico", + ); + }); + + it("says the container is in use when the game is not the admin's to see", async () => { + const wrapper = await refuseDesktop({ + rom_name: null, + claimed_at: "2026-09-17T10:00:00", + draining: false, + }); + expect(vmOf(wrapper).errorMessage).toBe("play.desktop-error-occupied"); }); diff --git a/frontend/src/v2/views/Player/Desktop.vue b/frontend/src/v2/views/Player/Desktop.vue index 8549c6422..9609c5606 100644 --- a/frontend/src/v2/views/Player/Desktop.vue +++ b/frontend/src/v2/views/Player/Desktop.vue @@ -69,13 +69,21 @@ async function openDesktop(): Promise { const detail: unknown = isAxiosError(err) ? err.response?.data?.detail : undefined; - if (status === 409) + if (status === 409) { + const busy = detail as { + draining?: boolean; + rom_name?: string | null; + } | null; // A drain marker is nobody's claim: the container comes free on its own // once the previous session has finished saving. - errorMessage.value = (detail as { draining?: boolean } | null)?.draining - ? t("play.stream-occupied-draining") - : t("play.desktop-error-occupied"); - else if (status === 404) + if (busy?.draining) + errorMessage.value = t("play.stream-occupied-draining"); + else if (busy?.rom_name) + errorMessage.value = t("play.desktop-error-occupied-by", { + rom: busy.rom_name, + }); + else errorMessage.value = t("play.desktop-error-occupied"); + } else if (status === 404) errorMessage.value = t("play.desktop-error-no-container"); else errorMessage.value = t("play.desktop-error-server"); }