From d9a8448c6eb898cd55710aced996e12199906024 Mon Sep 17 00:00:00 2001 From: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> Date: Mon, 9 Sep 2024 21:57:07 +0200 Subject: [PATCH] [Enhancement] Added the ability to localize the tera type hover text (#4138) --- src/locales/de/fight-ui-handler.json | 3 ++- src/locales/en/fight-ui-handler.json | 3 ++- src/ui/battle-info.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/locales/de/fight-ui-handler.json b/src/locales/de/fight-ui-handler.json index 6965540c703..f803375e8de 100644 --- a/src/locales/de/fight-ui-handler.json +++ b/src/locales/de/fight-ui-handler.json @@ -3,5 +3,6 @@ "power": "Stärke", "accuracy": "Genauigkeit", "abilityFlyInText": "{{passive}}{{abilityName}} von {{pokemonName}} wirkt!", - "passive": "Passive Fähigkeit " + "passive": "Passive Fähigkeit ", + "teraHover": "Tera-Typ {{type}}" } \ No newline at end of file diff --git a/src/locales/en/fight-ui-handler.json b/src/locales/en/fight-ui-handler.json index 35b7f42772a..1b8bd1f5c71 100644 --- a/src/locales/en/fight-ui-handler.json +++ b/src/locales/en/fight-ui-handler.json @@ -3,5 +3,6 @@ "power": "Power", "accuracy": "Accuracy", "abilityFlyInText": " {{pokemonName}}'s {{passive}}{{abilityName}}", - "passive": "Passive " + "passive": "Passive ", + "teraHover": "{{type}} Terastallized" } \ No newline at end of file diff --git a/src/ui/battle-info.ts b/src/ui/battle-info.ts index 05c634609f8..c7b82dc826e 100644 --- a/src/ui/battle-info.ts +++ b/src/ui/battle-info.ts @@ -323,7 +323,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container { this.teraIcon.setVisible(this.lastTeraType !== Type.UNKNOWN); this.teraIcon.on("pointerover", () => { if (this.lastTeraType !== Type.UNKNOWN) { - (this.scene as BattleScene).ui.showTooltip("", `${Utils.toReadableString(Type[this.lastTeraType])} Terastallized`); + (this.scene as BattleScene).ui.showTooltip("", i18next.t("fightUiHandler:teraHover", {type: i18next.t(`pokemonInfo:Type.${Type[this.lastTeraType]}`) })); } }); this.teraIcon.on("pointerout", () => (this.scene as BattleScene).ui.hideTooltip());