From 012a419fde97ff11f383a04d54a037a6e47da076 Mon Sep 17 00:00:00 2001 From: Opaque02 <66582645+Opaque02@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:23:42 +1000 Subject: [PATCH] Updated to include showing the root speciesId if the speciesId locale key doesn't exist --- src/ui/pokemon-info-container.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ui/pokemon-info-container.ts b/src/ui/pokemon-info-container.ts index 316e1a41714..6cc70bd598f 100644 --- a/src/ui/pokemon-info-container.ts +++ b/src/ui/pokemon-info-container.ts @@ -244,7 +244,13 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { formName = i18next.t(`pokemonInfo:Type.${formText?.toUpperCase()}`); } else { const i18key = `pokemonForm:${speciesName}${formText}`; - formName = i18next.exists(i18key) ? i18next.t(i18key) : formText; + if (i18next.exists(i18key)) { + formName = i18next.t(i18key); + } else { + const rootSpeciesName = Utils.capitalizeString(Species[pokemon.species.getRootSpeciesId()], "_", true, false); + const i18RootKey = `pokemonForm:${rootSpeciesName}${formText}`; + formName = i18next.exists(i18RootKey) ? i18next.t(i18RootKey) : formText; + } } if (formName) {