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", "escapeVerbSwitch": "auswechseln",
"escapeVerbFlee": "flucht", "escapeVerbFlee": "flucht",
"notDisabled": "{{moveName}} ist\nnicht mehr deaktiviert!", "notDisabled": "{{moveName}} ist\nnicht mehr deaktiviert!",
"rankings": "Rankings",
"dailyRankings": "Daily Rankings",
"noRankings": "No Rankings",
"loading": "Loading…",
"playersOnline": "Players Online"
} as const; } as const;

View File

@ -78,4 +78,9 @@ export const menu: SimpleTranslationEntries = {
"skipItemQuestion": "Are you sure you want to skip taking an item?", "skipItemQuestion": "Are you sure you want to skip taking an item?",
"eggHatching": "Oh?", "eggHatching": "Oh?",
"ivScannerUseQuestion": "Use IV Scanner on {{pokemonName}}?", "ivScannerUseQuestion": "Use IV Scanner on {{pokemonName}}?",
"rankings": "Rankings",
"dailyRankings": "Daily Rankings",
"noRankings": "No Rankings",
"loading": "Loading…",
"playersOnline": "Players Online"
} as const; } as const;

View File

@ -61,5 +61,10 @@ export const menu: SimpleTranslationEntries = {
"notDisabled": "¡El movimiento {{moveName}}\nya no está anulado!", "notDisabled": "¡El movimiento {{moveName}}\nya no está anulado!",
"skipItemQuestion": "¿Estás seguro de que no quieres coger un objeto?", "skipItemQuestion": "¿Estás seguro de que no quieres coger un objeto?",
"eggHatching": "¿Y esto?", "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; } as const;

View File

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

View File

@ -6,5 +6,10 @@ export const menu: SimpleTranslationEntries = {
"newGame": "Nuova Partita", "newGame": "Nuova Partita",
"loadGame": "Carica Partita", "loadGame": "Carica Partita",
"dailyRun": "Corsa Giornaliera (Beta)", "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; } as const;

View File

@ -2,6 +2,7 @@ import BattleScene from "../battle-scene";
import { TextStyle, addTextObject } from "./text"; import { TextStyle, addTextObject } from "./text";
import { WindowVariant, addWindow } from "./ui-theme"; import { WindowVariant, addWindow } from "./ui-theme";
import * as Utils from "../utils"; import * as Utils from "../utils";
import i18next from "i18next";
interface RankingEntry { interface RankingEntry {
rank: integer, 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); const titleWindow = addWindow(this.scene, 0, 0, 114, 18, false, false, null, null, WindowVariant.THIN);
this.add(titleWindow); 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.titleLabel.setOrigin(0.5, 0.5);
this.add(this.titleLabel); this.add(this.titleLabel);
@ -141,7 +142,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
update(category: ScoreboardCategory = this.category, page: integer = this.page) { update(category: ScoreboardCategory = this.category, page: integer = this.page) {
this.rankingsContainer.removeAll(true); this.rankingsContainer.removeAll(true);
this.loadingLabel.setText('Loading…'); this.loadingLabel.setText(i18next.t('menu:loading'));
this.loadingLabel.setVisible(true); this.loadingLabel.setVisible(true);
if (category !== this.category) if (category !== this.category)
@ -155,7 +156,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
.then(jsonResponse => { .then(jsonResponse => {
this.page = page; this.page = page;
this.category = category; 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.prevPageButton.setAlpha(page > 1 ? 1 : 0.5);
this.nextPageButton.setAlpha(page < this.pageCount ? 1 : 0.5); this.nextPageButton.setAlpha(page < this.pageCount ? 1 : 0.5);
this.pageNumberLabel.setText(page.toString()); this.pageNumberLabel.setText(page.toString());
@ -163,7 +164,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
this.loadingLabel.setVisible(false); this.loadingLabel.setVisible(false);
this.updateRankings(jsonResponse); this.updateRankings(jsonResponse);
} else } 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 * as Utils from "../utils";
import { TextStyle, addTextObject } from "./text"; import { TextStyle, addTextObject } from "./text";
import { battleCountSplashMessage, splashMessages } from "../data/splash-messages"; import { battleCountSplashMessage, splashMessages } from "../data/splash-messages";
import i18next from "i18next";
export default class TitleUiHandler extends OptionSelectUiHandler { export default class TitleUiHandler extends OptionSelectUiHandler {
private titleContainer: Phaser.GameObjects.Container; private titleContainer: Phaser.GameObjects.Container;
@ -37,7 +38,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
this.titleContainer.add(this.dailyRunScoreboard); 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.playerCountLabel.setOrigin(1, 0);
this.titleContainer.add(this.playerCountLabel); this.titleContainer.add(this.playerCountLabel);
@ -61,7 +62,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
Utils.apiFetch(`game/titlestats`) Utils.apiFetch(`game/titlestats`)
.then(request => request.json()) .then(request => request.json())
.then(stats => { .then(stats => {
this.playerCountLabel.setText(`${stats.playerCount} Players Online`); this.playerCountLabel.setText(`${stats.playerCount} ${i18next.t("menu:playersOnline")}`);
if (this.splashMessage === battleCountSplashMessage) if (this.splashMessage === battleCountSplashMessage)
this.splashMessageText.setText(battleCountSplashMessage.replace('{COUNT}', stats.battleCount.toLocaleString('en-US'))); this.splashMessageText.setText(battleCountSplashMessage.replace('{COUNT}', stats.battleCount.toLocaleString('en-US')));
}); });