From 480a2568a91c19dcb961ebade7d1a51972675861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ricardo=20Fleury=20Oliveira?= Date: Sat, 8 Jun 2024 12:28:45 -0300 Subject: [PATCH] [Localization] Fixed the localization of getModeName and "Wave" text (#1953) * localized getModeName * wave fix --- src/game-mode.ts | 10 +++++----- src/ui/save-slot-select-ui-handler.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/game-mode.ts b/src/game-mode.ts index 5649fef6a7a..cb042b2757c 100644 --- a/src/game-mode.ts +++ b/src/game-mode.ts @@ -285,15 +285,15 @@ export class GameMode implements GameModeConfig { static getModeName(modeId: GameModes): string { switch (modeId) { case GameModes.CLASSIC: - return "Classic"; + return i18next.t("gameMode:classic"); case GameModes.ENDLESS: - return "Endless"; + return i18next.t("gameMode:endless"); case GameModes.SPLICED_ENDLESS: - return "Endless (Spliced)"; + return i18next.t("gameMode:endlessSpliced"); case GameModes.DAILY: - return "Daily Run"; + return i18next.t("gameMode:dailyRun"); case GameModes.CHALLENGE: - return "Challenge"; + return i18next.t("gameMode:challenge"); } } } diff --git a/src/ui/save-slot-select-ui-handler.ts b/src/ui/save-slot-select-ui-handler.ts index 7df76f7ff30..e5417f83596 100644 --- a/src/ui/save-slot-select-ui-handler.ts +++ b/src/ui/save-slot-select-ui-handler.ts @@ -266,7 +266,7 @@ class SessionSlot extends Phaser.GameObjects.Container { async setupWithData(data: SessionSaveData) { this.remove(this.loadingLabel, true); - const gameModeLabel = addTextObject(this.scene, 8, 5, `${GameMode.getModeName(data.gameMode) || i18next.t("gameMode:unkown")} - ${i18next.t("gameMode:wave")} ${data.waveIndex}`, TextStyle.WINDOW); + const gameModeLabel = addTextObject(this.scene, 8, 5, `${GameMode.getModeName(data.gameMode) || i18next.t("gameMode:unkown")} - ${i18next.t("saveSlotSelectUiHandler:wave")} ${data.waveIndex}`, TextStyle.WINDOW); this.add(gameModeLabel); const timestampLabel = addTextObject(this.scene, 8, 19, new Date(data.timestamp).toLocaleString(), TextStyle.WINDOW);