diff --git a/src/data/trainers/trainer-config.ts b/src/data/trainers/trainer-config.ts index 67618df1ddd..123996aa403 100644 --- a/src/data/trainers/trainer-config.ts +++ b/src/data/trainers/trainer-config.ts @@ -43,7 +43,7 @@ import type { } from "#types/trainer-funcs"; import { coerceArray, isNullOrUndefined, randSeedInt, randSeedIntRange, randSeedItem } from "#utils/common"; import { getPokemonSpecies } from "#utils/pokemon-utils"; -import { toSnakeCase, toTitleCase } from "#utils/strings"; +import { toCamelCase, toSnakeCase, toTitleCase } from "#utils/strings"; import i18next from "i18next"; /** Minimum BST for Pokemon generated onto the Elite Four's teams */ @@ -830,9 +830,9 @@ export class TrainerConfig { initI18n(); } // Check if the female version exists in the i18n file - if (i18next.exists(`trainerClasses:${this.name.toLowerCase()}`)) { + if (i18next.exists(`trainerClasses:${toCamelCase(this.name)}Female`)) { // If it does, return - return ret + "_female"; + return ret + "Female"; } } } diff --git a/src/field/trainer.ts b/src/field/trainer.ts index 584c9310932..a35cca46c46 100644 --- a/src/field/trainer.ts +++ b/src/field/trainer.ts @@ -23,7 +23,7 @@ import { } from "#trainers/trainer-party-template"; import { randSeedInt, randSeedItem, randSeedWeightedItem } from "#utils/common"; import { getPokemonSpecies } from "#utils/pokemon-utils"; -import { toSnakeCase } from "#utils/strings"; +import { toCamelCase, toSnakeCase } from "#utils/strings"; import i18next from "i18next"; export class Trainer extends Phaser.GameObjects.Container { @@ -170,7 +170,7 @@ export class Trainer extends Phaser.GameObjects.Container { const evilTeamTitles = ["grunt"]; if (this.name === "" && evilTeamTitles.some(t => name.toLocaleLowerCase().includes(t))) { // This is a evil team grunt so we localize it by only using the "name" as the title - title = i18next.t(`trainerClasses:${toSnakeCase(name)}`); + title = i18next.t(`trainerClasses:${toCamelCase(name)}`); console.log("Localized grunt name: " + title); // Since grunts are not named we can just return the title return title; @@ -187,7 +187,7 @@ export class Trainer extends Phaser.GameObjects.Container { } // Get the localized trainer class name from the i18n file and set it as the title. // This is used for trainer class names, not titles like "Elite Four, Champion, etc." - title = i18next.t(`trainerClasses:${toSnakeCase(name)}`); + title = i18next.t(`trainerClasses:${toCamelCase(name)}`); } // If no specific trainer slot is set.