diff --git a/src/locales/de/menu.ts b/src/locales/de/menu.ts index d70cd83c50d..4876fa3432a 100644 --- a/src/locales/de/menu.ts +++ b/src/locales/de/menu.ts @@ -59,4 +59,9 @@ export const menu: SimpleTranslationEntries = { "escapeVerbSwitch": "auswechseln", "escapeVerbFlee": "flucht", "notDisabled": "{{moveName}} ist\nnicht mehr deaktiviert!", + "rankings": "Rankings", + "dailyRankings": "Daily Rankings", + "noRankings": "No Rankings", + "loading": "Loading…", + "playersOnline": "Players Online" } as const; \ No newline at end of file diff --git a/src/locales/en/menu.ts b/src/locales/en/menu.ts index bce59c02c11..1d840a3eb03 100644 --- a/src/locales/en/menu.ts +++ b/src/locales/en/menu.ts @@ -78,4 +78,9 @@ export const menu: SimpleTranslationEntries = { "skipItemQuestion": "Are you sure you want to skip taking an item?", "eggHatching": "Oh?", "ivScannerUseQuestion": "Use IV Scanner on {{pokemonName}}?", + "rankings": "Rankings", + "dailyRankings": "Daily Rankings", + "noRankings": "No Rankings", + "loading": "Loading…", + "playersOnline": "Players Online" } as const; \ No newline at end of file diff --git a/src/locales/es/menu.ts b/src/locales/es/menu.ts index dc1c50b3821..e72710cee37 100644 --- a/src/locales/es/menu.ts +++ b/src/locales/es/menu.ts @@ -61,5 +61,10 @@ export const menu: SimpleTranslationEntries = { "notDisabled": "¡El movimiento {{moveName}}\nya no está anulado!", "skipItemQuestion": "¿Estás seguro de que no quieres coger un objeto?", "eggHatching": "¿Y esto?", - "ivScannerUseQuestion": "¿Quieres usar el Escáner de IVs en {{pokemonName}}?" + "ivScannerUseQuestion": "¿Quieres usar el Escáner de IVs en {{pokemonName}}?", + "rankings": "Rankings", + "dailyRankings": "Daily Rankings", + "noRankings": "No Rankings", + "loading": "Loading…", + "playersOnline": "Players Online" } as const; \ No newline at end of file diff --git a/src/locales/fr/menu.ts b/src/locales/fr/menu.ts index 015132bc6c5..911445bcdca 100644 --- a/src/locales/fr/menu.ts +++ b/src/locales/fr/menu.ts @@ -73,4 +73,9 @@ export const menu: SimpleTranslationEntries = { "skipItemQuestion": "Êtes-vous sûr·e de ne pas vouloir prendre d’objet ?", "eggHatching": "Oh ?", "ivScannerUseQuestion": "Utiliser le Scanner d’IV sur {{pokemonName}} ?", + "rankings": "Rankings", + "dailyRankings": "Daily Rankings", + "noRankings": "No Rankings", + "loading": "Loading…", + "playersOnline": "Players Online" } as const; diff --git a/src/locales/it/menu.ts b/src/locales/it/menu.ts index 872315d77c0..b9e288c26ce 100644 --- a/src/locales/it/menu.ts +++ b/src/locales/it/menu.ts @@ -6,5 +6,10 @@ export const menu: SimpleTranslationEntries = { "newGame": "Nuova Partita", "loadGame": "Carica Partita", "dailyRun": "Corsa Giornaliera (Beta)", - "selectGameMode": "Seleziona una modalità di gioco." + "selectGameMode": "Seleziona una modalità di gioco.", + "rankings": "Rankings", + "dailyRankings": "Daily Rankings", + "noRankings": "No Rankings", + "loading": "Loading…", + "playersOnline": "Players Online" } as const; \ No newline at end of file diff --git a/src/ui/daily-run-scoreboard.ts b/src/ui/daily-run-scoreboard.ts index 90fef5ba5e4..1379ec6a8ef 100644 --- a/src/ui/daily-run-scoreboard.ts +++ b/src/ui/daily-run-scoreboard.ts @@ -2,6 +2,7 @@ import BattleScene from "../battle-scene"; import { TextStyle, addTextObject } from "./text"; import { WindowVariant, addWindow } from "./ui-theme"; import * as Utils from "../utils"; +import i18next from "i18next"; interface RankingEntry { rank: integer, @@ -39,7 +40,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container { const titleWindow = addWindow(this.scene, 0, 0, 114, 18, false, false, null, null, WindowVariant.THIN); this.add(titleWindow); - this.titleLabel = addTextObject(this.scene, titleWindow.displayWidth / 2, titleWindow.displayHeight / 2, 'Daily Rankings', TextStyle.WINDOW, { fontSize: '64px' }); + this.titleLabel = addTextObject(this.scene, titleWindow.displayWidth / 2, titleWindow.displayHeight / 2, i18next.t('menu:dailyRankings'), TextStyle.WINDOW, { fontSize: '64px' }); this.titleLabel.setOrigin(0.5, 0.5); this.add(this.titleLabel); @@ -141,7 +142,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container { update(category: ScoreboardCategory = this.category, page: integer = this.page) { this.rankingsContainer.removeAll(true); - this.loadingLabel.setText('Loading…'); + this.loadingLabel.setText(i18next.t('menu:loading')); this.loadingLabel.setVisible(true); if (category !== this.category) @@ -155,7 +156,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container { .then(jsonResponse => { this.page = page; this.category = category; - this.titleLabel.setText(`${Utils.toReadableString(ScoreboardCategory[category])} Rankings`); + this.titleLabel.setText(`${Utils.toReadableString(ScoreboardCategory[category])} ${i18next.t("menu:rankings")}`); this.prevPageButton.setAlpha(page > 1 ? 1 : 0.5); this.nextPageButton.setAlpha(page < this.pageCount ? 1 : 0.5); this.pageNumberLabel.setText(page.toString()); @@ -163,7 +164,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container { this.loadingLabel.setVisible(false); this.updateRankings(jsonResponse); } else - this.loadingLabel.setText('No Rankings'); + this.loadingLabel.setText(i18next.t('menu:noRankings')); }); }); } diff --git a/src/ui/title-ui-handler.ts b/src/ui/title-ui-handler.ts index 6c96e475929..c430764e4da 100644 --- a/src/ui/title-ui-handler.ts +++ b/src/ui/title-ui-handler.ts @@ -5,6 +5,7 @@ import { Mode } from "./ui"; import * as Utils from "../utils"; import { TextStyle, addTextObject } from "./text"; import { battleCountSplashMessage, splashMessages } from "../data/splash-messages"; +import i18next from "i18next"; export default class TitleUiHandler extends OptionSelectUiHandler { private titleContainer: Phaser.GameObjects.Container; @@ -37,7 +38,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler { this.titleContainer.add(this.dailyRunScoreboard); - this.playerCountLabel = addTextObject(this.scene, (this.scene.game.canvas.width / 6) - 2, (this.scene.game.canvas.height / 6) - 90, '? Players Online', TextStyle.MESSAGE, { fontSize: '54px' }); + this.playerCountLabel = addTextObject(this.scene, (this.scene.game.canvas.width / 6) - 2, (this.scene.game.canvas.height / 6) - 90, `? ${i18next.t("menu:playersOnline")}`, TextStyle.MESSAGE, { fontSize: '54px' }); this.playerCountLabel.setOrigin(1, 0); this.titleContainer.add(this.playerCountLabel); @@ -61,7 +62,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler { Utils.apiFetch(`game/titlestats`) .then(request => request.json()) .then(stats => { - this.playerCountLabel.setText(`${stats.playerCount} Players Online`); + this.playerCountLabel.setText(`${stats.playerCount} ${i18next.t("menu:playersOnline")}`); if (this.splashMessage === battleCountSplashMessage) this.splashMessageText.setText(battleCountSplashMessage.replace('{COUNT}', stats.battleCount.toLocaleString('en-US'))); });