[Refactor] Default case to display challenge name (#4656)

Co-authored-by: frutescens <info@laptop>
This commit is contained in:
Mumble 2024-10-15 07:05:21 -07:00 committed by GitHub
parent 21b71595e0
commit d01d856898
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -587,13 +587,13 @@ export default class RunInfoUiHandler extends UiHandler {
const typeText = typeTextColor + typeShadowColor + i18next.t(`pokemonInfo:Type.${typeRule}`)! + "[/color]" + "[/shadow]";
rules.push(typeText);
break;
case Challenges.FRESH_START:
rules.push(i18next.t("challenges:freshStart.name"));
break;
case Challenges.INVERSE_BATTLE:
//
rules.push(i18next.t("challenges:inverseBattle.shortName"));
break;
default:
const localisationKey = Challenges[this.runInfo.challenges[i].id].split("_").map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join("");
rules.push(i18next.t(`challenges:${localisationKey}.name`));
break;
}
}
}