From b06190c4e73e4c7549ca6963d8851a78702b9653 Mon Sep 17 00:00:00 2001 From: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> Date: Thu, 16 May 2024 11:05:25 +0200 Subject: [PATCH] Issue #745 localized trainer names trainer classes and titles (#752) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Issue #745 - Added the option to localize titles, trainer names (for important trainers like elite 4, champs etc) and trainer classes. - Also i already did the whole localization for german (sorry thats the only language is speak other then english...) - Also renamed the trainer Type "student" to school_kid (because there apparently really is a trainer class called student since the gen 9 dlc) - And i changed it so it makes sure that i18 only gets initalized once (it may be needed to initalize it before the loading phase so the elite 4 titles etc can be localized) * Issue #745 - Removed stuff that wasnt meant for this branch * Translation of French trainers.ts * Translation of French trainers.ts * Translation of French trainers.ts * Fixed spelling on german translation * Fixed name of Hex Maniac * ADded missing "," that were lost in the merge * For Trainer Classes that have a female and male variant the correct name is now choosen. (If a language has both). Also added a safety net that if the female version does not exist it uses the one without the suffix * Reverting override.ts * Added ptBR trainers.ts (thanks to zé ricardo on discord) * Updates Pokefan to reflect the correct english spelling (in all languages that still have the english defaults) * Updated Rich_kid trainer typ to named correctly as "Rich Boy" in english and all non yet localized languages * Added that the title will get made lower case so the rival is correctly set * Reverted a formatting change that i didnt make intentionally --------- Co-authored-by: Lugiad --- src/data/biomes.ts | 4 +- src/data/dialogue.ts | 2 +- src/data/enums/trainer-type.ts | 2 +- src/data/trainer-config.ts | 971 +++++++++++++++++---------------- src/data/trainer-names.ts | 4 +- src/field/trainer.ts | 12 +- src/locales/de/config.ts | 6 +- src/locales/de/trainers.ts | 221 ++++++++ src/locales/en/config.ts | 6 +- src/locales/en/trainers.ts | 219 ++++++++ src/locales/es/config.ts | 6 +- src/locales/es/trainers.ts | 219 ++++++++ src/locales/fr/config.ts | 8 +- src/locales/fr/trainers.ts | 219 ++++++++ src/locales/it/config.ts | 6 +- src/locales/it/trainers.ts | 219 ++++++++ src/locales/pt_BR/trainers.ts | 219 ++++++++ src/locales/zh_CN/config.ts | 7 +- src/locales/zh_CN/trainers.ts | 218 ++++++++ src/plugins/i18n.ts | 17 +- 20 files changed, 2115 insertions(+), 470 deletions(-) create mode 100644 src/locales/de/trainers.ts create mode 100644 src/locales/en/trainers.ts create mode 100644 src/locales/es/trainers.ts create mode 100644 src/locales/fr/trainers.ts create mode 100644 src/locales/it/trainers.ts create mode 100644 src/locales/pt_BR/trainers.ts create mode 100644 src/locales/zh_CN/trainers.ts diff --git a/src/data/biomes.ts b/src/data/biomes.ts index db13158fab3..c4fb750542d 100644 --- a/src/data/biomes.ts +++ b/src/data/biomes.ts @@ -1647,7 +1647,7 @@ export const biomeTrainerPools: BiomeTrainerPools = { [BiomePoolTier.BOSS_ULTRA_RARE]: [] }, [Biome.GRASS]: { - [BiomePoolTier.COMMON]: [ TrainerType.BREEDER, TrainerType.STUDENT ], + [BiomePoolTier.COMMON]: [ TrainerType.BREEDER, TrainerType.SCHOOL_KID ], [BiomePoolTier.UNCOMMON]: [ TrainerType.ACE_TRAINER ], [BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ], [BiomePoolTier.SUPER_RARE]: [], @@ -7270,7 +7270,7 @@ export const biomeTrainerPools: BiomeTrainerPools = { ] ], [ TrainerType.STRIKER, [] ], - [ TrainerType.STUDENT, [ + [ TrainerType.SCHOOL_KID, [ [ Biome.GRASS, BiomePoolTier.COMMON ] ] ], diff --git a/src/data/dialogue.ts b/src/data/dialogue.ts index 830b5f43775..055e5627a52 100644 --- a/src/data/dialogue.ts +++ b/src/data/dialogue.ts @@ -288,7 +288,7 @@ export const trainerTypeDialogue = { ] } ], - [TrainerType.STUDENT]: [ + [TrainerType.SCHOOL_KID]: [ { encounter: [ `…Heehee. I'm confident in my calculations and analysis.`, diff --git a/src/data/enums/trainer-type.ts b/src/data/enums/trainer-type.ts index c30b098960c..c263baae3b7 100644 --- a/src/data/enums/trainer-type.ts +++ b/src/data/enums/trainer-type.ts @@ -43,7 +43,7 @@ export enum TrainerType { SMASHER, SNOW_WORKER, STRIKER, - STUDENT, + SCHOOL_KID, SWIMMER, TWINS, VETERAN, diff --git a/src/data/trainer-config.ts b/src/data/trainer-config.ts index 5284773e4b6..b797c918bd9 100644 --- a/src/data/trainer-config.ts +++ b/src/data/trainer-config.ts @@ -1,161 +1,163 @@ -import BattleScene, { startingWave } from "../battle-scene"; -import { ModifierTypeFunc, modifierTypes } from "../modifier/modifier-type"; -import { EnemyPokemon } from "../field/pokemon"; +import BattleScene, {startingWave} from "../battle-scene"; +import {ModifierTypeFunc, modifierTypes} from "../modifier/modifier-type"; +import {EnemyPokemon} from "../field/pokemon"; import * as Utils from "../utils"; -import { TrainerType } from "./enums/trainer-type"; -import { Moves } from "./enums/moves"; -import { PokeballType } from "./pokeball"; -import { pokemonEvolutions, pokemonPrevolutions } from "./pokemon-evolutions"; -import PokemonSpecies, { PokemonSpeciesFilter, getPokemonSpecies } from "./pokemon-species"; -import { Species } from "./enums/species"; -import { tmSpecies } from "./tms"; -import { Type } from "./type"; -import { initTrainerTypeDialogue } from "./dialogue"; -import { PersistentModifier } from "../modifier/modifier"; -import { TrainerVariant } from "../field/trainer"; -import { PartyMemberStrength } from "./enums/party-member-strength"; +import {TrainerType} from "./enums/trainer-type"; +import {Moves} from "./enums/moves"; +import {PokeballType} from "./pokeball"; +import {pokemonEvolutions, pokemonPrevolutions} from "./pokemon-evolutions"; +import PokemonSpecies, {PokemonSpeciesFilter, getPokemonSpecies} from "./pokemon-species"; +import {Species} from "./enums/species"; +import {tmSpecies} from "./tms"; +import {Type} from "./type"; +import {initTrainerTypeDialogue} from "./dialogue"; +import {PersistentModifier} from "../modifier/modifier"; +import {TrainerVariant} from "../field/trainer"; +import {PartyMemberStrength} from "./enums/party-member-strength"; +import i18next from "i18next"; +import {getIsInitialized, initI18n} from "#app/plugins/i18n"; export enum TrainerPoolTier { - COMMON, - UNCOMMON, - RARE, - SUPER_RARE, - ULTRA_RARE + COMMON, + UNCOMMON, + RARE, + SUPER_RARE, + ULTRA_RARE } export interface TrainerTierPools { - [key: integer]: Species[] + [key: integer]: Species[] } export enum TrainerSlot { - NONE, - TRAINER, - TRAINER_PARTNER + NONE, + TRAINER, + TRAINER_PARTNER } export class TrainerPartyTemplate { - public size: integer; - public strength: PartyMemberStrength; - public sameSpecies: boolean; - public balanced: boolean; + public size: integer; + public strength: PartyMemberStrength; + public sameSpecies: boolean; + public balanced: boolean; - constructor(size: integer, strength: PartyMemberStrength, sameSpecies?: boolean, balanced?: boolean) { - this.size = size; - this.strength = strength; - this.sameSpecies = !!sameSpecies; - this.balanced = !!balanced; - } + constructor(size: integer, strength: PartyMemberStrength, sameSpecies?: boolean, balanced?: boolean) { + this.size = size; + this.strength = strength; + this.sameSpecies = !!sameSpecies; + this.balanced = !!balanced; + } - getStrength(index: integer): PartyMemberStrength { - return this.strength; - } + getStrength(index: integer): PartyMemberStrength { + return this.strength; + } - isSameSpecies(index: integer): boolean { - return this.sameSpecies; - } + isSameSpecies(index: integer): boolean { + return this.sameSpecies; + } - isBalanced(index: integer): boolean { - return this.balanced; - } + isBalanced(index: integer): boolean { + return this.balanced; + } } export class TrainerPartyCompoundTemplate extends TrainerPartyTemplate { - public templates: TrainerPartyTemplate[]; + public templates: TrainerPartyTemplate[]; - constructor(...templates: TrainerPartyTemplate[]) { - super(templates.reduce((total: integer, template: TrainerPartyTemplate) => { - total += template.size; - return total; - }, 0), PartyMemberStrength.AVERAGE); - this.templates = templates; - } - - getStrength(index: integer): PartyMemberStrength { - let t = 0; - for (let template of this.templates) { - if (t + template.size > index) - return template.getStrength(index - t); - t += template.size; + constructor(...templates: TrainerPartyTemplate[]) { + super(templates.reduce((total: integer, template: TrainerPartyTemplate) => { + total += template.size; + return total; + }, 0), PartyMemberStrength.AVERAGE); + this.templates = templates; } - return super.getStrength(index); - } + getStrength(index: integer): PartyMemberStrength { + let t = 0; + for (let template of this.templates) { + if (t + template.size > index) + return template.getStrength(index - t); + t += template.size; + } - isSameSpecies(index: integer): boolean { - let t = 0; - for (let template of this.templates) { - if (t + template.size > index) - return template.isSameSpecies(index - t); - t += template.size; + return super.getStrength(index); } - return super.isSameSpecies(index); - } + isSameSpecies(index: integer): boolean { + let t = 0; + for (let template of this.templates) { + if (t + template.size > index) + return template.isSameSpecies(index - t); + t += template.size; + } - isBalanced(index: integer): boolean { - let t = 0; - for (let template of this.templates) { - if (t + template.size > index) - return template.isBalanced(index - t); - t += template.size; + return super.isSameSpecies(index); } - return super.isBalanced(index); - } + isBalanced(index: integer): boolean { + let t = 0; + for (let template of this.templates) { + if (t + template.size > index) + return template.isBalanced(index - t); + t += template.size; + } + + return super.isBalanced(index); + } } export const trainerPartyTemplates = { - ONE_WEAK_ONE_STRONG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.WEAK), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), - ONE_AVG: new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), - ONE_AVG_ONE_STRONG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), - ONE_STRONG: new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), - ONE_STRONGER: new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER), - TWO_WEAKER: new TrainerPartyTemplate(2, PartyMemberStrength.WEAKER), - TWO_WEAK: new TrainerPartyTemplate(2, PartyMemberStrength.WEAK), - TWO_WEAK_ONE_AVG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.WEAK), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE)), - TWO_WEAK_SAME_ONE_AVG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.WEAK, true), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE)), - TWO_WEAK_SAME_TWO_WEAK_SAME: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.WEAK, true), new TrainerPartyTemplate(2, PartyMemberStrength.WEAK, true)), - TWO_WEAK_ONE_STRONG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.WEAK), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), - TWO_AVG: new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE), - TWO_AVG_ONE_STRONG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), - TWO_AVG_SAME_ONE_AVG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE, true), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE)), - TWO_AVG_SAME_ONE_STRONG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE, true), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), - TWO_AVG_SAME_TWO_AVG_SAME: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE, true), new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE, true)), - TWO_STRONG: new TrainerPartyTemplate(2, PartyMemberStrength.STRONG), - THREE_WEAK: new TrainerPartyTemplate(3, PartyMemberStrength.WEAK), - THREE_WEAK_SAME: new TrainerPartyTemplate(3, PartyMemberStrength.WEAK, true), - THREE_AVG: new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE), - THREE_AVG_SAME: new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE, true), - THREE_WEAK_BALANCED: new TrainerPartyTemplate(3, PartyMemberStrength.WEAK, false, true), - FOUR_WEAKER: new TrainerPartyTemplate(4, PartyMemberStrength.WEAKER), - FOUR_WEAKER_SAME: new TrainerPartyTemplate(4, PartyMemberStrength.WEAKER, true), - FOUR_WEAK: new TrainerPartyTemplate(4, PartyMemberStrength.WEAK), - FOUR_WEAK_SAME: new TrainerPartyTemplate(4, PartyMemberStrength.WEAK, true), - FOUR_WEAK_BALANCED: new TrainerPartyTemplate(4, PartyMemberStrength.WEAK, false, true), - FIVE_WEAKER: new TrainerPartyTemplate(5, PartyMemberStrength.WEAKER), - FIVE_WEAK: new TrainerPartyTemplate(5, PartyMemberStrength.WEAK), - FIVE_WEAK_BALANCED: new TrainerPartyTemplate(5, PartyMemberStrength.WEAK, false, true), - SIX_WEAKER: new TrainerPartyTemplate(6, PartyMemberStrength.WEAKER), - SIX_WEAKER_SAME: new TrainerPartyTemplate(6, PartyMemberStrength.WEAKER, true), - SIX_WEAK_SAME: new TrainerPartyTemplate(6, PartyMemberStrength.WEAKER, true), - SIX_WEAK_BALANCED: new TrainerPartyTemplate(6, PartyMemberStrength.WEAK, false, true), + ONE_WEAK_ONE_STRONG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.WEAK), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), + ONE_AVG: new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), + ONE_AVG_ONE_STRONG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), + ONE_STRONG: new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), + ONE_STRONGER: new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER), + TWO_WEAKER: new TrainerPartyTemplate(2, PartyMemberStrength.WEAKER), + TWO_WEAK: new TrainerPartyTemplate(2, PartyMemberStrength.WEAK), + TWO_WEAK_ONE_AVG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.WEAK), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE)), + TWO_WEAK_SAME_ONE_AVG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.WEAK, true), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE)), + TWO_WEAK_SAME_TWO_WEAK_SAME: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.WEAK, true), new TrainerPartyTemplate(2, PartyMemberStrength.WEAK, true)), + TWO_WEAK_ONE_STRONG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.WEAK), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), + TWO_AVG: new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE), + TWO_AVG_ONE_STRONG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), + TWO_AVG_SAME_ONE_AVG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE, true), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE)), + TWO_AVG_SAME_ONE_STRONG: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE, true), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), + TWO_AVG_SAME_TWO_AVG_SAME: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE, true), new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE, true)), + TWO_STRONG: new TrainerPartyTemplate(2, PartyMemberStrength.STRONG), + THREE_WEAK: new TrainerPartyTemplate(3, PartyMemberStrength.WEAK), + THREE_WEAK_SAME: new TrainerPartyTemplate(3, PartyMemberStrength.WEAK, true), + THREE_AVG: new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE), + THREE_AVG_SAME: new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE, true), + THREE_WEAK_BALANCED: new TrainerPartyTemplate(3, PartyMemberStrength.WEAK, false, true), + FOUR_WEAKER: new TrainerPartyTemplate(4, PartyMemberStrength.WEAKER), + FOUR_WEAKER_SAME: new TrainerPartyTemplate(4, PartyMemberStrength.WEAKER, true), + FOUR_WEAK: new TrainerPartyTemplate(4, PartyMemberStrength.WEAK), + FOUR_WEAK_SAME: new TrainerPartyTemplate(4, PartyMemberStrength.WEAK, true), + FOUR_WEAK_BALANCED: new TrainerPartyTemplate(4, PartyMemberStrength.WEAK, false, true), + FIVE_WEAKER: new TrainerPartyTemplate(5, PartyMemberStrength.WEAKER), + FIVE_WEAK: new TrainerPartyTemplate(5, PartyMemberStrength.WEAK), + FIVE_WEAK_BALANCED: new TrainerPartyTemplate(5, PartyMemberStrength.WEAK, false, true), + SIX_WEAKER: new TrainerPartyTemplate(6, PartyMemberStrength.WEAKER), + SIX_WEAKER_SAME: new TrainerPartyTemplate(6, PartyMemberStrength.WEAKER, true), + SIX_WEAK_SAME: new TrainerPartyTemplate(6, PartyMemberStrength.WEAKER, true), + SIX_WEAK_BALANCED: new TrainerPartyTemplate(6, PartyMemberStrength.WEAK, false, true), - GYM_LEADER_1: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), - GYM_LEADER_2: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER)), - GYM_LEADER_3: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER)), - GYM_LEADER_4: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER)), - GYM_LEADER_5: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(2, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER)), + GYM_LEADER_1: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), + GYM_LEADER_2: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER)), + GYM_LEADER_3: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER)), + GYM_LEADER_4: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER)), + GYM_LEADER_5: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(2, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER)), - ELITE_FOUR: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(3, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER)), + ELITE_FOUR: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(3, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER)), - CHAMPION: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER), new TrainerPartyTemplate(5, PartyMemberStrength.STRONG, false, true)), + CHAMPION: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER), new TrainerPartyTemplate(5, PartyMemberStrength.STRONG, false, true)), - RIVAL: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE)), - RIVAL_2: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.WEAK, false, true)), - RIVAL_3: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE, false, true), new TrainerPartyTemplate(1, PartyMemberStrength.WEAK, false, true)), - RIVAL_4: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE, false, true), new TrainerPartyTemplate(1, PartyMemberStrength.WEAK, false, true)), - RIVAL_5: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE, false, true), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), - RIVAL_6: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE, false, true), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER)) + RIVAL: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE)), + RIVAL_2: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.WEAK, false, true)), + RIVAL_3: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE, false, true), new TrainerPartyTemplate(1, PartyMemberStrength.WEAK, false, true)), + RIVAL_4: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE, false, true), new TrainerPartyTemplate(1, PartyMemberStrength.WEAK, false, true)), + RIVAL_5: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE, false, true), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)), + RIVAL_6: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.STRONG), new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE, false, true), new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER)) }; type PartyTemplateFunc = (scene: BattleScene) => TrainerPartyTemplate; @@ -163,368 +165,425 @@ type PartyMemberFunc = (scene: BattleScene, level: integer, strength: PartyMembe type GenModifiersFunc = (party: EnemyPokemon[]) => PersistentModifier[]; export interface PartyMemberFuncs { - [key: integer]: PartyMemberFunc + [key: integer]: PartyMemberFunc } export class TrainerConfig { - public trainerType: TrainerType; - public name: string; - public nameFemale: string; - public nameDouble: string; - public title: string; - public hasGenders: boolean = false; - public hasDouble: boolean = false; - public hasCharSprite: boolean = false; - public doubleOnly: boolean = false; - public moneyMultiplier: number = 1; - public isBoss: boolean = false; - public hasStaticParty: boolean = false; - public useSameSeedForAllMembers: boolean = false; - public battleBgm: string; - public encounterBgm: string; - public femaleEncounterBgm: string; - public doubleEncounterBgm: string; - public victoryBgm: string; - public genModifiersFunc: GenModifiersFunc; - public modifierRewardFuncs: ModifierTypeFunc[] = []; - public partyTemplates: TrainerPartyTemplate[]; - public partyTemplateFunc: PartyTemplateFunc; - public partyMemberFuncs: PartyMemberFuncs = {}; - public speciesPools: TrainerTierPools; - public speciesFilter: PokemonSpeciesFilter; - public specialtyTypes: Type[] = []; + public trainerType: TrainerType; + public name: string; + public nameFemale: string; + public nameDouble: string; + public title: string; + public hasGenders: boolean = false; + public hasDouble: boolean = false; + public hasCharSprite: boolean = false; + public doubleOnly: boolean = false; + public moneyMultiplier: number = 1; + public isBoss: boolean = false; + public hasStaticParty: boolean = false; + public useSameSeedForAllMembers: boolean = false; + public battleBgm: string; + public encounterBgm: string; + public femaleEncounterBgm: string; + public doubleEncounterBgm: string; + public victoryBgm: string; + public genModifiersFunc: GenModifiersFunc; + public modifierRewardFuncs: ModifierTypeFunc[] = []; + public partyTemplates: TrainerPartyTemplate[]; + public partyTemplateFunc: PartyTemplateFunc; + public partyMemberFuncs: PartyMemberFuncs = {}; + public speciesPools: TrainerTierPools; + public speciesFilter: PokemonSpeciesFilter; + public specialtyTypes: Type[] = []; - public encounterMessages: string[] = []; - public victoryMessages: string[] = []; - public defeatMessages: string[] = []; + public encounterMessages: string[] = []; + public victoryMessages: string[] = []; + public defeatMessages: string[] = []; - public femaleEncounterMessages: string[]; - public femaleVictoryMessages: string[]; - public femaleDefeatMessages: string[]; + public femaleEncounterMessages: string[]; + public femaleVictoryMessages: string[]; + public femaleDefeatMessages: string[]; - public doubleEncounterMessages: string[]; - public doubleVictoryMessages: string[]; - public doubleDefeatMessages: string[]; + public doubleEncounterMessages: string[]; + public doubleVictoryMessages: string[]; + public doubleDefeatMessages: string[]; - constructor(trainerType: TrainerType, allowLegendaries?: boolean) { - this.trainerType = trainerType; - this.name = Utils.toReadableString(TrainerType[this.getDerivedType()]); - this.battleBgm = 'battle_trainer'; - this.victoryBgm = 'victory_trainer'; - this.partyTemplates = [ trainerPartyTemplates.TWO_AVG ]; - this.speciesFilter = species => (allowLegendaries || (!species.legendary && !species.subLegendary && !species.mythical)) && !species.isTrainerForbidden(); - } - - getKey(): string { - return TrainerType[this.getDerivedType()].toString().toLowerCase(); - } - - getSpriteKey(female?: boolean): string { - let ret = this.getKey(); - if (this.hasGenders) - ret += `_${female ? 'f' : 'm'}`; - return ret; - } - - setName(name: string): TrainerConfig { - this.name = name; - return this; - } - - setTitle(title: string): TrainerConfig { - this.title = title; - return this; - } - - getDerivedType(): TrainerType { - let trainerType = this.trainerType; - switch (trainerType) { - case TrainerType.RIVAL_2: - case TrainerType.RIVAL_3: - case TrainerType.RIVAL_4: - case TrainerType.RIVAL_5: - case TrainerType.RIVAL_6: - trainerType = TrainerType.RIVAL; - break; - case TrainerType.LANCE_CHAMPION: - trainerType = TrainerType.LANCE; - break; - case TrainerType.LARRY_ELITE: - trainerType = TrainerType.LARRY; - break; + constructor(trainerType: TrainerType, allowLegendaries?: boolean) { + this.trainerType = trainerType; + this.name = Utils.toReadableString(TrainerType[this.getDerivedType()]); + this.battleBgm = 'battle_trainer'; + this.victoryBgm = 'victory_trainer'; + this.partyTemplates = [trainerPartyTemplates.TWO_AVG]; + this.speciesFilter = species => (allowLegendaries || (!species.legendary && !species.subLegendary && !species.mythical)) && !species.isTrainerForbidden(); } - return trainerType; - } - - setHasGenders(nameFemale?: string, femaleEncounterBgm?: TrainerType | string): TrainerConfig { - this.hasGenders = true; - this.nameFemale = nameFemale; - if (femaleEncounterBgm) - this.femaleEncounterBgm = typeof femaleEncounterBgm === 'number' ? TrainerType[femaleEncounterBgm].toString().replace(/\_/g, ' ').toLowerCase() : femaleEncounterBgm; - return this; - } - - setHasDouble(nameDouble: string, doubleEncounterBgm?: TrainerType | string): TrainerConfig { - this.hasDouble = true; - this.nameDouble = nameDouble; - if (doubleEncounterBgm) - this.doubleEncounterBgm = typeof doubleEncounterBgm === 'number' ? TrainerType[doubleEncounterBgm].toString().replace(/\_/g, ' ').toLowerCase() : doubleEncounterBgm; - return this; - } - - setHasCharSprite(): TrainerConfig { - this.hasCharSprite = true; - return this; - } - - setDoubleOnly(): TrainerConfig { - this.doubleOnly = true; - return this; - } - - setMoneyMultiplier(moneyMultiplier: number): TrainerConfig { - this.moneyMultiplier = moneyMultiplier; - return this; - } - - setBoss(): TrainerConfig { - this.isBoss = true; - return this; - } - - setStaticParty(): TrainerConfig { - this.hasStaticParty = true; - return this; - } - - setUseSameSeedForAllMembers(): TrainerConfig { - this.useSameSeedForAllMembers = true; - return this; - } - - setBattleBgm(battleBgm: string): TrainerConfig { - this.battleBgm = battleBgm; - return this; - } - - setEncounterBgm(encounterBgm: TrainerType | string): TrainerConfig { - this.encounterBgm = typeof encounterBgm === 'number' ? TrainerType[encounterBgm].toString().toLowerCase() : encounterBgm; - return this; - } - - setVictoryBgm(victoryBgm: string): TrainerConfig { - this.victoryBgm = victoryBgm; - return this; - } - - setPartyTemplates(...partyTemplates: TrainerPartyTemplate[]): TrainerConfig { - this.partyTemplates = partyTemplates; - return this; - } - - setPartyTemplateFunc(partyTemplateFunc: PartyTemplateFunc): TrainerConfig { - this.partyTemplateFunc = partyTemplateFunc; - return this; - } - - setPartyMemberFunc(slotIndex: integer, partyMemberFunc: PartyMemberFunc): TrainerConfig { - this.partyMemberFuncs[slotIndex] = partyMemberFunc; - return this; - } - - setSpeciesPools(speciesPools: TrainerTierPools | Species[]): TrainerConfig { - this.speciesPools = (Array.isArray(speciesPools) ? { [TrainerPoolTier.COMMON]: speciesPools } : speciesPools) as unknown as TrainerTierPools; - return this; - } - - setSpeciesFilter(speciesFilter: PokemonSpeciesFilter, allowLegendaries?: boolean): TrainerConfig { - const baseFilter = this.speciesFilter; - this.speciesFilter = allowLegendaries ? speciesFilter : species => speciesFilter(species) && baseFilter(species); - return this; - } - - setSpecialtyTypes(...specialtyTypes: Type[]): TrainerConfig { - this.specialtyTypes = specialtyTypes; - return this; - } - - setGenModifiersFunc(genModifiersFunc: GenModifiersFunc): TrainerConfig { - this.genModifiersFunc = genModifiersFunc; - return this; - } - - setModifierRewardFuncs(...modifierTypeFuncs: (() => ModifierTypeFunc)[]): TrainerConfig { - this.modifierRewardFuncs = modifierTypeFuncs.map(func => () => { - const modifierTypeFunc = func(); - const modifierType = modifierTypeFunc(); - modifierType.withIdFromFunc(modifierTypeFunc); - return modifierType; - }); - return this; - } - - initForGymLeader(signatureSpecies: (Species | Species[])[], ...specialtyTypes: Type[]): TrainerConfig { - this.setPartyTemplateFunc(getGymLeaderPartyTemplate); - signatureSpecies.forEach((speciesPool, s) => { - if (!Array.isArray(speciesPool)) - speciesPool = [ speciesPool ]; - this.setPartyMemberFunc(-(s + 1), getRandomPartyMemberFunc(speciesPool)); - }); - if (specialtyTypes.length) { - this.setSpeciesFilter(p => specialtyTypes.find(t => p.isOfType(t)) !== undefined); - this.setSpecialtyTypes(...specialtyTypes); - } - this.setTitle('Gym Leader'); - this.setMoneyMultiplier(2.5); - this.setBoss(); - this.setStaticParty(); - this.setBattleBgm('battle_unova_gym'); - this.setVictoryBgm('victory_gym'); - this.setGenModifiersFunc(party => { - const waveIndex = party[0].scene.currentBattle.waveIndex; - return getRandomTeraModifiers(party, waveIndex >= 100 ? 1 : 0, specialtyTypes.length ? specialtyTypes : null); - }); - return this; - } - - initForEliteFour(signatureSpecies: (Species | Species[])[], ...specialtyTypes: Type[]): TrainerConfig { - this.setPartyTemplates(trainerPartyTemplates.ELITE_FOUR); - signatureSpecies.forEach((speciesPool, s) => { - if (!Array.isArray(speciesPool)) - speciesPool = [ speciesPool ]; - this.setPartyMemberFunc(-(s + 1), getRandomPartyMemberFunc(speciesPool)); - }); - if (specialtyTypes.length) { - this.setSpeciesFilter(p => specialtyTypes.find(t => p.isOfType(t)) && p.baseTotal >= 450); - this.setSpecialtyTypes(...specialtyTypes); - } else - this.setSpeciesFilter(p => p.baseTotal >= 450); - this.setTitle('Elite Four'); - this.setMoneyMultiplier(3.25); - this.setBoss(); - this.setStaticParty(); - this.setBattleBgm('battle_elite'); - this.setVictoryBgm('victory_gym'); - this.setGenModifiersFunc(party => getRandomTeraModifiers(party, 2, specialtyTypes.length ? specialtyTypes : null)); - return this; - } - - initForChampion(signatureSpecies: (Species | Species[])[]): TrainerConfig { - this.setPartyTemplates(trainerPartyTemplates.CHAMPION); - signatureSpecies.forEach((speciesPool, s) => { - if (!Array.isArray(speciesPool)) - speciesPool = [ speciesPool ]; - this.setPartyMemberFunc(-(s + 1), getRandomPartyMemberFunc(speciesPool)); - }); - this.setSpeciesFilter(p => p.baseTotal >= 470); - this.setTitle('Champion'); - this.setMoneyMultiplier(10); - this.setBoss(); - this.setStaticParty(); - this.setBattleBgm('battle_champion_alder'); - this.setVictoryBgm('victory_champion'); - this.setGenModifiersFunc(party => getRandomTeraModifiers(party, 3)); - return this; - } - - getTitle(trainerSlot: TrainerSlot = TrainerSlot.NONE, variant: TrainerVariant): string { - let ret = this.name; - - if (!trainerSlot && variant === TrainerVariant.DOUBLE && this.nameDouble) - return this.nameDouble; - - if (this.hasGenders) { - if (this.nameFemale) { - if (variant === TrainerVariant.FEMALE || (variant === TrainerVariant.DOUBLE && trainerSlot === TrainerSlot.TRAINER_PARTNER)) - return this.nameFemale; - } else - ret += !variant ? '♂' : '♀'; + getKey(): string { + return TrainerType[this.getDerivedType()].toString().toLowerCase(); } - return ret; - } + getSpriteKey(female?: boolean): string { + let ret = this.getKey(); + if (this.hasGenders) + ret += `_${female ? 'f' : 'm'}`; + return ret; + } + + setName(name: string): TrainerConfig { + if (name === 'Finn' || name === 'Ivy') { + // Give the rival a localized name + // First check if i18n is initialized + if (!getIsInitialized()) { + initI18n(); + } + if (name === 'Finn') { + this.name = i18next.t('trainerNames:rival'); + } + if (name === 'Ivy') { + this.name = i18next.t('trainerNames:rival_female'); + } - loadAssets(scene: BattleScene, variant: TrainerVariant): Promise { - return new Promise(resolve => { - const isDouble = variant === TrainerVariant.DOUBLE; - const trainerKey = this.getSpriteKey(variant === TrainerVariant.FEMALE); - const partnerTrainerKey = this.getSpriteKey(true); - scene.loadAtlas(trainerKey, 'trainer'); - if (isDouble) - scene.loadAtlas(partnerTrainerKey, 'trainer'); - scene.load.once(Phaser.Loader.Events.COMPLETE, () => { - const originalWarn = console.warn; - // Ignore warnings for missing frames, because there will be a lot - console.warn = () => {}; - const frameNames = scene.anims.generateFrameNames(trainerKey, { zeroPad: 4, suffix: ".png", start: 1, end: 128 }); - const partnerFrameNames = isDouble - ? scene.anims.generateFrameNames(partnerTrainerKey, { zeroPad: 4, suffix: ".png", start: 1, end: 128 }) - : null; - console.warn = originalWarn; - scene.anims.create({ - key: trainerKey, - frames: frameNames, - frameRate: 24, - repeat: -1 - }); - if (isDouble) { - scene.anims.create({ - key: partnerTrainerKey, - frames: partnerFrameNames, - frameRate: 24, - repeat: -1 - }); } - resolve(); - }); - if (!scene.load.isLoading()) - scene.load.start(); - }); - } + this.name = name; + return this; + } + + setTitle(title: string): TrainerConfig { + // First check if i18n is initialized + if (!getIsInitialized()) { + initI18n(); + } + + // Make the title lowercase and replace spaces with underscores + title = title.toLowerCase().replace(/\s/g, '_'); + + this.title = i18next.t(`titles:${title}`); + + + return this; + } + + getDerivedType(): TrainerType { + let trainerType = this.trainerType; + switch (trainerType) { + case TrainerType.RIVAL_2: + case TrainerType.RIVAL_3: + case TrainerType.RIVAL_4: + case TrainerType.RIVAL_5: + case TrainerType.RIVAL_6: + trainerType = TrainerType.RIVAL; + break; + case TrainerType.LANCE_CHAMPION: + trainerType = TrainerType.LANCE; + break; + case TrainerType.LARRY_ELITE: + trainerType = TrainerType.LARRY; + break; + } + + return trainerType; + } + + setHasGenders(nameFemale?: string, femaleEncounterBgm?: TrainerType | string): TrainerConfig { + this.hasGenders = true; + this.nameFemale = nameFemale; + if (femaleEncounterBgm) + this.femaleEncounterBgm = typeof femaleEncounterBgm === 'number' ? TrainerType[femaleEncounterBgm].toString().replace(/\_/g, ' ').toLowerCase() : femaleEncounterBgm; + return this; + } + + setHasDouble(nameDouble: string, doubleEncounterBgm?: TrainerType | string): TrainerConfig { + this.hasDouble = true; + this.nameDouble = nameDouble; + if (doubleEncounterBgm) + this.doubleEncounterBgm = typeof doubleEncounterBgm === 'number' ? TrainerType[doubleEncounterBgm].toString().replace(/\_/g, ' ').toLowerCase() : doubleEncounterBgm; + return this; + } + + setHasCharSprite(): TrainerConfig { + this.hasCharSprite = true; + return this; + } + + setDoubleOnly(): TrainerConfig { + this.doubleOnly = true; + return this; + } + + setMoneyMultiplier(moneyMultiplier: number): TrainerConfig { + this.moneyMultiplier = moneyMultiplier; + return this; + } + + setBoss(): TrainerConfig { + this.isBoss = true; + return this; + } + + setStaticParty(): TrainerConfig { + this.hasStaticParty = true; + return this; + } + + setUseSameSeedForAllMembers(): TrainerConfig { + this.useSameSeedForAllMembers = true; + return this; + } + + setBattleBgm(battleBgm: string): TrainerConfig { + this.battleBgm = battleBgm; + return this; + } + + setEncounterBgm(encounterBgm: TrainerType | string): TrainerConfig { + this.encounterBgm = typeof encounterBgm === 'number' ? TrainerType[encounterBgm].toString().toLowerCase() : encounterBgm; + return this; + } + + setVictoryBgm(victoryBgm: string): TrainerConfig { + this.victoryBgm = victoryBgm; + return this; + } + + setPartyTemplates(...partyTemplates: TrainerPartyTemplate[]): TrainerConfig { + this.partyTemplates = partyTemplates; + return this; + } + + setPartyTemplateFunc(partyTemplateFunc: PartyTemplateFunc): TrainerConfig { + this.partyTemplateFunc = partyTemplateFunc; + return this; + } + + setPartyMemberFunc(slotIndex: integer, partyMemberFunc: PartyMemberFunc): TrainerConfig { + this.partyMemberFuncs[slotIndex] = partyMemberFunc; + return this; + } + + setSpeciesPools(speciesPools: TrainerTierPools | Species[]): TrainerConfig { + this.speciesPools = (Array.isArray(speciesPools) ? {[TrainerPoolTier.COMMON]: speciesPools} : speciesPools) as unknown as TrainerTierPools; + return this; + } + + setSpeciesFilter(speciesFilter: PokemonSpeciesFilter, allowLegendaries?: boolean): TrainerConfig { + const baseFilter = this.speciesFilter; + this.speciesFilter = allowLegendaries ? speciesFilter : species => speciesFilter(species) && baseFilter(species); + return this; + } + + setSpecialtyTypes(...specialtyTypes: Type[]): TrainerConfig { + this.specialtyTypes = specialtyTypes; + return this; + } + + setGenModifiersFunc(genModifiersFunc: GenModifiersFunc): TrainerConfig { + this.genModifiersFunc = genModifiersFunc; + return this; + } + + setModifierRewardFuncs(...modifierTypeFuncs: (() => ModifierTypeFunc)[]): TrainerConfig { + this.modifierRewardFuncs = modifierTypeFuncs.map(func => () => { + const modifierTypeFunc = func(); + const modifierType = modifierTypeFunc(); + modifierType.withIdFromFunc(modifierTypeFunc); + return modifierType; + }); + return this; + } + + initForGymLeader(signatureSpecies: (Species | Species[])[], ...specialtyTypes: Type[]): TrainerConfig { + + this.setPartyTemplateFunc(getGymLeaderPartyTemplate); + signatureSpecies.forEach((speciesPool, s) => { + if (!Array.isArray(speciesPool)) + speciesPool = [speciesPool]; + this.setPartyMemberFunc(-(s + 1), getRandomPartyMemberFunc(speciesPool)); + }); + if (specialtyTypes.length) { + this.setSpeciesFilter(p => specialtyTypes.find(t => p.isOfType(t)) !== undefined); + this.setSpecialtyTypes(...specialtyTypes); + } + + // Handle name by checking this.name - making it lowercase and replacing spaces with underscores and then calling i18next.t with the name + const nameForCall = this.name.toLowerCase().replace(/\s/g, '_'); + this.name = i18next.t(`trainerNames:${nameForCall}`); + + + + this.setTitle("gym_leader"); + this.setMoneyMultiplier(2.5); + this.setBoss(); + this.setStaticParty(); + this.setBattleBgm('battle_unova_gym'); + this.setVictoryBgm('victory_gym'); + this.setGenModifiersFunc(party => { + const waveIndex = party[0].scene.currentBattle.waveIndex; + return getRandomTeraModifiers(party, waveIndex >= 100 ? 1 : 0, specialtyTypes.length ? specialtyTypes : null); + }); + return this; + } + + initForEliteFour(signatureSpecies: (Species | Species[])[], ...specialtyTypes: Type[]): TrainerConfig { + + + this.setPartyTemplates(trainerPartyTemplates.ELITE_FOUR); + signatureSpecies.forEach((speciesPool, s) => { + if (!Array.isArray(speciesPool)) + speciesPool = [speciesPool]; + this.setPartyMemberFunc(-(s + 1), getRandomPartyMemberFunc(speciesPool)); + }); + if (specialtyTypes.length) { + this.setSpeciesFilter(p => specialtyTypes.find(t => p.isOfType(t)) && p.baseTotal >= 450); + this.setSpecialtyTypes(...specialtyTypes); + } else + this.setSpeciesFilter(p => p.baseTotal >= 450); + // Handle name by checking this.name - making it lowercase and replacing spaces with underscores and then calling i18next.t with the name + const nameForCall = this.name.toLowerCase().replace(/\s/g, '_'); + this.name = i18next.t(`trainerNames:${nameForCall}`); + + this.setTitle("elite_four"); + this.setMoneyMultiplier(3.25); + this.setBoss(); + this.setStaticParty(); + this.setBattleBgm('battle_elite'); + this.setVictoryBgm('victory_gym'); + this.setGenModifiersFunc(party => getRandomTeraModifiers(party, 2, specialtyTypes.length ? specialtyTypes : null)); + return this; + } + + initForChampion(signatureSpecies: (Species | Species[])[]): TrainerConfig { + + this.setPartyTemplates(trainerPartyTemplates.CHAMPION); + signatureSpecies.forEach((speciesPool, s) => { + if (!Array.isArray(speciesPool)) + speciesPool = [speciesPool]; + this.setPartyMemberFunc(-(s + 1), getRandomPartyMemberFunc(speciesPool)); + }); + this.setSpeciesFilter(p => p.baseTotal >= 470); + // Handle name by checking this.name - making it lowercase and replacing spaces with underscores and then calling i18next.t with the name + const nameForCall = this.name.toLowerCase().replace(/\s/g, '_'); + this.name = i18next.t(`trainerNames:${nameForCall}`); + this.setTitle("champion"); + this.setMoneyMultiplier(10); + this.setBoss(); + this.setStaticParty(); + this.setBattleBgm('battle_champion_alder'); + this.setVictoryBgm('victory_champion'); + this.setGenModifiersFunc(party => getRandomTeraModifiers(party, 3)); + return this; + } + + getTitle(trainerSlot: TrainerSlot = TrainerSlot.NONE, variant: TrainerVariant): string { + let ret = this.name; + + if (!trainerSlot && variant === TrainerVariant.DOUBLE && this.nameDouble) + return this.nameDouble; + + if (this.hasGenders) { + if (this.nameFemale) { + if (variant === TrainerVariant.FEMALE || (variant === TrainerVariant.DOUBLE && trainerSlot === TrainerSlot.TRAINER_PARTNER)) + return this.nameFemale; + } else + + // Check if !variant is true, if so return the name, else return the name with _female appended + if (variant) { + if (!getIsInitialized()) { + initI18n(); + } + // Check if the female version exists in the i18n file + if (i18next.exists(`trainerClasses:${this.name.toLowerCase().replace}`)) { + // If it does, return + return ret + "_female"; + } else { + // If it doesn't, we do not do anything and go to the normal return + // This is to prevent the game from displaying an error if a female version of the trainer does not exist in the localization + } + } + } + + return ret; + } + + loadAssets(scene: BattleScene, variant: TrainerVariant): Promise { + return new Promise(resolve => { + const isDouble = variant === TrainerVariant.DOUBLE; + const trainerKey = this.getSpriteKey(variant === TrainerVariant.FEMALE); + const partnerTrainerKey = this.getSpriteKey(true); + scene.loadAtlas(trainerKey, 'trainer'); + if (isDouble) + scene.loadAtlas(partnerTrainerKey, 'trainer'); + scene.load.once(Phaser.Loader.Events.COMPLETE, () => { + const originalWarn = console.warn; + // Ignore warnings for missing frames, because there will be a lot + console.warn = () => { + }; + const frameNames = scene.anims.generateFrameNames(trainerKey, {zeroPad: 4,suffix: ".png",start: 1,end: 128}); + const partnerFrameNames = isDouble + ? scene.anims.generateFrameNames(partnerTrainerKey, {zeroPad: 4,suffix: ".png",start: 1,end: 128}) + : null; + console.warn = originalWarn; + scene.anims.create({ + key: trainerKey, + frames: frameNames, + frameRate: 24, + repeat: -1 + }); + if (isDouble) { + scene.anims.create({ + key: partnerTrainerKey, + frames: partnerFrameNames, + frameRate: 24, + repeat: -1 + }); + } + resolve(); + }); + if (!scene.load.isLoading()) + scene.load.start(); + }); + } } let t = 0; interface TrainerConfigs { - [key: integer]: TrainerConfig + [key: integer]: TrainerConfig } function getWavePartyTemplate(scene: BattleScene, ...templates: TrainerPartyTemplate[]) { - return templates[Math.min(Math.max(Math.ceil((scene.gameMode.getWaveForDifficulty(scene.currentBattle?.waveIndex || startingWave, true) - 20) / 30), 0), templates.length - 1)]; + return templates[Math.min(Math.max(Math.ceil((scene.gameMode.getWaveForDifficulty(scene.currentBattle?.waveIndex || startingWave, true) - 20) / 30), 0), templates.length - 1)]; } function getGymLeaderPartyTemplate(scene: BattleScene) { - return getWavePartyTemplate(scene, trainerPartyTemplates.GYM_LEADER_1, trainerPartyTemplates.GYM_LEADER_2, trainerPartyTemplates.GYM_LEADER_3, trainerPartyTemplates.GYM_LEADER_4, trainerPartyTemplates.GYM_LEADER_5); + return getWavePartyTemplate(scene, trainerPartyTemplates.GYM_LEADER_1, trainerPartyTemplates.GYM_LEADER_2, trainerPartyTemplates.GYM_LEADER_3, trainerPartyTemplates.GYM_LEADER_4, trainerPartyTemplates.GYM_LEADER_5); } function getRandomPartyMemberFunc(speciesPool: Species[], trainerSlot: TrainerSlot = TrainerSlot.TRAINER, ignoreEvolution: boolean = false, postProcess?: (enemyPokemon: EnemyPokemon) => void): PartyMemberFunc { - return (scene: BattleScene, level: integer, strength: PartyMemberStrength) => { - let species = Utils.randSeedItem(speciesPool); - if (!ignoreEvolution) - species = getPokemonSpecies(species).getTrainerSpeciesForLevel(level, true, strength); - return scene.addEnemyPokemon(getPokemonSpecies(species), level, trainerSlot, undefined, undefined, postProcess); - }; + return (scene: BattleScene, level: integer, strength: PartyMemberStrength) => { + let species = Utils.randSeedItem(speciesPool); + if (!ignoreEvolution) + species = getPokemonSpecies(species).getTrainerSpeciesForLevel(level, true, strength); + return scene.addEnemyPokemon(getPokemonSpecies(species), level, trainerSlot, undefined, undefined, postProcess); + }; } function getSpeciesFilterRandomPartyMemberFunc(speciesFilter: PokemonSpeciesFilter, trainerSlot: TrainerSlot = TrainerSlot.TRAINER, allowLegendaries?: boolean, postProcess?: (EnemyPokemon: EnemyPokemon) => void): PartyMemberFunc { - const originalSpeciesFilter = speciesFilter; - speciesFilter = (species: PokemonSpecies) => (allowLegendaries || (!species.legendary && !species.subLegendary && !species.mythical)) && !species.isTrainerForbidden() && originalSpeciesFilter(species); - return (scene: BattleScene, level: integer, strength: PartyMemberStrength) => { - const ret = scene.addEnemyPokemon(getPokemonSpecies(scene.randomSpecies(scene.currentBattle.waveIndex, level, false, speciesFilter).getTrainerSpeciesForLevel(level, true, strength)), level, trainerSlot, undefined, undefined, postProcess); - return ret; - }; + const originalSpeciesFilter = speciesFilter; + speciesFilter = (species: PokemonSpecies) => (allowLegendaries || (!species.legendary && !species.subLegendary && !species.mythical)) && !species.isTrainerForbidden() && originalSpeciesFilter(species); + return (scene: BattleScene, level: integer, strength: PartyMemberStrength) => { + const ret = scene.addEnemyPokemon(getPokemonSpecies(scene.randomSpecies(scene.currentBattle.waveIndex, level, false, speciesFilter).getTrainerSpeciesForLevel(level, true, strength)), level, trainerSlot, undefined, undefined, postProcess); + return ret; + }; } function getRandomTeraModifiers(party: EnemyPokemon[], count: integer, types?: Type[]): PersistentModifier[] { - const ret: PersistentModifier[] = []; - const partyMemberIndexes = new Array(party.length).fill(null).map((_, i) => i); - for (let t = 0; t < Math.min(count, party.length); t++) { - const randomIndex = Utils.randSeedItem(partyMemberIndexes); - partyMemberIndexes.splice(partyMemberIndexes.indexOf(randomIndex), 1); - ret.push(modifierTypes.TERA_SHARD().generateType(null, [ Utils.randSeedItem(types ? types : party[randomIndex].getTypes()) ]).withIdFromFunc(modifierTypes.TERA_SHARD).newModifier(party[randomIndex]) as PersistentModifier); - } - return ret; + const ret: PersistentModifier[] = []; + const partyMemberIndexes = new Array(party.length).fill(null).map((_, i) => i); + for (let t = 0; t < Math.min(count, party.length); t++) { + const randomIndex = Utils.randSeedItem(partyMemberIndexes); + partyMemberIndexes.splice(partyMemberIndexes.indexOf(randomIndex), 1); + ret.push(modifierTypes.TERA_SHARD().generateType(null, [Utils.randSeedItem(types ? types : party[randomIndex].getTypes())]).withIdFromFunc(modifierTypes.TERA_SHARD).newModifier(party[randomIndex]) as PersistentModifier); + } + return ret; } export const trainerConfigs: TrainerConfigs = { @@ -662,7 +721,7 @@ export const trainerConfigs: TrainerConfigs = { [TrainerType.SMASHER]: new TrainerConfig(++t).setMoneyMultiplier(1.2).setEncounterBgm(TrainerType.CYCLIST), [TrainerType.SNOW_WORKER]: new TrainerConfig(++t).setName('Worker').setHasGenders().setHasDouble('Workers').setMoneyMultiplier(1.7).setEncounterBgm(TrainerType.CLERK).setSpeciesFilter(s => s.isOfType(Type.ICE) || s.isOfType(Type.STEEL)), [TrainerType.STRIKER]: new TrainerConfig(++t).setMoneyMultiplier(1.2).setEncounterBgm(TrainerType.CYCLIST), - [TrainerType.STUDENT]: new TrainerConfig(++t).setMoneyMultiplier(0.75).setEncounterBgm(TrainerType.YOUNGSTER).setHasGenders(undefined, 'lass').setHasDouble('Students') + [TrainerType.SCHOOL_KID]: new TrainerConfig(++t).setMoneyMultiplier(0.75).setEncounterBgm(TrainerType.YOUNGSTER).setHasGenders(undefined, 'lass').setHasDouble('Students') .setSpeciesPools({ [TrainerPoolTier.COMMON]: [ Species.ODDISH, Species.EXEGGCUTE, Species.TEDDIURSA, Species.WURMPLE, Species.RALTS, Species.SHROOMISH, Species.FLETCHLING ], [TrainerPoolTier.UNCOMMON]: [ Species.VOLTORB, Species.WHISMUR, Species.MEDITITE, Species.MIME_JR, Species.NYMBLE ], @@ -880,6 +939,6 @@ export const trainerConfigs: TrainerConfigs = { }), }; -(function() { - initTrainerTypeDialogue(); -})(); \ No newline at end of file +(function () { + initTrainerTypeDialogue(); +})(); diff --git a/src/data/trainer-names.ts b/src/data/trainer-names.ts index 348976eae92..2b95a91314e 100644 --- a/src/data/trainer-names.ts +++ b/src/data/trainer-names.ts @@ -61,7 +61,7 @@ const trainerNameConfigs: TrainerNameConfigs = { [TrainerType.SMASHER]: new TrainerNameConfig(TrainerType.SMASHER), [TrainerType.SNOW_WORKER]: new TrainerNameConfig(TrainerType.SNOW_WORKER, 'Worker'), [TrainerType.STRIKER]: new TrainerNameConfig(TrainerType.STRIKER), - [TrainerType.STUDENT]: new TrainerNameConfig(TrainerType.STUDENT, 'School_Kid'), + [TrainerType.SCHOOL_KID]: new TrainerNameConfig(TrainerType.SCHOOL_KID, 'School_Kid'), [TrainerType.SWIMMER]: new TrainerNameConfig(TrainerType.SWIMMER), [TrainerType.TWINS]: new TrainerNameConfig(TrainerType.TWINS), [TrainerType.VETERAN]: new TrainerNameConfig(TrainerType.VETERAN), @@ -111,7 +111,7 @@ export const trainerNamePools = { [TrainerType.SMASHER]: ["Aspen","Elena","Mari","Amy","Lizzy"], [TrainerType.SNOW_WORKER]: [["Braden","Brendon","Colin","Conrad","Dillan","Gary","Gerardo","Holden","Jackson","Mason","Quentin","Willy","Noel","Arnold","Brady","Brand","Cairn","Cliff","Don","Eddie","Felix","Filipe","Glenn","Gus","Heath","Matthew","Patton","Rich","Rob","Ryan","Scott","Shelby","Sterling","Tyler","Victor","Zack","Friedrich","Herman","Isaac","Leo","Maynard","Mitchell","Morgann","Nathan","Niel","Pasqual","Paul","Tavarius","Tibor","Dimitri","Narek","Yusif","Frank","Jeff","Vaclav","Ovid","Francis","Keith","Russel","Sangon","Toway","Bomber","Chean","Demit","Hubor","Kebile","Laber","Ordo","Retay","Ronix","Wagel","Dobit","Kaster","Lobel","Releo","Saken","Rustix"],["Georgia","Sandra","Yvonne"]], [TrainerType.STRIKER]: ["Marco","Roberto","Tony"], - [TrainerType.STUDENT]: [["Alan","Billy","Chad","Danny","Dudley","Jack","Joe","Johnny","Kipp","Nate","Ricky","Tommy","Jerry","Paul","Ted","Chance","Esteban","Forrest","Harrison","Connor","Sherman","Torin","Travis","Al","Carter","Edgar","Jem","Sammy","Shane","Shayne","Alvin","Keston","Neil","Seymour","William","Carson","Clark","Nolan"],["Georgia","Karen","Meiko","Christine","Mackenzie","Tiera","Ann","Gina","Lydia","Marsha","Millie","Sally","Serena","Silvia","Alberta","Cassie","Mara","Rita","Georgie","Meena","Nitzel"]], + [TrainerType.SCHOOL_KID]: [["Alan","Billy","Chad","Danny","Dudley","Jack","Joe","Johnny","Kipp","Nate","Ricky","Tommy","Jerry","Paul","Ted","Chance","Esteban","Forrest","Harrison","Connor","Sherman","Torin","Travis","Al","Carter","Edgar","Jem","Sammy","Shane","Shayne","Alvin","Keston","Neil","Seymour","William","Carson","Clark","Nolan"],["Georgia","Karen","Meiko","Christine","Mackenzie","Tiera","Ann","Gina","Lydia","Marsha","Millie","Sally","Serena","Silvia","Alberta","Cassie","Mara","Rita","Georgie","Meena","Nitzel"]], [TrainerType.SWIMMER]: [["Berke","Cameron","Charlie","George","Harold","Jerome","Kirk","Mathew","Parker","Randall","Seth","Simon","Tucker","Austin","Barry","Chad","Cody","Darrin","David","Dean","Douglas","Franklin","Gilbert","Herman","Jack","Luis","Matthew","Reed","Richard","Rodney","Roland","Spencer","Stan","Tony","Clarence","Declan","Dominik","Harrison","Kevin","Leonardo","Nolen","Pete","Santiago","Axle","Braden","Finn","Garrett","Mymo","Reece","Samir","Toby","Adrian","Colton","Dillon","Erik","Evan","Francisco","Glenn","Kurt","Oscar","Ricardo","Sam","Sheltin","Troy","Vincent","Wade","Wesley","Duane","Elmo","Esteban","Frankie","Ronald","Tyson","Bart","Matt","Tim","Wright","Jeffery","Kyle","Alessandro","Estaban","Kieran","Ramses","Casey","Dakota","Jared","Kalani","Keoni","Lawrence","Logan","Robert","Roddy","Yasu","Derek","Jacob","Bruce","Clayton"],["Briana","Dawn","Denise","Diana","Elaine","Kara","Kaylee","Lori","Nicole","Nikki","Paula","Susie","Wendy","Alice","Beth","Beverly","Brenda","Dana","Debra","Grace","Jenny","Katie","Laurel","Linda","Missy","Sharon","Tanya","Tara","Tisha","Carlee","Imani","Isabelle","Kyla","Sienna","Abigail","Amara","Anya","Connie","Maria","Melissa","Nora","Shirley","Shania","Tiffany","Aubree","Cassandra","Claire","Crystal","Erica","Gabrielle","Haley","Jessica","Joanna","Lydia","Mallory","Mary","Miranda","Paige","Sophia","Vanessa","Chelan","Debbie","Joy","Kendra","Leona","Mina","Caroline","Joyce","Larissa","Rebecca","Tyra","Dara","Desiree","Kaoru","Ruth","Coral","Genevieve","Isla","Marissa","Romy","Sheryl","Alexandria","Alicia","Chelsea","Jade","Kelsie","Laura","Portia","Shelby","Sara","Tiare","Kyra","Natasha","Layla","Scarlett","Cora"]], [TrainerType.TWINS]: ["Amy & May","Jo & Zoe","Meg & Peg","Ann & Anne","Lea & Pia","Amy & Liv","Gina & Mia","Miu & Yuki","Tori & Tia","Eli & Anne","Jen & Kira","Joy & Meg","Kiri & Jan","Miu & Mia","Emma & Lil","Liv & Liz","Teri & Tia","Amy & Mimi","Clea & Gil","Day & Dani","Kay & Tia","Tori & Til","Saya & Aya","Emy & Lin","Kumi & Amy","Mayo & May","Ally & Amy","Lia & Lily","Rae & Ula","Sola & Ana","Tara & Val","Faith & Joy","Nana & Nina"], [TrainerType.VETERAN]: [["Armando","Brenden","Brian","Clayton","Edgar","Emanuel","Grant","Harlan","Terrell","Arlen","Chester","Hugo","Martell","Ray","Shaun","Abraham","Carter","Claude","Jerry","Lucius","Murphy","Rayne","Ron","Sinan","Sterling","Vincent","Zach","Gerard","Gilles","Louis","Timeo","Akira","Don","Eric","Harry","Leon","Roger","Angus","Aristo","Brone","Johnny"],["Julia","Karla","Kim","Sayuri","Tiffany","Cathy","Cecile","Chloris","Denae","Gina","Maya","Oriana","Portia","Rhona","Rosaline","Catrina","Inga","Trisha","Heather","Lynn","Sheri","Alonsa","Ella","Leticia","Kiara"]], diff --git a/src/field/trainer.ts b/src/field/trainer.ts index 4a7458652c4..9213dc0135d 100644 --- a/src/field/trainer.ts +++ b/src/field/trainer.ts @@ -10,6 +10,8 @@ import { PersistentModifier } from "../modifier/modifier"; import { trainerNamePools } from "../data/trainer-names"; import { ArenaTagType } from "#app/data/enums/arena-tag-type"; import { ArenaTag, ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag"; +import {getIsInitialized, initI18n} from "#app/plugins/i18n"; +import i18next from "i18next"; export enum TrainerVariant { DEFAULT, @@ -97,9 +99,16 @@ export default class Trainer extends Phaser.GameObjects.Container { getName(trainerSlot: TrainerSlot = TrainerSlot.NONE, includeTitle: boolean = false): string { let name = this.config.getTitle(trainerSlot, this.variant); let title = includeTitle && this.config.title ? this.config.title : null; + + if (this.name) { if (includeTitle) - title = name; + + // Check if i18n is initialized + if (!getIsInitialized()) { + initI18n() + } + title = i18next.t(`trainerClasses:${name.toLowerCase().replace(/\s/g, '_')}`); if (!trainerSlot) { name = this.name; if (this.partnerName) @@ -107,6 +116,7 @@ export default class Trainer extends Phaser.GameObjects.Container { } else name = trainerSlot === TrainerSlot.TRAINER ? this.name : this.partnerName || this.name; } + return title ? `${title} ${name}` : name; } diff --git a/src/locales/de/config.ts b/src/locales/de/config.ts index 72200a5141c..c9a58bca1ea 100644 --- a/src/locales/de/config.ts +++ b/src/locales/de/config.ts @@ -15,6 +15,7 @@ import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { tutorial } from "./tutorial"; +import { titles,trainerClasses,trainerNames } from "./trainers"; import { splashMessages } from "./splash-messages" @@ -32,9 +33,12 @@ export const deConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, + titles: titles, + trainerClasses: trainerClasses, + trainerNames: trainerNames, tutorial: tutorial, splashMessages: splashMessages, nature: nature, growth: growth, modifierType: modifierType, -} \ No newline at end of file +} diff --git a/src/locales/de/trainers.ts b/src/locales/de/trainers.ts new file mode 100644 index 00000000000..b2a74a8e92f --- /dev/null +++ b/src/locales/de/trainers.ts @@ -0,0 +1,221 @@ +import {SimpleTranslationEntries} from "#app/plugins/i18n"; + +// Titles of special trainers like gym leaders, elite four, and the champion +export const titles: SimpleTranslationEntries = { + "elite_four": "Top Vier", + "gym_leader": "Arenaleiter", + "gym_leader_female": "Arenaleiterin", + "champion": "Champion", + "rival": "Rivale", + "professor": "Professor", + "frontier_brain": "Kampfkoryphäen", + // Maybe if we add the evil teams we can add "Team Rocket" and "Team Aqua" etc. here as well as "Team Rocket Boss" and "Team Aqua Admin" etc. +} as const; + +// Titles of trainers like "Youngster" or "Lass" +export const trainerClasses: SimpleTranslationEntries = { + "ace_trainer": "Ass-Trainer", + "ace_trainer_female": "Ass-Trainerin", + "artist": "Künstler", + "artist_female": "Künstlerin", + "backers": "Anhänger", + "backpacker": "Backpacker", + "backpacker_female": "Backpackerin", + "baker": "Bäckerin", + "battle_girl": "Kämpferin", + "beauty": "Schönheit", + "biker": "Rowdy", + "black_belt": "Schwarzgurt", + "breeder": "Pokémon Züchter", + "breeder_female": "Pokémon Züchterin", + "clerk": "Angestellter", + "clerk_female": "Angestellte", + "cyclist": "Biker", + "cyclist_female": "Bikerin", + "dancer": "Tänzer", + "dancer_female": "Tänzerin", + "depot_agent": "Bahnangestellter", + "doctor": "Arzt", + "doctor_female": "Ärztin", + "fishermen": "Angler", + "fishermen_female": "Angler", // Seems to be the same in german but exists in other languages like italian + "guitarist": "Gitarrist", + "guitarist_female": "Gitarristin", + "harlequin": "Kasper", + "hiker": "Wanderer", + "hooligans": "Rabauken", + "hoopster": "Basketballer", + "infielder": "Baseballer", + "janitor": "Hausmeister", + "lady": "Lady", + "lass": "Göre", + "linebacker": "Footballer", + "maid": "Zofe", + "madame": "Madam", + "musican": "Musiker", + "hex_maniac": "Hexe", + "nurse": "Pflegerin", + "nursery_aide": "Erzieherin", + "officer": "Polizist", + "parasol_lady": "Schirmdame", + "pilot": "Pilot", + "pokefan": "Pokéfan", + "preschooler": "Vorschüler", + "preschooler_female": "Vorschülerin", + "psychic": "Seher", + "psychic_female": "Seherin", + "ranger": "Ranger", + "rich": "Gentleman", // Gentleman is the english name but the trainerType is rich + "rich_kid": "Schnösel", + "roughneck": "Raufbold", + "scientist": "Forscher", + "scientist_female": "Forscherin", + "smasher": "Tennis-Ass", + "snow_worker": "Schneearbeiter", // There is a trainer type for this but no actual trainer class? They seem to be just workers but dressed differently + "snow_worker_female": "Schneearbeiterin", + "striker": "Fußballer", + "school_kid": "Schulkind", + "school_kid_female": "Schulkind", // Same in german but different in italian + "swimmer": "Schwimmer", + "swimmer_female": "Schwimmerin", + "twins": "Zwillinge", + "veteran": "Veteran", + "veteran_female": "Veteran", // same in german, different in other languages + "waiter": "Servierer", + "waitress": "Serviererin", + "worker": "Arbeiter", + "worker_female": "Arbeiterin", + "youngster": "Knirps" + + +} as const; + +// Names of special trainers like gym leaders, elite four, and the champion +export const trainerNames: SimpleTranslationEntries = { + "brock": "Rocko", + "misty": "Misty", + "lt_surge": "Major Bob", + "erika": "Erika", + "janine": "Janina", + "sabrina": "Sabrina", + "blaine": "Pyro", + "giovanni": "Giovanni", + "falkner": "Falk", + "bugsy": "Kai", + "whitney": "Bianka", + "morty": "Jens", + "chuck": "Hartwig", + "jasmine": "Jasmin", + "pryce": "Norbert", + "clair": "Sandra", + "roxanne": "Felizia", + "brawly": "Kamillo", + "wattson": "Walter", + "flannery": "Flavia", + "norman": "Norman", + "winona": "Wibke", + "tate": "Ben", + "liza": "Svenja", + "juan": "Juan", + "roark": "Veit", + "gardenia": "Silvana", + "maylene": "Hilda", + "crasher_wake": "Wellenbrecher Marinus", + "fantina": "Lamina", + "byron": "Adam", + "candice": "Frida", + "volkner": "Volkner", + "cilan": "Benny", + "chili": "Maik", + "cress": "Colin", + "cheren": "Cheren", + "lenora": "Aloe", + "roxie": "Mica", + "burgh": "Artie", + "elesa": "Kamilla", + "clay": "Turner", + "skyla": "Géraldine", + "brycen": "Sandro", + "drayden": "Lysander", + "marlon": "Benson", + "viola": "Viola", + "grant": "Lino", + "korrina": "Connie", + "ramos": "Amaro", + "clemont": "Citro", + "valerie": "Valerie", + "olympia": "Astrid", + "wulfric": "Galantho", + "milo": "Yarro", + "nessa": "Kate", + "kabu": "Kabu", + "bea": "Saida", + "allister": "Nio", + "opal": "Papella", + "bede": "Betys", + "gordie": "Mac", + "melony": "Mel", + "piers": "Nezz", + "marnie": "Mary", + "raihan": "Roy", + "katy": "Ronah", + "brassius": "Colzo", + "iono": "Enigmara", + "kofu": "Kombu", + "larry": "Aoki", + "ryme": "Etta", + "tulip": "Tulia", + "grusha": "Grusha", + "lorelei": "Lorelei", + "bruno": "Bruno", + "agatha": "Agathe", + "lance": "Siegfried", + "will": "Willi", + "koga": "Koga", + "karen": "Melanie", + "sidney": "Ulrich", + "phoebe": "Antonia", + "glacia": "Frosina", + "drake": "Dragan", + "aaron": "Herbaro", + "bertha": "Teresa", + "flint": "Ignaz", + "lucian": "Lucian", + "shauntal": "Anissa", + "marshal": "Eugen", + "grimsley": "Astor", + "caitlin": "Kattlea", + "malva": "Pachira", + "siebold": "Narcisse", + "wikstrom": "Thymelot", + "drasna": "Dracena", + "hala": "Hala", + "molayne": "Marlon", + "olivia": "Mayla", + "acerola": "Lola", + "kahili": "Kahili", + "rika": "Cay", + "poppy": "Poppy", + "larry_elite": "Aoki", // Does this really need to be an extra entry? (it is in trainer-type.ts so I added it here) + "hassel": "Sinius", + "crispin": "Matt", + "amarys": "Erin", + "lacey": "Tara", + "drayton": "Levy", + "blue": "Blau", + "red": "Rot", + "lance_champion": "Siegfried", // Does this really need to be an extra entry? (it is in trainer-type.ts so I added it here) + "steven": "Troy", + "wallace": "Wassili", + "cynthia": "Cynthia", + "alder": "Lauro", + "iris": "Lilia", + "diantha": "Diantha", + "hau": "Tali", + "geeta": "Sagaria", + "nemona": "Nemila", + "kieran": "Jo", + "leon": "Delion", + "rival": "Finn", + "rival_female": "Ivy", +} as const; \ No newline at end of file diff --git a/src/locales/en/config.ts b/src/locales/en/config.ts index 295c3ff5c33..a5d207da932 100644 --- a/src/locales/en/config.ts +++ b/src/locales/en/config.ts @@ -15,6 +15,7 @@ import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { tutorial } from "./tutorial"; +import { titles,trainerClasses,trainerNames } from "./trainers"; import { splashMessages } from "./splash-messages" import { weather } from "./weather"; @@ -33,10 +34,13 @@ export const enConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, + titles: titles, + trainerClasses: trainerClasses, + trainerNames: trainerNames, tutorial: tutorial, splashMessages: splashMessages, nature: nature, growth: growth, weather: weather, modifierType: modifierType, -} \ No newline at end of file +} diff --git a/src/locales/en/trainers.ts b/src/locales/en/trainers.ts new file mode 100644 index 00000000000..a63b06242f9 --- /dev/null +++ b/src/locales/en/trainers.ts @@ -0,0 +1,219 @@ +import {SimpleTranslationEntries} from "#app/plugins/i18n"; + +// Titles of special trainers like gym leaders, elite four, and the champion +export const titles: SimpleTranslationEntries = { + "elite_four": "Elite Four", + "gym_leader": "Gym Leader", + "gym_leader_female": "Gym Leader", + "champion": "Champion", + "rival": "Rival", + "professor": "Professor", + "frontier_brain": "Frontier Brain", + // Maybe if we add the evil teams we can add "Team Rocket" and "Team Aqua" etc. here as well as "Team Rocket Boss" and "Team Aqua Admin" etc. +} as const; + +// Titles of trainers like "Youngster" or "Lass" +export const trainerClasses: SimpleTranslationEntries = { + "ace_trainer": "Ace Trainer", + "ace_trainer_female": "Ace Trainer", + "artist": "Artist", + "artist_female": "Artist", + "backers": "Backers", + "backpacker": "Backpacker", + "backpacker_female": "Backpacker", + "baker": "Baker", + "battle_girl": "Battle Girl", + "beauty": "Beauty", + "biker": "Biker", + "black_belt": "Black Belt", + "breeder": "Breeder", + "breeder_female": "Breeder", + "clerk": "Clerk", + "clerk_female": "Clerk", + "cyclist": "Cyclist", + "cyclist_female": "Cyclist", + "dancer": "Dancer", + "dancer_female": "Dancer", + "depot_agent": "Depot Agent", + "doctor": "Doctor", + "doctor_female": "Doctor", + "fishermen": "Fishermen", + "fishermen_female": "Fishermen", + "guitarist": "Guitarist", + "guitarist_female": "Guitarist", + "harlequin": "Harlequin", + "hiker": "Hiker", + "hooligans": "Hooligans", + "hoopster": "Hoopster", + "infielder": "Infielder", + "janitor": "Janitor", + "lady": "Lady", + "lass": "Lass", + "linebacker": "Linebacker", + "maid": "Maid", + "madame": "Madame", + "musican": "Musician", + "hex_maniac": "Hex Maniac", + "nurse": "Nurse", + "nursery_aide": "Nursery Aide", + "officer": "Officer", + "parasol_lady": "Parasol Lady", + "pilot": "Pilot", + "pokefan": "Poké Fan", + "preschooler": "Preschooler", + "preschooler_female": "Preschooler", + "psychic": "Psychic", + "psychic_female": "Psychic", + "ranger": "Ranger", + "rich": "Gentleman", // Gentleman is the english name but the trainerType is rich + "rich_kid": "Rich Boy", + "roughneck": "Roughneck", + "scientist": "Scientist", + "scientist_female": "Scientist", + "smasher": "Smasher", + "snow_worker": "Snow Worker", + "snow_worker_female": "Snow Worker", + "striker": "Striker", + "school_kid": "School Kid", + "school_kid_female": "School Kid", + "swimmer": "Swimmer", + "swimmer_female": "Swimmer", + "twins": "Twins", + "veteran": "Veteran", + "veteran_female": "Veteran", + "waiter": "Waiter", + "waitress": "Waitress", + "worker": "Worker", + "worker_female": "Worker", + "youngster": "Youngster" +} as const; + +// Names of special trainers like gym leaders, elite four, and the champion +export const trainerNames: SimpleTranslationEntries = { + "brock": "Brock", + "misty": "Misty", + "lt_surge": "Lt Surge", + "erika": "Erika", + "janine": "Janine", + "sabrina": "Sabrina", + "blaine": "Blaine", + "giovanni": "Giovanni", + "falkner": "Falkner", + "bugsy": "Bugsy", + "whitney": "Whitney", + "morty": "Morty", + "chuck": "Chuck", + "jasmine": "Jasmine", + "pryce": "Pryce", + "clair": "Clair", + "roxanne": "Roxanne", + "brawly": "Brawly", + "wattson": "Wattson", + "flannery": "Flannery", + "norman": "Norman", + "winona": "Winona", + "tate": "Tate", + "liza": "Liza", + "juan": "Juan", + "roark": "Roark", + "gardenia": "Gardenia", + "maylene": "Maylene", + "crasher_wake": "Crasher Wake", + "fantina": "Fantina", + "byron": "Byron", + "candice": "Candice", + "volkner": "Volkner", + "cilan": "Cilan", + "chili": "Chili", + "cress": "Cress", + "cheren": "Cheren", + "lenora": "Lenora", + "roxie": "Roxie", + "burgh": "Burgh", + "elesa": "Elesa", + "clay": "Clay", + "skyla": "Skyla", + "brycen": "Brycen", + "drayden": "Drayden", + "marlon": "Marlon", + "viola": "Viola", + "grant": "Grant", + "korrina": "Korrina", + "ramos": "Ramos", + "clemont": "Clemont", + "valerie": "Valerie", + "olympia": "Olympia", + "wulfric": "Wulfric", + "milo": "Milo", + "nessa": "Nessa", + "kabu": "Kabu", + "bea": "Bea", + "allister": "Allister", + "opal": "Opal", + "bede": "Bede", + "gordie": "Gordie", + "melony": "Melony", + "piers": "Piers", + "marnie": "Marnie", + "raihan": "Raihan", + "katy": "Katy", + "brassius": "Brassius", + "iono": "Iono", + "kofu": "Kofu", + "larry": "Larry", + "ryme": "Ryme", + "tulip": "Tulip", + "grusha": "Grusha", + "lorelei": "Lorelei", + "bruno": "Bruno", + "agatha": "Agatha", + "lance": "Lance", + "will": "Will", + "koga": "Koga", + "karen": "Karen", + "sidney": "Sidney", + "phoebe": "Phoebe", + "glacia": "Glacia", + "drake": "Drake", + "aaron": "Aaron", + "bertha": "Bertha", + "flint": "Flint", + "lucian": "Lucian", + "shauntal": "Shauntal", + "marshal": "Marshal", + "grimsley": "Grimsley", + "caitlin": "Caitlin", + "malva": "Malva", + "siebold": "Siebold", + "wikstrom": "Wikstrom", + "drasna": "Drasna", + "hala": "Hala", + "molayne": "Molayne", + "olivia": "Olivia", + "acerola": "Acerola", + "kahili": "Kahili", + "rika": "Rika", + "poppy": "Poppy", + "larry_elite": "Larry", // Does this really need to be an extra entry? (it is in trainer-type.ts so I added it here) + "hassel": "Hassel", + "crispin": "Crispin", + "amarys": "Amarys", + "lacey": "Lacey", + "drayton": "Drayton", + "blue": "Blue", + "red": "Red", + "lance_champion": "Lance", // Does this really need to be an extra entry? (it is in trainer-type.ts so I added it here) + "steven": "Steven", + "wallace": "Wallace", + "cynthia": "Cynthia", + "alder": "Alder", + "iris": "Iris", + "diantha": "Diantha", + "hau": "Hau", + "geeta": "Geeta", + "nemona": "Nemona", + "kieran": "Kieran", + "leon": "Leon", + "rival": "Finn", + "rival_female": "Ivy", +} as const; diff --git a/src/locales/es/config.ts b/src/locales/es/config.ts index 6c36db3ed45..6aac47563ee 100644 --- a/src/locales/es/config.ts +++ b/src/locales/es/config.ts @@ -15,6 +15,7 @@ import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { tutorial } from "./tutorial"; +import { titles,trainerClasses,trainerNames } from "./trainers"; import { splashMessages } from "./splash-messages" import { weather } from "./weather"; @@ -33,10 +34,13 @@ export const esConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, + titles: titles, + trainerClasses: trainerClasses, + trainerNames: trainerNames, tutorial: tutorial, splashMessages: splashMessages, nature: nature, growth: growth, weather: weather, modifierType: modifierType, -} \ No newline at end of file +} diff --git a/src/locales/es/trainers.ts b/src/locales/es/trainers.ts new file mode 100644 index 00000000000..a63b06242f9 --- /dev/null +++ b/src/locales/es/trainers.ts @@ -0,0 +1,219 @@ +import {SimpleTranslationEntries} from "#app/plugins/i18n"; + +// Titles of special trainers like gym leaders, elite four, and the champion +export const titles: SimpleTranslationEntries = { + "elite_four": "Elite Four", + "gym_leader": "Gym Leader", + "gym_leader_female": "Gym Leader", + "champion": "Champion", + "rival": "Rival", + "professor": "Professor", + "frontier_brain": "Frontier Brain", + // Maybe if we add the evil teams we can add "Team Rocket" and "Team Aqua" etc. here as well as "Team Rocket Boss" and "Team Aqua Admin" etc. +} as const; + +// Titles of trainers like "Youngster" or "Lass" +export const trainerClasses: SimpleTranslationEntries = { + "ace_trainer": "Ace Trainer", + "ace_trainer_female": "Ace Trainer", + "artist": "Artist", + "artist_female": "Artist", + "backers": "Backers", + "backpacker": "Backpacker", + "backpacker_female": "Backpacker", + "baker": "Baker", + "battle_girl": "Battle Girl", + "beauty": "Beauty", + "biker": "Biker", + "black_belt": "Black Belt", + "breeder": "Breeder", + "breeder_female": "Breeder", + "clerk": "Clerk", + "clerk_female": "Clerk", + "cyclist": "Cyclist", + "cyclist_female": "Cyclist", + "dancer": "Dancer", + "dancer_female": "Dancer", + "depot_agent": "Depot Agent", + "doctor": "Doctor", + "doctor_female": "Doctor", + "fishermen": "Fishermen", + "fishermen_female": "Fishermen", + "guitarist": "Guitarist", + "guitarist_female": "Guitarist", + "harlequin": "Harlequin", + "hiker": "Hiker", + "hooligans": "Hooligans", + "hoopster": "Hoopster", + "infielder": "Infielder", + "janitor": "Janitor", + "lady": "Lady", + "lass": "Lass", + "linebacker": "Linebacker", + "maid": "Maid", + "madame": "Madame", + "musican": "Musician", + "hex_maniac": "Hex Maniac", + "nurse": "Nurse", + "nursery_aide": "Nursery Aide", + "officer": "Officer", + "parasol_lady": "Parasol Lady", + "pilot": "Pilot", + "pokefan": "Poké Fan", + "preschooler": "Preschooler", + "preschooler_female": "Preschooler", + "psychic": "Psychic", + "psychic_female": "Psychic", + "ranger": "Ranger", + "rich": "Gentleman", // Gentleman is the english name but the trainerType is rich + "rich_kid": "Rich Boy", + "roughneck": "Roughneck", + "scientist": "Scientist", + "scientist_female": "Scientist", + "smasher": "Smasher", + "snow_worker": "Snow Worker", + "snow_worker_female": "Snow Worker", + "striker": "Striker", + "school_kid": "School Kid", + "school_kid_female": "School Kid", + "swimmer": "Swimmer", + "swimmer_female": "Swimmer", + "twins": "Twins", + "veteran": "Veteran", + "veteran_female": "Veteran", + "waiter": "Waiter", + "waitress": "Waitress", + "worker": "Worker", + "worker_female": "Worker", + "youngster": "Youngster" +} as const; + +// Names of special trainers like gym leaders, elite four, and the champion +export const trainerNames: SimpleTranslationEntries = { + "brock": "Brock", + "misty": "Misty", + "lt_surge": "Lt Surge", + "erika": "Erika", + "janine": "Janine", + "sabrina": "Sabrina", + "blaine": "Blaine", + "giovanni": "Giovanni", + "falkner": "Falkner", + "bugsy": "Bugsy", + "whitney": "Whitney", + "morty": "Morty", + "chuck": "Chuck", + "jasmine": "Jasmine", + "pryce": "Pryce", + "clair": "Clair", + "roxanne": "Roxanne", + "brawly": "Brawly", + "wattson": "Wattson", + "flannery": "Flannery", + "norman": "Norman", + "winona": "Winona", + "tate": "Tate", + "liza": "Liza", + "juan": "Juan", + "roark": "Roark", + "gardenia": "Gardenia", + "maylene": "Maylene", + "crasher_wake": "Crasher Wake", + "fantina": "Fantina", + "byron": "Byron", + "candice": "Candice", + "volkner": "Volkner", + "cilan": "Cilan", + "chili": "Chili", + "cress": "Cress", + "cheren": "Cheren", + "lenora": "Lenora", + "roxie": "Roxie", + "burgh": "Burgh", + "elesa": "Elesa", + "clay": "Clay", + "skyla": "Skyla", + "brycen": "Brycen", + "drayden": "Drayden", + "marlon": "Marlon", + "viola": "Viola", + "grant": "Grant", + "korrina": "Korrina", + "ramos": "Ramos", + "clemont": "Clemont", + "valerie": "Valerie", + "olympia": "Olympia", + "wulfric": "Wulfric", + "milo": "Milo", + "nessa": "Nessa", + "kabu": "Kabu", + "bea": "Bea", + "allister": "Allister", + "opal": "Opal", + "bede": "Bede", + "gordie": "Gordie", + "melony": "Melony", + "piers": "Piers", + "marnie": "Marnie", + "raihan": "Raihan", + "katy": "Katy", + "brassius": "Brassius", + "iono": "Iono", + "kofu": "Kofu", + "larry": "Larry", + "ryme": "Ryme", + "tulip": "Tulip", + "grusha": "Grusha", + "lorelei": "Lorelei", + "bruno": "Bruno", + "agatha": "Agatha", + "lance": "Lance", + "will": "Will", + "koga": "Koga", + "karen": "Karen", + "sidney": "Sidney", + "phoebe": "Phoebe", + "glacia": "Glacia", + "drake": "Drake", + "aaron": "Aaron", + "bertha": "Bertha", + "flint": "Flint", + "lucian": "Lucian", + "shauntal": "Shauntal", + "marshal": "Marshal", + "grimsley": "Grimsley", + "caitlin": "Caitlin", + "malva": "Malva", + "siebold": "Siebold", + "wikstrom": "Wikstrom", + "drasna": "Drasna", + "hala": "Hala", + "molayne": "Molayne", + "olivia": "Olivia", + "acerola": "Acerola", + "kahili": "Kahili", + "rika": "Rika", + "poppy": "Poppy", + "larry_elite": "Larry", // Does this really need to be an extra entry? (it is in trainer-type.ts so I added it here) + "hassel": "Hassel", + "crispin": "Crispin", + "amarys": "Amarys", + "lacey": "Lacey", + "drayton": "Drayton", + "blue": "Blue", + "red": "Red", + "lance_champion": "Lance", // Does this really need to be an extra entry? (it is in trainer-type.ts so I added it here) + "steven": "Steven", + "wallace": "Wallace", + "cynthia": "Cynthia", + "alder": "Alder", + "iris": "Iris", + "diantha": "Diantha", + "hau": "Hau", + "geeta": "Geeta", + "nemona": "Nemona", + "kieran": "Kieran", + "leon": "Leon", + "rival": "Finn", + "rival_female": "Ivy", +} as const; diff --git a/src/locales/fr/config.ts b/src/locales/fr/config.ts index f6245f4eeaa..a2bb8430fba 100644 --- a/src/locales/fr/config.ts +++ b/src/locales/fr/config.ts @@ -15,10 +15,12 @@ import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { tutorial } from "./tutorial"; +import { titles,trainerClasses,trainerNames } from "./trainers"; import { splashMessages } from "./splash-messages" import { weather } from "./weather"; + export const frConfig = { ability: ability, abilityTriggers: abilityTriggers, @@ -33,10 +35,14 @@ export const frConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, + titles: titles, + trainerClasses: trainerClasses, + trainerNames: trainerNames, tutorial: tutorial, splashMessages: splashMessages, nature: nature, growth: growth, weather: weather, modifierType: modifierType, -} \ No newline at end of file +} + diff --git a/src/locales/fr/trainers.ts b/src/locales/fr/trainers.ts new file mode 100644 index 00000000000..761e3f62635 --- /dev/null +++ b/src/locales/fr/trainers.ts @@ -0,0 +1,219 @@ +import {SimpleTranslationEntries} from "#app/plugins/i18n"; + +// Titles of special trainers like gym leaders, elite four, and the champion +export const titles: SimpleTranslationEntries = { + "elite_four": "Conseil 4", + "gym_leader": "Champion d’Arène", + "gym_leader_female": "Championne d’Arène", + "champion": "Maitre·esse", //Written in gender-inclusive language in wait of a potential split of the entry + "rival": "Rival·e", //Written in gender-inclusive language in wait of a potential split of the entry + "professor": "Professeur·e", //Written in gender-inclusive language in wait of a potential split of the entry + "frontier_brain": "Meneur·euse de Zone", //Written in gender-inclusive language in wait of a potential split of the entry + // Maybe if we add the evil teams we can add "Team Rocket" and "Team Aqua" etc. here as well as "Team Rocket Boss" and "Team Aqua Admin" etc. +} as const; + +// Titles of trainers like "Youngster" or "Lass" +export const trainerClasses: SimpleTranslationEntries = { + "ace_trainer": "Topdresseur", + "ace_trainer_female": "Topdresseuse", + "artist": "Artiste", + "artist_female": "Artiste", + "backers": "Pompom Girls", + "backpacker": "Randonneur", + "backpacker_female": "Randonneuse", + "baker": "Boulangère", + "battle_girl": "Combattante", + "beauty": "Canon", + "biker": "Motard", + "black_belt": "Karatéka", + "breeder": "Éleveur", + "breeder_female": "Éleveuse", + "clerk": "Employé", + "clerk_female": "Employée", + "cyclist": "Cycliste", + "cyclist_female": "Cycliste", + "dancer": "Danseur", + "dancer_female": "Danseuse", + "depot_agent": "Cheminot", + "doctor": "Docteur", + "doctor_female": "Docteure", + "fishermen": "Pêcheur", + "fishermen_female": "Pêcheuse", + "guitarist": "Guitariste", + "guitarist_female": "Guitariste", + "harlequin": "Clown", + "hiker": "Montagnard", + "hooligans": "Loubards", + "hoopster": "Basketteur", + "infielder": "Baseballeur", + "janitor": "Nettoyeur", + "lady": "Mademoiselle", + "lass": "Fillette", + "linebacker": "Quaterback", + "maid": "Gouvernante", + "madame": "Mondaine", + "musican": "Musicien", + "hex_maniac": "Hex Maniac", + "nurse": " Infirmière", + "nursery_aide": "Institutrice", + "officer": "Policier", + "parasol_lady": "Sœur Parasol", + "pilot": "Pilote", + "pokefan": "Pokéfan", + "preschooler": "Petit", + "preschooler_female": "Petite", + "psychic": "Kinésiste", + "psychic_female": "Kinésiste", + "ranger": "Ranger", + "rich": "Gentleman", // Gentleman is the english name but the trainerType is rich + "rich_kid": "Richard", + "roughneck": "Loubard", + "scientist": "Scientifique", + "scientist_female": "Scientifique", + "smasher": "Tenniswoman", + "snow_worker": "Ouvrier Alpin", + "snow_worker_female": "Ouvrière Alpine", + "striker": "Footballeur", + "school_kid": "Élève", + "school_kid_female": "Élève", + "swimmer": "Nageur", + "swimmer_female": "Nageuse", + "twins": "Jumelles", + "veteran": "Vénérable", + "veteran_female": "Vénérable", + "waiter": "Serveur", + "waitress": "Serveuse", + "worker": "Ouvrier", + "worker_female": "Ouvrière", + "youngster": "Gamin" +} as const; + +// Names of special trainers like gym leaders, elite four, and the champion +export const trainerNames: SimpleTranslationEntries = { + "brock": "Pierre", + "misty": "Ondine", + "lt_surge": "Major Bob", + "erika": "Erika", + "janine": "Jeannine", + "sabrina": "Morgane", + "blaine": "Auguste", + "giovanni": "Giovanni", + "falkner": "Albert", + "bugsy": "Hector", + "whitney": "Blanche", + "morty": "Mortimer", + "chuck": "Chuck", + "jasmine": "Jasmine", + "pryce": "Frédo", + "clair": "Sandra", + "roxanne": "Roxanne", + "brawly": "Bastien", + "wattson": "Voltère", + "flannery": "Adriane", + "norman": "Norman", + "winona": "Alizée", + "tate": "Lévy", + "liza": "Tatia", + "juan": "Juan", + "roark": "Pierrick", + "gardenia": "Flo", + "maylene": "Mélina", + "crasher_wake": "Lovis", + "fantina": "Kiméra", + "byron": "Charles", + "candice": "Gladys", + "volkner": "Tanguy", + "cilan": "Rachid", + "chili": "Armando", + "cress": "Noa", + "cheren": "Tcheren", + "lenora": "Aloé", + "roxie": "Strykna", + "burgh": "Artie", + "elesa": "Inezia", + "clay": "Bardane", + "skyla": "Carolina", + "brycen": "Zhu", + "drayden": "Watson", + "marlon": "Amana", + "viola": "Violette", + "grant": "Lino", + "korrina": "Cornélia", + "ramos": "Amaro", + "clemont": "Lem", + "valerie": "Valériane", + "olympia": "Astera", + "wulfric": "Urup", + "milo": "Percy", + "nessa": "Donna", + "kabu": "Kabu", + "bea": "Faïza", + "allister": "Alistair", + "opal": "Sally", + "bede": "Travis", + "gordie": "Chaz", + "melony": "Lona", + "piers": "Peterson", + "marnie": "Rosemary", + "raihan": "Roy", + "katy": "Éra", + "brassius": "Colza", + "iono": "Mashynn", + "kofu": "Kombu", + "larry": "Okuba", + "ryme": "Laïm", + "tulip": "Tully", + "grusha": "Grusha", + "lorelei": "Olga", + "bruno": "Aldo", + "agatha": "Agatha", + "lance": "Peter", + "will": "Clément", + "koga": "Koga", + "karen": "Marion", + "sidney": "Damien", + "phoebe": "Spectra", + "glacia": "Glacia", + "drake": "Aragon", + "aaron": "Aaron", + "bertha": "Terry", + "flint": "Adrien", + "lucian": "Lucio", + "shauntal": "Anis", + "marshal": "Kunz", + "grimsley": "Pieris", + "caitlin": "Percila", + "malva": "Malva", + "siebold": "Narcisse", + "wikstrom": "Tileo", + "drasna": "Dracéna", + "hala": "Pectorius", + "molayne": "Molène", + "olivia": "Alyxia", + "acerola": "Margie", + "kahili": "Kahili", + "rika": "Cayenn", + "poppy": "Popi", + "larry_elite": "Okuba", // Does this really need to be an extra entry? (it is in trainer-type.ts so I added it here) + "hassel": "Hassa", + "crispin": "Rubépin", + "amarys": "Nérine", + "lacey": "Taro", + "drayton": "Irido", + "blue": "Blue", + "red": "Red", + "lance_champion": "Peter", // Does this really need to be an extra entry? (it is in trainer-type.ts so I added it here) + "steven": "Pierre Rochard", + "wallace": "Marc", + "cynthia": "Cynthia", + "alder": "Goyah", + "iris": "Iris", + "diantha": "Dianthéa", + "hau": "Tili", + "geeta": "Alisma", + "nemona": "Menzi", + "kieran": "Kass", + "leon": "Tarak", + "rival": "Gwenaël", //Male breton name, a celtic language spoken in Brittany (France) and related to the word for "white" (gwenn). Finn meaning is also "white" in irish/goidelic which are also celtic languages. + "rival_female": "Papina", //Litteral translation of ivy, also used as Female name in a North-American indigenous language +} as const; diff --git a/src/locales/it/config.ts b/src/locales/it/config.ts index 11b1b9e5628..baa252bcb16 100644 --- a/src/locales/it/config.ts +++ b/src/locales/it/config.ts @@ -15,6 +15,7 @@ import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { tutorial } from "./tutorial"; +import { titles,trainerClasses,trainerNames } from "./trainers"; import { splashMessages } from "./splash-messages" import { weather } from "./weather"; @@ -33,10 +34,13 @@ export const itConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, + titles: titles, + trainerClasses: trainerClasses, + trainerNames: trainerNames, tutorial: tutorial, splashMessages: splashMessages, nature: nature, growth: growth, weather: weather, modifierType: modifierType, -} \ No newline at end of file +} diff --git a/src/locales/it/trainers.ts b/src/locales/it/trainers.ts new file mode 100644 index 00000000000..a63b06242f9 --- /dev/null +++ b/src/locales/it/trainers.ts @@ -0,0 +1,219 @@ +import {SimpleTranslationEntries} from "#app/plugins/i18n"; + +// Titles of special trainers like gym leaders, elite four, and the champion +export const titles: SimpleTranslationEntries = { + "elite_four": "Elite Four", + "gym_leader": "Gym Leader", + "gym_leader_female": "Gym Leader", + "champion": "Champion", + "rival": "Rival", + "professor": "Professor", + "frontier_brain": "Frontier Brain", + // Maybe if we add the evil teams we can add "Team Rocket" and "Team Aqua" etc. here as well as "Team Rocket Boss" and "Team Aqua Admin" etc. +} as const; + +// Titles of trainers like "Youngster" or "Lass" +export const trainerClasses: SimpleTranslationEntries = { + "ace_trainer": "Ace Trainer", + "ace_trainer_female": "Ace Trainer", + "artist": "Artist", + "artist_female": "Artist", + "backers": "Backers", + "backpacker": "Backpacker", + "backpacker_female": "Backpacker", + "baker": "Baker", + "battle_girl": "Battle Girl", + "beauty": "Beauty", + "biker": "Biker", + "black_belt": "Black Belt", + "breeder": "Breeder", + "breeder_female": "Breeder", + "clerk": "Clerk", + "clerk_female": "Clerk", + "cyclist": "Cyclist", + "cyclist_female": "Cyclist", + "dancer": "Dancer", + "dancer_female": "Dancer", + "depot_agent": "Depot Agent", + "doctor": "Doctor", + "doctor_female": "Doctor", + "fishermen": "Fishermen", + "fishermen_female": "Fishermen", + "guitarist": "Guitarist", + "guitarist_female": "Guitarist", + "harlequin": "Harlequin", + "hiker": "Hiker", + "hooligans": "Hooligans", + "hoopster": "Hoopster", + "infielder": "Infielder", + "janitor": "Janitor", + "lady": "Lady", + "lass": "Lass", + "linebacker": "Linebacker", + "maid": "Maid", + "madame": "Madame", + "musican": "Musician", + "hex_maniac": "Hex Maniac", + "nurse": "Nurse", + "nursery_aide": "Nursery Aide", + "officer": "Officer", + "parasol_lady": "Parasol Lady", + "pilot": "Pilot", + "pokefan": "Poké Fan", + "preschooler": "Preschooler", + "preschooler_female": "Preschooler", + "psychic": "Psychic", + "psychic_female": "Psychic", + "ranger": "Ranger", + "rich": "Gentleman", // Gentleman is the english name but the trainerType is rich + "rich_kid": "Rich Boy", + "roughneck": "Roughneck", + "scientist": "Scientist", + "scientist_female": "Scientist", + "smasher": "Smasher", + "snow_worker": "Snow Worker", + "snow_worker_female": "Snow Worker", + "striker": "Striker", + "school_kid": "School Kid", + "school_kid_female": "School Kid", + "swimmer": "Swimmer", + "swimmer_female": "Swimmer", + "twins": "Twins", + "veteran": "Veteran", + "veteran_female": "Veteran", + "waiter": "Waiter", + "waitress": "Waitress", + "worker": "Worker", + "worker_female": "Worker", + "youngster": "Youngster" +} as const; + +// Names of special trainers like gym leaders, elite four, and the champion +export const trainerNames: SimpleTranslationEntries = { + "brock": "Brock", + "misty": "Misty", + "lt_surge": "Lt Surge", + "erika": "Erika", + "janine": "Janine", + "sabrina": "Sabrina", + "blaine": "Blaine", + "giovanni": "Giovanni", + "falkner": "Falkner", + "bugsy": "Bugsy", + "whitney": "Whitney", + "morty": "Morty", + "chuck": "Chuck", + "jasmine": "Jasmine", + "pryce": "Pryce", + "clair": "Clair", + "roxanne": "Roxanne", + "brawly": "Brawly", + "wattson": "Wattson", + "flannery": "Flannery", + "norman": "Norman", + "winona": "Winona", + "tate": "Tate", + "liza": "Liza", + "juan": "Juan", + "roark": "Roark", + "gardenia": "Gardenia", + "maylene": "Maylene", + "crasher_wake": "Crasher Wake", + "fantina": "Fantina", + "byron": "Byron", + "candice": "Candice", + "volkner": "Volkner", + "cilan": "Cilan", + "chili": "Chili", + "cress": "Cress", + "cheren": "Cheren", + "lenora": "Lenora", + "roxie": "Roxie", + "burgh": "Burgh", + "elesa": "Elesa", + "clay": "Clay", + "skyla": "Skyla", + "brycen": "Brycen", + "drayden": "Drayden", + "marlon": "Marlon", + "viola": "Viola", + "grant": "Grant", + "korrina": "Korrina", + "ramos": "Ramos", + "clemont": "Clemont", + "valerie": "Valerie", + "olympia": "Olympia", + "wulfric": "Wulfric", + "milo": "Milo", + "nessa": "Nessa", + "kabu": "Kabu", + "bea": "Bea", + "allister": "Allister", + "opal": "Opal", + "bede": "Bede", + "gordie": "Gordie", + "melony": "Melony", + "piers": "Piers", + "marnie": "Marnie", + "raihan": "Raihan", + "katy": "Katy", + "brassius": "Brassius", + "iono": "Iono", + "kofu": "Kofu", + "larry": "Larry", + "ryme": "Ryme", + "tulip": "Tulip", + "grusha": "Grusha", + "lorelei": "Lorelei", + "bruno": "Bruno", + "agatha": "Agatha", + "lance": "Lance", + "will": "Will", + "koga": "Koga", + "karen": "Karen", + "sidney": "Sidney", + "phoebe": "Phoebe", + "glacia": "Glacia", + "drake": "Drake", + "aaron": "Aaron", + "bertha": "Bertha", + "flint": "Flint", + "lucian": "Lucian", + "shauntal": "Shauntal", + "marshal": "Marshal", + "grimsley": "Grimsley", + "caitlin": "Caitlin", + "malva": "Malva", + "siebold": "Siebold", + "wikstrom": "Wikstrom", + "drasna": "Drasna", + "hala": "Hala", + "molayne": "Molayne", + "olivia": "Olivia", + "acerola": "Acerola", + "kahili": "Kahili", + "rika": "Rika", + "poppy": "Poppy", + "larry_elite": "Larry", // Does this really need to be an extra entry? (it is in trainer-type.ts so I added it here) + "hassel": "Hassel", + "crispin": "Crispin", + "amarys": "Amarys", + "lacey": "Lacey", + "drayton": "Drayton", + "blue": "Blue", + "red": "Red", + "lance_champion": "Lance", // Does this really need to be an extra entry? (it is in trainer-type.ts so I added it here) + "steven": "Steven", + "wallace": "Wallace", + "cynthia": "Cynthia", + "alder": "Alder", + "iris": "Iris", + "diantha": "Diantha", + "hau": "Hau", + "geeta": "Geeta", + "nemona": "Nemona", + "kieran": "Kieran", + "leon": "Leon", + "rival": "Finn", + "rival_female": "Ivy", +} as const; diff --git a/src/locales/pt_BR/trainers.ts b/src/locales/pt_BR/trainers.ts new file mode 100644 index 00000000000..b1f56e70ae4 --- /dev/null +++ b/src/locales/pt_BR/trainers.ts @@ -0,0 +1,219 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +// Titles of special trainers like gym leaders, elite four, and the champion +export const titles: SimpleTranslationEntries = { + "elite_four": "Elite dos Quatro", + "gym_leader": "Líder de Ginásio", + "gym_leader_female": "Líder de Ginásio", + "champion": "Campeão", + "rival": "Rival", + "professor": "Professor", + "frontier_brain": "Cérebro da Fronteira", + // Maybe if we add the evil teams we can add "Team Rocket" and "Team Aqua" etc. here as well as "Team Rocket Boss" and "Team Aqua Admin" etc. +} as const; + +// Titles of trainers like "Youngster" or "Lass" +export const trainerClasses: SimpleTranslationEntries = { + "ace_trainer": "Trinador Ás", + "ace_trainer_female": "Trinadora Ás", + "artist": "Artista", + "artist_female": "Artista", + "backers": "Torcedores", + "backpacker": "Mochileiro", + "backpacker_female": "Mochileira", + "baker": "Padeira", + "battle_girl": "Lutadora", + "beauty": "Modelo", + "biker": "Motoqueiro", + "black_belt": "Faixa Preta", + "breeder": "Criador", + "breeder_female": "Criadora", + "clerk": "Funcionário", + "clerk_female": "Funcionária", + "cyclist": "Ciclista", + "cyclist_female": "Ciclista", + "dancer": "Dançarino", + "dancer_female": "Dançarina", + "depot_agent": "Ferroviário", + "doctor": "Doutor", + "doctor_female": "Doutora", + "fishermen": "Pescador", + "fishermen_female": "Pescadora", + "guitarist": "Guitarrista", + "guitarist_female": "Guitarrista", + "harlequin": "Arlequim", + "hiker": "Montanhista", + "hooligans": "Bandoleiro", + "hoopster": "Jogador de basquete", + "infielder": "Jogador de baseball", + "janitor": "Faxineiro", + "lady": "Dama", + "lass": "Senhorita", + "linebacker": "Zagueiro", + "maid": "Doméstica", + "madame": "Madame", + "musican": "Músico", + "hex_maniac": "Ocultista", + "nurse": "Enfermeira", + "nursery_aide": "Professora do Berçário", + "officer": "Policial", + "parasol_lady": "Moça de Sombrinha", + "pilot": "Piloto", + "pokefan": "Pokefã", + "preschooler": "Menino do Prezinho", + "preschooler_female": "Menina do Prezinho", + "psychic": "Médium", + "psychic_female": "Médium", + "ranger": "Guarda", + "rich": "Cavalheira", // Gentleman is the english name but the trainerType is rich + "rich_kid": "Riquinho", + "roughneck": "Arruaceiro", + "scientist": "Cientista", + "scientist_female": "Cientista", + "smasher": "Tenista", + "snow_worker": "Operário da Neve", + "snow_worker_female": "Operária da Neve", + "striker": "Atacante", + "school_kid": "Estudante", + "school_kid_female": "Estudante", + "swimmer": "Nadador", + "swimmer_female": "Nadadora", + "twins": "Gêmeos", + "veteran": "Veterano", + "veteran_female": "Veterana", + "waiter": "Garçom", + "waitress": "Garçonete", + "worker": "Operário", + "worker_female": "Operária", + "youngster": "Jovem", +} as const; + +// Names of special trainers like gym leaders, elite four, and the champion +export const trainerNames: SimpleTranslationEntries = { + "brock": "Brock", + "misty": "Misty", + "lt_surge": "Ten. Surge", + "erika": "Erika", + "janine": "Janine", + "sabrina": "Sabrina", + "blaine": "Blaine", + "giovanni": "Giovanni", + "falkner": "Falkner", + "bugsy": "Bugsy", + "whitney": "Whitney", + "morty": "Morty", + "chuck": "Chuck", + "jasmine": "Jasmine", + "pryce": "Pryce", + "clair": "Clair", + "roxanne": "Roxanne", + "brawly": "Brawly", + "wattson": "Wattson", + "flannery": "Flannery", + "norman": "Norman", + "winona": "Winona", + "tate": "Tate", + "liza": "Liza", + "juan": "Juan", + "roark": "Roark", + "gardenia": "Gardenia", + "maylene": "Maylene", + "crasher_wake": "Demolidor Wake", + "fantina": "Fantina", + "byron": "Byron", + "candice": "Candice", + "volkner": "Volkner", + "cilan": "Cilan", + "chili": "Chili", + "cress": "Cress", + "cheren": "Cheren", + "lenora": "Lenora", + "roxie": "Roxie", + "burgh": "Burgh", + "elesa": "Elesa", + "clay": "Clay", + "skyla": "Skyla", + "brycen": "Brycen", + "drayden": "Drayden", + "marlon": "Marlon", + "viola": "Viola", + "grant": "Grant", + "korrina": "Korrina", + "ramos": "Ramos", + "clemont": "Clemont", + "valerie": "Valerie", + "olympia": "Olympia", + "wulfric": "Wulfric", + "milo": "Milo", + "nessa": "Nessa", + "kabu": "Kabu", + "bea": "Bea", + "allister": "Allister", + "opal": "Opal", + "bede": "Bede", + "gordie": "Gordie", + "melony": "Melony", + "piers": "Piers", + "marnie": "Marnie", + "raihan": "Raihan", + "katy": "Katy", + "brassius": "Brassius", + "iono": "Iono", + "kofu": "Kofu", + "larry": "Larry", + "ryme": "Ryme", + "tulip": "Tulip", + "grusha": "Grusha", + "lorelei": "Lorelei", + "bruno": "Bruno", + "agatha": "Agatha", + "lance": "Lance", + "will": "Will", + "koga": "Koga", + "karen": "Karen", + "sidney": "Sidney", + "phoebe": "Phoebe", + "glacia": "Glacia", + "drake": "Drake", + "aaron": "Aaron", + "bertha": "Bertha", + "flint": "Flint", + "lucian": "Lucian", + "shauntal": "Shauntal", + "marshal": "Marshal", + "grimsley": "Grimsley", + "caitlin": "Caitlin", + "malva": "Malva", + "siebold": "Siebold", + "wikstrom": "Wikstrom", + "drasna": "Drasna", + "hala": "Hala", + "molayne": "Molayne", + "olivia": "Olivia", + "acerola": "Acerola", + "kahili": "Kahili", + "rika": "Rika", + "poppy": "Poppy", + "larry_elite": "Larry", // Does this really need to be an extra entry? (it is in trainer-type.ts so I added it here) + "hassel": "Hassel", + "crispin": "Crispin", + "amarys": "Amarys", + "lacey": "Lacey", + "drayton": "Drayton", + "blue": "Blue", + "red": "Red", + "lance_champion": "Lance", // Does this really need to be an extra entry? (it is in trainer-type.ts so I added it here) + "steven": "Steven", + "wallace": "Wallace", + "cynthia": "Cynthia", + "alder": "Alder", + "iris": "Iris", + "diantha": "Diantha", + "hau": "Hau", + "geeta": "Geeta", + "nemona": "Nemona", + "kieran": "Kieran", + "leon": "Leon", + "rival": "Finn", + "rival_female": "Ivy", +} as const; \ No newline at end of file diff --git a/src/locales/zh_CN/config.ts b/src/locales/zh_CN/config.ts index 11339dca4c8..957b1e7a482 100644 --- a/src/locales/zh_CN/config.ts +++ b/src/locales/zh_CN/config.ts @@ -11,6 +11,7 @@ import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { tutorial } from "./tutorial"; +import { titles,trainerClasses,trainerNames } from "./trainers"; import { nature } from "./nature"; import { weather } from "./weather"; import { modifierType } from "./modifier-type"; @@ -30,9 +31,13 @@ export const zhCnConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, + nature: nature, + titles: titles, + trainerClasses: trainerClasses, + trainerNames: trainerNames, tutorial: tutorial, nature: nature, growth: growth, weather: weather, modifierType: modifierType, -} \ No newline at end of file +} diff --git a/src/locales/zh_CN/trainers.ts b/src/locales/zh_CN/trainers.ts new file mode 100644 index 00000000000..2a9af843870 --- /dev/null +++ b/src/locales/zh_CN/trainers.ts @@ -0,0 +1,218 @@ +import {SimpleTranslationEntries} from "#app/plugins/i18n"; + +// Titles of special trainers like gym leaders, elite four, and the champion +export const titles: SimpleTranslationEntries = { + "elite_four": "Elite Four", + "gym_leader": "Gym Leader", + "gym_leader_female": "Gym Leader", + "champion": "Champion", + "rival": "Rival", + "professor": "Professor", + "frontier_brain": "Frontier Brain", + // Maybe if we add the evil teams we can add "Team Rocket" and "Team Aqua" etc. here as well as "Team Rocket Boss" and "Team Aqua Admin" etc. +} as const; + +// Titles of trainers like "Youngster" or "Lass" +export const trainerClasses: SimpleTranslationEntries = { + "ace_trainer": "Ace Trainer", + "ace_trainer_female": "Ace Trainer", + "artist": "Artist", + "artist_female": "Artist", + "backers": "Backers", + "backpacker": "Backpacker", + "backpacker_female": "Backpacker", + "baker": "Baker", + "battle_girl": "Battle Girl", + "beauty": "Beauty", + "biker": "Biker", + "black_belt": "Black Belt", + "breeder": "Breeder", + "breeder_female": "Breeder", + "clerk": "Clerk", + "clerk_female": "Clerk", + "cyclist": "Cyclist", + "cyclist_female": "Cyclist", + "dancer": "Dancer", + "dancer_female": "Dancer", + "depot_agent": "Depot Agent", + "doctor": "Doctor", + "doctor_female": "Doctor", + "fishermen": "Fishermen", + "fishermen_female": "Fishermen", + "guitarist": "Guitarist", + "guitarist_female": "Guitarist", + "harlequin": "Harlequin", + "hiker": "Hiker", + "hooligans": "Hooligans", + "hoopster": "Hoopster", + "infielder": "Infielder", + "janitor": "Janitor", + "lady": "Lady", + "lass": "Lass", + "linebacker": "Linebacker", + "maid": "Maid", + "madame": "Madame", + "musican": "Musician", + "hex_maniac": "Hex Maniac", + "nurse": "Nurse", + "nursery_aide": "Nursery Aide", + "officer": "Officer", + "parasol_lady": "Parasol Lady", + "pilot": "Pilot", + "pokefan": "Poké Fan", + "preschooler": "Preschooler", + "preschooler_female": "Preschooler", + "psychic": "Psychic", + "psychic_female": "Psychic", + "ranger": "Ranger", + "rich": "Gentleman", // Gentleman is the english name but the trainerType is rich + "rich_kid": "Rich Boy", + "roughneck": "Roughneck", + "scientist": "Scientist", + "scientist_female": "Scientist", + "smasher": "Smasher", + "snow_worker": "Snow Worker", + "snow_worker_female": "Snow Worker", + "striker": "Striker", + "school_kid": "School Kid", + "school_kid_female": "School Kid", + "swimmer": "Swimmer", + "swimmer_female": "Swimmer", + "twins": "Twins", + "veteran": "Veteran", + "veteran_female": "Veteran", + "waiter": "Waiter", + "waitress": "Waitress", + "worker": "Worker", + "worker_female": "Worker", + "youngster": "Youngster" +} as const; + +// Names of special trainers like gym leaders, elite four, and the champion +export const trainerNames: SimpleTranslationEntries = { + "brock": "Brock", + "misty": "Misty", + "lt_surge": "Lt Surge", + "erika": "Erika", + "janine": "Janine", + "sabrina": "Sabrina", + "blaine": "Blaine", + "giovanni": "Giovanni", + "falkner": "Falkner", + "bugsy": "Bugsy", + "whitney": "Whitney", + "morty": "Morty", + "chuck": "Chuck", + "jasmine": "Jasmine", + "pryce": "Pryce", + "clair": "Clair", + "roxanne": "Roxanne", + "brawly": "Brawly", + "wattson": "Wattson", + "flannery": "Flannery", + "norman": "Norman", + "winona": "Winona", + "tate": "Tate", + "liza": "Liza", + "juan": "Juan", + "roark": "Roark", + "gardenia": "Gardenia", + "maylene": "Maylene", + "crasher_wake": "Crasher Wake", + "fantina": "Fantina", + "byron": "Byron", + "candice": "Candice", + "volkner": "Volkner", + "cilan": "Cilan", + "chili": "Chili", + "cress": "Cress", + "cheren": "Cheren", + "lenora": "Lenora", + "roxie": "Roxie", + "burgh": "Burgh", + "elesa": "Elesa", + "clay": "Clay", + "skyla": "Skyla", + "brycen": "Brycen", + "drayden": "Drayden", + "marlon": "Marlon", + "viola": "Viola", + "grant": "Grant", + "korrina": "Korrina", + "ramos": "Ramos", + "clemont": "Clemont", + "valerie": "Valerie", + "olympia": "Olympia", + "wulfric": "Wulfric", + "milo": "Milo", + "nessa": "Nessa", + "kabu": "Kabu", + "bea": "Bea", + "allister": "Allister", + "opal": "Opal", + "bede": "Bede", + "gordie": "Gordie", + "melony": "Melony", + "piers": "Piers", + "marnie": "Marnie", + "raihan": "Raihan", + "katy": "Katy", + "brassius": "Brassius", + "iono": "Iono", + "kofu": "Kofu", + "larry": "Larry", + "ryme": "Ryme", + "tulip": "Tulip", + "grusha": "Grusha", + "lorelei": "Lorelei", + "bruno": "Bruno", + "agatha": "Agatha", + "lance": "Lance", + "will": "Will", + "koga": "Koga", + "karen": "Karen", + "sidney": "Sidney", + "phoebe": "Phoebe", + "glacia": "Glacia", + "drake": "Drake", + "aaron": "Aaron", + "bertha": "Bertha", + "flint": "Flint", + "lucian": "Lucian", + "shauntal": "Shauntal", + "marshal": "Marshal", + "grimsley": "Grimsley", + "caitlin": "Caitlin", + "malva": "Malva", + "siebold": "Siebold", + "wikstrom": "Wikstrom", + "drasna": "Drasna", + "hala": "Hala", + "molayne": "Molayne", + "olivia": "Olivia", + "acerola": "Acerola", + "kahili": "Kahili", + "rika": "Rika", + "poppy": "Poppy", + "larry_elite": "Larry", // Does this really need to be an extra entry? (it is in trainer-type.ts so I added it here) + "hassel": "Hassel", + "crispin": "Crispin", + "amarys": "Amarys", + "lacey": "Lacey", + "drayton": "Drayton", + "blue": "Blue", + "red": "Red", + "lance_champion": "Lance", // Does this really need to be an extra entry? (it is in trainer-type.ts so I added it here) + "steven": "Steven", + "wallace": "Wallace", + "cynthia": "Cynthia", + "alder": "Alder", + "iris": "Iris", + "diantha": "Diantha", + "hau": "Hau", + "geeta": "Geeta", + "nemona": "Nemona", + "kieran": "Kieran", + "leon": "Leon", + "rival": "Rival", +} as const; diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 1e0363f1688..807e1a1b550 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -8,7 +8,6 @@ import { frConfig } from '#app/locales/fr/config.js'; import { itConfig } from '#app/locales/it/config.js'; import { ptBrConfig } from '#app/locales/pt_BR/config.js'; import { zhCnConfig } from '#app/locales/zh_CN/config.js'; - export interface SimpleTranslationEntries { [key: string]: string } @@ -52,11 +51,18 @@ export interface Localizable { } export function initI18n(): void { + // Prevent reinitialization + if (isInitialized) { + return; + } + isInitialized = true; let lang = ''; if (localStorage.getItem('prLang')) lang = localStorage.getItem('prLang'); + + /** * i18next is a localization library for maintaining and using translation resources. * @@ -122,6 +128,9 @@ declare module 'i18next' { pokemonStat: SimpleTranslationEntries; commandUiHandler: SimpleTranslationEntries; fightUiHandler: SimpleTranslationEntries; + titles: SimpleTranslationEntries; + trainerClasses: SimpleTranslationEntries; + trainerNames: SimpleTranslationEntries; tutorial: SimpleTranslationEntries; starterSelectUiHandler: SimpleTranslationEntries; splashMessages: SimpleTranslationEntries; @@ -135,3 +144,9 @@ declare module 'i18next' { } export default i18next; + +export function getIsInitialized(): boolean { + return isInitialized; +} + +let isInitialized = false; \ No newline at end of file