From 90ce428b3f04791f79db7f0c5f401a8e006dabbc Mon Sep 17 00:00:00 2001 From: Lugiad <2070109+Adri1@users.noreply.github.com> Date: Sun, 16 Feb 2025 21:06:29 +0100 Subject: [PATCH] Update move-touch-controls-handler.ts localization --- .../settings/move-touch-controls-handler.ts | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/ui/settings/move-touch-controls-handler.ts b/src/ui/settings/move-touch-controls-handler.ts index 6128f5954e8..f11b9a00b99 100644 --- a/src/ui/settings/move-touch-controls-handler.ts +++ b/src/ui/settings/move-touch-controls-handler.ts @@ -1,6 +1,7 @@ import { globalScene } from "#app/global-scene"; import type TouchControl from "#app/touch-controls"; import type UI from "#app/ui/ui"; +import i18next from "i18next"; export const TOUCH_CONTROL_POSITIONS_LANDSCAPE = "touchControlPositionsLandscape"; export const TOUCH_CONTROL_POSITIONS_PORTRAIT = "touchControlPositionsPortrait"; @@ -71,7 +72,7 @@ export default class MoveTouchControlsHandler { if (this.inConfigurationMode) { const orientation = document.querySelector("#touchControls #orientation"); if (orientation) { - orientation.textContent = this.isLandscapeMode ? "Landscape" : "Portrait"; + orientation.textContent = this.isLandscapeMode ? i18next.t("settings:landscape") : i18next.t("settings:portrait"); } } const positions = this.getSavedPositionsOfCurrentOrientation() ?? []; @@ -87,24 +88,27 @@ export default class MoveTouchControlsHandler { * @returns A new div element that contains the toolbar for the configuration mode. */ private createToolbarElement(): HTMLDivElement { - const toolbar = document.createElement("div"); - toolbar.id = "configToolbar"; - toolbar.innerHTML = ` -