[Localization] Move Touch controls Localization (#5349)

* Update move-touch-controls-handler.ts localization

* Update move-touch-controls-handler.ts
This commit is contained in:
Lugiad 2025-02-17 19:17:04 +01:00 committed by GitHub
parent db22354057
commit ed8ef48068
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 = `
<div class="column">
<div class="button-row">
<div id="resetButton" class="button">Reset</div>
<div id="saveButton" class="button">Save & close</div>
<div id="cancelButton" class="button">Cancel</div>
</div>
<div class="info-row">
<div class="orientation-label">
Orientation: <span id="orientation">${this.isLandscapeMode ? "Landscape" : "Portrait"}</span>
</div>
<div class="column">
<div class="button-row">
<div id="resetButton" class="button">${i18next.t("settings:reset")}</div>
<div id="saveButton" class="button">${i18next.t("settings:saveClose")}</div>
<div id="cancelButton" class="button">${i18next.t("settings:cancel")}</div>
</div>
<div class="info-row">
<div class="orientation-label">
${i18next.t("settings:orientation")}
<span id="orientation">
${this.isLandscapeMode ? i18next.t("settings:landscape") : i18next.t("settings:portrait")}
</span>
</div>
</div>
`;
</div>
`;
return toolbar;
}