Skip to content

Commit

Permalink
[Localization] Fixed the localization of getModeName and "Wave" text (p…
Browse files Browse the repository at this point in the history
…agefaultgames#1953)

* localized getModeName

* wave fix
  • Loading branch information
josericardo-fo authored Jun 8, 2024
1 parent 7cee16c commit 480a256
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/game-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/save-slot-select-ui-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 480a256

Please sign in to comment.