From ed8ef4806847b914239944cdf4d1a14f29ff9dab Mon Sep 17 00:00:00 2001 From: Lugiad <2070109+Adri1@users.noreply.github.com> Date: Mon, 17 Feb 2025 19:17:04 +0100 Subject: [PATCH] [Localization] Move Touch controls Localization (#5349) * Update move-touch-controls-handler.ts localization * Update move-touch-controls-handler.ts --- .../settings/move-touch-controls-handler.ts | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/ui/settings/move-touch-controls-handler.ts b/src/ui/settings/move-touch-controls-handler.ts index 6128f5954e8..da7ac7f0514 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() ?? []; @@ -90,19 +91,22 @@ export default class MoveTouchControlsHandler { const toolbar = document.createElement("div"); toolbar.id = "configToolbar"; toolbar.innerHTML = ` -