mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-04 17:08:22 +01:00
* mock default overrides in test setup * change beforeEach to beforeALl * move some more enums into the enums directory * replace modules that import i18n into overrides with modules that don't * add pre tests and update vitest configs, scripts * replace tabs with spaces * fix vitest server port overlap warning * add missing overrides and clean up workspace config * change test name * include spec files in main test suite
30 lines
999 B
TypeScript
30 lines
999 B
TypeScript
import { Stat } from "#enums/stat";
|
|
import i18next from "i18next";
|
|
|
|
export { Stat };
|
|
|
|
export function getStatName(stat: Stat, shorten: boolean = false) {
|
|
let ret: string = "";
|
|
switch (stat) {
|
|
case Stat.HP:
|
|
ret = !shorten ? i18next.t("pokemonInfo:Stat.HP") : i18next.t("pokemonInfo:Stat.HPshortened");
|
|
break;
|
|
case Stat.ATK:
|
|
ret = !shorten ? i18next.t("pokemonInfo:Stat.ATK") : i18next.t("pokemonInfo:Stat.ATKshortened");
|
|
break;
|
|
case Stat.DEF:
|
|
ret = !shorten ? i18next.t("pokemonInfo:Stat.DEF") : i18next.t("pokemonInfo:Stat.DEFshortened");
|
|
break;
|
|
case Stat.SPATK:
|
|
ret = !shorten ? i18next.t("pokemonInfo:Stat.SPATK") : i18next.t("pokemonInfo:Stat.SPATKshortened");
|
|
break;
|
|
case Stat.SPDEF:
|
|
ret = !shorten ? i18next.t("pokemonInfo:Stat.SPDEF") : i18next.t("pokemonInfo:Stat.SPDEFshortened");
|
|
break;
|
|
case Stat.SPD:
|
|
ret = !shorten ? i18next.t("pokemonInfo:Stat.SPD") : i18next.t("pokemonInfo:Stat.SPDshortened");
|
|
break;
|
|
}
|
|
return ret;
|
|
}
|