Added missing menu translations (#355)

* Added missing menu translations

* Added missing translations to other languages

---------

Co-authored-by: Raphael van der Woude <raphael.van.der.woude@dias.nl>
pull/345/head
Raphael van der Woude 2024-04-30 16:53:00 +02:00 committed by GitHub
parent 2402b8e6a0
commit c7bd99b345
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 35 additions and 8 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -73,4 +73,9 @@ export const menu: SimpleTranslationEntries = {
"skipItemQuestion": "Êtes-vous sûr·e de ne pas vouloir prendre dobjet ?",
"eggHatching": "Oh ?",
"ivScannerUseQuestion": "Utiliser le Scanner dIV sur {{pokemonName}} ?",
"rankings": "Rankings",
"dailyRankings": "Daily Rankings",
"noRankings": "No Rankings",
"loading": "Loading…",
"playersOnline": "Players Online"
} as const;

View File

@ -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;

View File

@ -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'));
});
});
}

View File

@ -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')));
});