From a99bcbce3d19256bbd00a4b4f6c926f25859c304 Mon Sep 17 00:00:00 2001 From: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> Date: Sun, 9 Jun 2024 18:40:23 +0200 Subject: [PATCH] [Localization] Achievements are now based on Player Gender (because some languages differ based on that). (#1721) * Achivments(localization of name and description) now depend on the player gender * Fixed Name in ptBr config * Now the achivments are also shown with a gender specific title * Changed it so it checks if PlayerGender is undefined first * Update src/locales/de/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/en/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/es/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/fr/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/it/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/ko/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/pt_BR/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/voucher.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/zh_CN/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/locales/zh_TW/config.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achv-bar.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/system/achv.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update src/ui/achvs-ui-handler.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * instantiate player gender on in AchvBar constructor * Reverted the change made only for the tests. And adjusted the import to use the new enum file * Changed a import to make vite build it again correctly * Again some changes to the imports for the github docs that was complaining * The new challenges are also now localized and gender based * Readded getDescription --------- Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: ImperialSympathizer --- src/locales/de/achv.ts | 267 +++++++++++++++++++++++++++++++----- src/locales/de/config.ts | 5 +- src/locales/en/achv.ts | 6 +- src/locales/en/config.ts | 5 +- src/locales/es/achv.ts | 101 +++++++++++++- src/locales/es/config.ts | 5 +- src/locales/fr/achv.ts | 101 +++++++++++++- src/locales/fr/config.ts | 5 +- src/locales/it/achv.ts | 101 +++++++++++++- src/locales/it/config.ts | 5 +- src/locales/ko/achv.ts | 101 +++++++++++++- src/locales/ko/config.ts | 5 +- src/locales/pt_BR/achv.ts | 7 +- src/locales/pt_BR/config.ts | 5 +- src/locales/zh_CN/achv.ts | 101 +++++++++++++- src/locales/zh_CN/config.ts | 5 +- src/locales/zh_TW/achv.ts | 101 +++++++++++++- src/locales/zh_TW/config.ts | 5 +- src/plugins/i18n.ts | 3 + src/system/achv.ts | 162 ++++++++++++---------- src/system/voucher.ts | 8 +- src/ui/achv-bar.ts | 9 +- src/ui/achvs-ui-handler.ts | 24 +++- 23 files changed, 1000 insertions(+), 137 deletions(-) diff --git a/src/locales/de/achv.ts b/src/locales/de/achv.ts index 42f2b2cf86c..64721e48af6 100644 --- a/src/locales/de/achv.ts +++ b/src/locales/de/achv.ts @@ -1,6 +1,7 @@ -import { AchievementTranslationEntries } from "#app/plugins/i18n.js"; +import {AchievementTranslationEntries} from "#app/plugins/i18n.js"; -export const achv: AchievementTranslationEntries = { +// Achievement translations for the when the player character is male +export const PGMachv: AchievementTranslationEntries = { "Achievements": { name: "Errungenschaften", }, @@ -10,7 +11,7 @@ export const achv: AchievementTranslationEntries = { "MoneyAchv": { - description:"Häufe eine Gesamtsumme von {{moneyAmount}} ₽ an", + description: "Häufe eine Gesamtsumme von {{moneyAmount}} ₽ an.", }, "10K_MONEY": { name: "Besserverdiener", @@ -26,7 +27,7 @@ export const achv: AchievementTranslationEntries = { }, "DamageAchv": { - description: "Füge mit einem Treffer {{damageAmount}} Schaden zu", + description: "Füge mit einem Treffer {{damageAmount}} Schaden zu.", }, "250_DMG": { name: "Harte Treffer", @@ -42,7 +43,7 @@ export const achv: AchievementTranslationEntries = { }, "HealAchv": { - description: "Heile {{healAmount}} {{HP}} auf einmal. Mit einer Attacke, Fähigkeit oder einem gehaltenen Gegenstand", + description: "Heile {{healAmount}} {{HP}} auf einmal. Mit einer Attacke, Fähigkeit oder einem gehaltenen Gegenstand.", }, "250_HEAL": { name: "Anfänger-Heiler", @@ -58,7 +59,7 @@ export const achv: AchievementTranslationEntries = { }, "LevelAchv": { - description: "Erhöhe das Level eines Pokémon auf {{level}}", + description: "Erhöhe das Level eines Pokémon auf {{level}}.", }, "LV_100": { name: "Warte, es gibt mehr!", @@ -67,14 +68,14 @@ export const achv: AchievementTranslationEntries = { name: "Elite", }, "LV_1000": { - name: "Geh noch höher hinaus!", + name: "Geh noch höher hinaus!", }, "RibbonAchv": { - description: "Sammle insgesamt {{ribbonAmount}} Bänder", + description: "Sammle insgesamt {{ribbonAmount}} Bänder.", }, "10_RIBBONS": { - name: "Champion der Pokémon Liga", + name: "Champion der Pokémon Liga", }, "25_RIBBONS": { name: "Bänder-Sammler", @@ -91,82 +92,286 @@ export const achv: AchievementTranslationEntries = { "TRANSFER_MAX_BATTLE_STAT": { name: "Teamwork", - description: "Nutze Staffette, während der Anwender mindestens eines Statuswertes maximiert hat", + description: "Nutze Staffette, während der Anwender mindestens eines Statuswertes maximiert hat.", }, "MAX_FRIENDSHIP": { - name: "Freundschaftsmaximierung", - description: "Erreiche maximale Freundschaft bei einem Pokémon", + name: "Freundschaftsmaximierung", + description: "Erreiche maximale Freundschaft bei einem Pokémon.", }, "MEGA_EVOLVE": { name: "Megaverwandlung", - description: "Megaentwickle ein Pokémon", + description: "Megaentwickle ein Pokémon.", }, "GIGANTAMAX": { name: "Absolute Einheit", - description: "Gigadynamaximiere ein Pokémon", + description: "Gigadynamaximiere ein Pokémon.", }, "TERASTALLIZE": { name: "Typen-Bonus Enthusiast", - description: "Terrakristallisiere ein Pokémon", + description: "Terrakristallisiere ein Pokémon.", }, "STELLAR_TERASTALLIZE": { name: "Der geheime Typ", - description: "Terrakristallisiere ein Pokémon zum Typen Stellar", + description: "Terrakristallisiere ein Pokémon zum Typen Stellar.", }, "SPLICE": { name: "Unendliche Fusion", - description: "Kombiniere zwei Pokémon mit einem DNS-Keil", + description: "Kombiniere zwei Pokémon mit einem DNS-Keil.", }, "MINI_BLACK_HOLE": { name: "Ein Loch voller Items", - description: "Erlange ein Mini-Schwarzes Loch", + description: "Erlange ein Mini-Schwarzes Loch.", }, "CATCH_MYTHICAL": { - name: "Mysteriöses!", - description: "Fange ein mysteriöses Pokémon", + name: "Mysteriöses!", + description: "Fange ein mysteriöses Pokémon.", }, "CATCH_SUB_LEGENDARY": { name: "Sub-Legendär", - description: "Fange ein sub-legendäres Pokémon", + description: "Fange ein sub-legendäres Pokémon.", }, "CATCH_LEGENDARY": { name: "Legendär", - description: "Fange ein legendäres Pokémon", + description: "Fange ein legendäres Pokémon.", }, "SEE_SHINY": { name: "Schillerndes Licht", - description: "Finde ein wildes schillerndes Pokémon", + description: "Finde ein wildes schillerndes Pokémon.", }, "SHINY_PARTY": { name: "Das ist Hingabe", - description: "Habe ein Team aus schillernden Pokémon", + description: "Habe ein Team aus schillernden Pokémon.", }, "HATCH_MYTHICAL": { name: "Mysteriöses Ei", - description: "Lass ein mysteriöses Pokémon aus einem Ei schlüpfen", + description: "Lass ein mysteriöses Pokémon aus einem Ei schlüpfen.", }, "HATCH_SUB_LEGENDARY": { name: "Sub-Legendäres Ei", - description: "Lass ein sub-legendäres Pokémon aus einem Ei schlüpfen", + description: "Lass ein sub-legendäres Pokémon aus einem Ei schlüpfen.", }, "HATCH_LEGENDARY": { name: "Legendäres Ei", - description: "Lass ein legendäres Pokémon aus einem Ei schlüpfen", + description: "Lass ein legendäres Pokémon aus einem Ei schlüpfen.", }, "HATCH_SHINY": { name: "Schillerndes Ei", - description: "Lass ein schillerndes Pokémon aus einem Ei schlüpfen", + description: "Lass ein schillerndes Pokémon aus einem Ei schlüpfen.", }, "HIDDEN_ABILITY": { name: "Geheimes Talent", - description: "Fang ein Pokémon mit versteckter Fähigkeit", + description: "Fang ein Pokémon mit versteckter Fähigkeit.", }, "PERFECT_IVS": { name: "Zertifikat der Echtheit", - description: "Erhalte ein Pokémon mit perfekten IS-Werten", + description: "Erhalte ein Pokémon mit perfekten IS-Werten.", }, "CLASSIC_VICTORY": { name: "Ungeschlagen", - description: "Beende den klassischen Modus erfolgreich", + description: "Beende den klassischen Modus erfolgreich.", + }, + "MONO_GEN_ONE": { + name: "Der originale Rivale", + description: "Schließe die 'Nur 1. Generation' Herausforderung ab.", + }, + "MONO_GEN_TWO": { + name: "Generation 1.5", + description: "Schließe die 'Nur 2. Generation' Herausforderung ab.", + }, + "MONO_GEN_THREE": { + name: "Zu viel Wasser?", + description: "Schließe die 'Nur 3. Generation' Herausforderung ab.", + }, + "MONO_GEN_FOUR": { + name: "Ist SIE wirklich die Stärkste?", + description: "Schließe die 'Nur 4. Generation' Herausforderung ab.", + }, + "MONO_GEN_FIVE": { + name: "Komplett Original", + description: "Schließe die 'Nur 5. Generation' Herausforderung ab.", + }, + "MONO_GEN_SIX": { + name: "Fast Königlich", + description: "Schließe die 'Nur 6. Generation' Herausforderung ab." + }, + "MONO_GEN_SEVEN": { + name: "Technisch gesehen", + description: "Schließe die 'Nur 7. Generation' Herausforderung ab." + }, + "MONO_GEN_EIGHT": { + name: "Die Zeit des Champions", + description: "Schließe die 'Nur 8. Generation' Herausforderung ab." + }, + "MONO_GEN_NINE": { + name: "Sie hat es dir leicht gemacht...", + description: "Schließe die 'Nur 9. Generation' Herausforderung ab." + }, + + "MonoType": { + description: "Beende die Monotyp-{{type}} Herausforderung." + }, + "MONO_NORMAL": { + name: "Normaler Typ", + }, + "MONO_FIGHTING": { + name: "Ich kenne Kung Fu." + }, + "MONO_FLYING": { + name: "Ich glaube ich kann fliegen.", + }, + "MONO_POISON": { + name: "Kantos Liebling", + }, + "MONO_GROUND": { + name: "Auf dem Boden bleiben.", + }, + "MONO_ROCK": { + name: "So hart wie Rocko.", + }, + "MONO_BUG": { + name: "Steche wie ein Bibor.", + }, + "MONO_GHOST": { + name: "Wer wird angerufen?", + }, + "MONO_STEEL": { + name: "Stahlharte Entschlossenheit", + }, + "MONO_FIRE": { + name: "Brennende Leidenschaft", + }, + "MONO_WATER": { + name: "Wenn es regnet, schüttet es!", + }, + "MONO_GRASS": { + name: "Grüner Daumen", + }, + "MONO_ELECTRIC": { + name: "Elektrisierend", + }, + "MONO_PSYCHIC": { + name: "Übernatürliches Talent", + }, + "MONO_ICE": { + name: "Eis Eis Baby", + }, + "MONO_DRAGON": { + name: "Siegfried bist du es?", + }, + "MONO_DARK": { + name: "Es ist nur eine Phase!", + }, + "MONO_FAIRY": { + name: "Ein ewiges Abenteuer!", }, } as const; + +// Achievement translations for the when the player character is female +export const PGFachv: AchievementTranslationEntries = { + "Achievements": { + name: PGMachv.Achievements.name, + }, + "Locked": { + name: PGMachv.Locked.name, + }, + + + "MoneyAchv": PGMachv.MoneyAchv, + "10K_MONEY": { + name: "Besserverdienerin", + }, + "100K_MONEY": PGMachv["100K_MONEY"], + "1M_MONEY": { + name: "Millionärin", + }, + "10M_MONEY": PGMachv["10M_MONEY"], + + "DamageAchv": PGMachv.DamageAchv, + "250_DMG": PGMachv["250_DMG"], + "1000_DMG": PGMachv["1000_DMG"], + "2500_DMG": PGMachv["2500_DMG"], + "10000_DMG": { + name: "One Punch Woman", + }, + + "HealAchv": PGMachv.HealAchv, + "250_HEAL": { + name: "Anfänger-Heilerin", + }, + "1000_HEAL": PGMachv["1000_HEAL"], + "2500_HEAL": { + name: "Klerikerin", + }, + "10000_HEAL": { + name: "Wiederherstellungsmeisterin", + }, + + "LevelAchv": PGMachv.LevelAchv, + "LV_100": PGMachv["LV_100"], + "LV_250": PGMachv["LV_250"], + "LV_1000": PGMachv["LV_1000"], + + "RibbonAchv": PGMachv.RibbonAchv, + "10_RIBBONS": PGMachv["10_RIBBONS"], + "25_RIBBONS": { + name: "Bänder-Sammlerin", + }, + "50_RIBBONS": { + name: "Bänder-Expertin", + }, + "75_RIBBONS": PGMachv["75_RIBBONS"], + "100_RIBBONS": { + name: "Bänder-Meisterin", + }, + + "TRANSFER_MAX_BATTLE_STAT": PGMachv.TRANSFER_MAX_BATTLE_STAT, + "MAX_FRIENDSHIP": PGMachv.MAX_FRIENDSHIP, + "MEGA_EVOLVE": PGMachv.MEGA_EVOLVE, + "GIGANTAMAX": PGMachv.GIGANTAMAX, + "TERASTALLIZE": PGMachv.TERASTALLIZE, + "STELLAR_TERASTALLIZE": PGMachv.STELLAR_TERASTALLIZE, + "SPLICE": PGMachv.SPLICE, + "MINI_BLACK_HOLE": PGMachv.MINI_BLACK_HOLE, + "CATCH_MYTHICAL": PGMachv.CATCH_MYTHICAL, + "CATCH_SUB_LEGENDARY": PGMachv.CATCH_SUB_LEGENDARY, + "CATCH_LEGENDARY": PGMachv.CATCH_LEGENDARY, + "SEE_SHINY": PGMachv.SEE_SHINY, + "SHINY_PARTY": PGMachv.SHINY_PARTY, + "HATCH_MYTHICAL": PGMachv.HATCH_MYTHICAL, + "HATCH_SUB_LEGENDARY": PGMachv.HATCH_SUB_LEGENDARY, + "HATCH_LEGENDARY": PGMachv.HATCH_LEGENDARY, + "HATCH_SHINY": PGMachv.HATCH_SHINY, + "HIDDEN_ABILITY": PGMachv.HIDDEN_ABILITY, + "PERFECT_IVS": PGMachv.PERFECT_IVS, + "CLASSIC_VICTORY": PGMachv.CLASSIC_VICTORY, + "MONO_GEN_ONE": PGMachv.MONO_GEN_ONE, + "MONO_GEN_TWO": PGMachv.MONO_GEN_TWO, + "MONO_GEN_THREE": PGMachv.MONO_GEN_THREE, + "MONO_GEN_FOUR": PGMachv.MONO_GEN_FOUR, + "MONO_GEN_FIVE": PGMachv.MONO_GEN_FIVE, + "MONO_GEN_SIX": PGMachv.MONO_GEN_SIX, + "MONO_GEN_SEVEN": PGMachv.MONO_GEN_SEVEN, + "MONO_GEN_EIGHT": PGMachv.MONO_GEN_EIGHT, + "MONO_GEN_NINE": PGMachv.MONO_GEN_NINE, + + "MonoType": PGMachv.MonoType, + "MONO_NORMAL": PGMachv.MONO_NORMAL, + "MONO_FIGHTING": PGMachv.MONO_FIGHTING, + "MONO_FLYING": PGMachv.MONO_FLYING, + "MONO_POISON": PGMachv.MONO_POISON, + "MONO_GROUND": PGMachv.MONO_GROUND, + "MONO_ROCK": PGMachv.MONO_ROCK, + "MONO_BUG": PGMachv.MONO_BUG, + "MONO_GHOST": PGMachv.MONO_GHOST, + "MONO_STEEL": PGMachv.MONO_STEEL, + "MONO_FIRE": PGMachv.MONO_FIRE, + "MONO_WATER": PGMachv.MONO_WATER, + "MONO_GRASS": PGMachv.MONO_GRASS, + "MONO_ELECTRIC": PGMachv.MONO_ELECTRIC, + "MONO_PSYCHIC": PGMachv.MONO_PSYCHIC, + "MONO_ICE": PGMachv.MONO_ICE, + "MONO_DRAGON": PGMachv.MONO_DRAGON, + "MONO_DARK": PGMachv.MONO_DARK, + "MONO_FAIRY": PGMachv.MONO_FAIRY, +} as const; + diff --git a/src/locales/de/config.ts b/src/locales/de/config.ts index 42869e5719e..b02bd5aeee6 100644 --- a/src/locales/de/config.ts +++ b/src/locales/de/config.ts @@ -1,6 +1,6 @@ import { ability } from "./ability"; import { abilityTriggers } from "./ability-trigger"; -import { achv } from "./achv"; +import { PGFachv, PGMachv } from "./achv"; import { battle } from "./battle"; import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; @@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler"; export const deConfig = { ability: ability, abilityTriggers: abilityTriggers, - achv: achv, battle: battle, battleMessageUiHandler: battleMessageUiHandler, berry: berry, biome: biome, challenges: challenges, commandUiHandler: commandUiHandler, + PGMachv: PGMachv, + PGFachv: PGFachv, PGMdialogue: PGMdialogue, PGFdialogue: PGFdialogue, PGMbattleSpecDialogue: PGMbattleSpecDialogue, diff --git a/src/locales/en/achv.ts b/src/locales/en/achv.ts index a545ab8a71e..bf1bfc295e8 100644 --- a/src/locales/en/achv.ts +++ b/src/locales/en/achv.ts @@ -1,6 +1,7 @@ import { AchievementTranslationEntries } from "#app/plugins/i18n.js"; -export const achv: AchievementTranslationEntries = { +// Achievement translations for the when the player character is male +export const PGMachv: AchievementTranslationEntries = { "Achievements": { name: "Achievements", }, @@ -264,3 +265,6 @@ export const achv: AchievementTranslationEntries = { name: "Mono FAIRY", }, } as const; + +// Achievement translations for the when the player character is female (it for now uses the same translations as the male version) +export const PGFachv: AchievementTranslationEntries = PGMachv; diff --git a/src/locales/en/config.ts b/src/locales/en/config.ts index 49dcd9f594e..89f809b266d 100644 --- a/src/locales/en/config.ts +++ b/src/locales/en/config.ts @@ -1,6 +1,6 @@ import { ability } from "./ability"; import { abilityTriggers } from "./ability-trigger"; -import { achv } from "./achv"; +import { PGFachv, PGMachv } from "./achv"; import { battle } from "./battle"; import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; @@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler"; export const enConfig = { ability: ability, abilityTriggers: abilityTriggers, - achv: achv, battle: battle, battleMessageUiHandler: battleMessageUiHandler, berry: berry, biome: biome, challenges: challenges, commandUiHandler: commandUiHandler, + PGMachv: PGMachv, + PGFachv: PGFachv, PGMdialogue: PGMdialogue, PGFdialogue: PGFdialogue, PGMbattleSpecDialogue: PGMbattleSpecDialogue, diff --git a/src/locales/es/achv.ts b/src/locales/es/achv.ts index 071c0cbb860..8d9ebc7d457 100644 --- a/src/locales/es/achv.ts +++ b/src/locales/es/achv.ts @@ -1,6 +1,7 @@ import { AchievementTranslationEntries } from "#app/plugins/i18n.js"; -export const achv: AchievementTranslationEntries = { +// Achievement translations for the when the player character is male +export const PGMachv: AchievementTranslationEntries = { "Achievements": { name: "Logros", }, @@ -168,4 +169,102 @@ export const achv: AchievementTranslationEntries = { name: "Imbatible", description: "Completa el juego en modo clásico.", }, + + "MONO_GEN_ONE": { + name: "The Original Rival", + description: "Complete the generation one only challenge.", + }, + "MONO_GEN_TWO": { + name: "Generation 1.5", + description: "Complete the generation two only challenge.", + }, + "MONO_GEN_THREE": { + name: "Too much water?", + description: "Complete the generation three only challenge.", + }, + "MONO_GEN_FOUR": { + name: "Is she really the hardest?", + description: "Complete the generation four only challenge.", + }, + "MONO_GEN_FIVE": { + name: "All Original", + description: "Complete the generation five only challenge.", + }, + "MONO_GEN_SIX": { + name: "Almost Royalty", + description: "Complete the generation six only challenge.", + }, + "MONO_GEN_SEVEN": { + name: "Only Technically", + description: "Complete the generation seven only challenge.", + }, + "MONO_GEN_EIGHT": { + name: "A Champion Time!", + description: "Complete the generation eight only challenge.", + }, + "MONO_GEN_NINE": { + name: "She was going easy on you", + description: "Complete the generation nine only challenge.", + }, + + "MonoType": { + description: "Complete the {{type}} monotype challenge.", + }, + "MONO_NORMAL": { + name: "Mono NORMAL", + }, + "MONO_FIGHTING": { + name: "I Know Kung Fu", + }, + "MONO_FLYING": { + name: "Mono FLYING", + }, + "MONO_POISON": { + name: "Kanto's Favourite", + }, + "MONO_GROUND": { + name: "Mono GROUND", + }, + "MONO_ROCK": { + name: "Brock Hard", + }, + "MONO_BUG": { + name: "Sting Like A Beedrill", + }, + "MONO_GHOST": { + name: "Who you gonna call?", + }, + "MONO_STEEL": { + name: "Mono STEEL", + }, + "MONO_FIRE": { + name: "Mono FIRE", + }, + "MONO_WATER": { + name: "When It Rains, It Pours", + }, + "MONO_GRASS": { + name: "Mono GRASS", + }, + "MONO_ELECTRIC": { + name: "Mono ELECTRIC", + }, + "MONO_PSYCHIC": { + name: "Mono PSYCHIC", + }, + "MONO_ICE": { + name: "Mono ICE", + }, + "MONO_DRAGON": { + name: "Mono DRAGON", + }, + "MONO_DARK": { + name: "It's just a phase", + }, + "MONO_FAIRY": { + name: "Mono FAIRY", + }, } as const; + +// Achievement translations for the when the player character is female (it for now uses the same translations as the male version) +export const PGFachv: AchievementTranslationEntries = PGMachv; diff --git a/src/locales/es/config.ts b/src/locales/es/config.ts index e31cd494c2f..8b482de5c78 100644 --- a/src/locales/es/config.ts +++ b/src/locales/es/config.ts @@ -1,6 +1,6 @@ import { ability } from "./ability"; import { abilityTriggers } from "./ability-trigger"; -import { achv } from "./achv"; +import { PGFachv, PGMachv } from "./achv"; import { battle } from "./battle"; import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; @@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler"; export const esConfig = { ability: ability, abilityTriggers: abilityTriggers, - achv: achv, battle: battle, battleMessageUiHandler: battleMessageUiHandler, berry: berry, biome: biome, challenges: challenges, commandUiHandler: commandUiHandler, + PGMachv: PGMachv, + PGFachv: PGFachv, PGMdialogue: PGMdialogue, PGFdialogue: PGFdialogue, PGMbattleSpecDialogue: PGMbattleSpecDialogue, diff --git a/src/locales/fr/achv.ts b/src/locales/fr/achv.ts index 6383c6817c0..ddec9086892 100644 --- a/src/locales/fr/achv.ts +++ b/src/locales/fr/achv.ts @@ -1,6 +1,7 @@ import { AchievementTranslationEntries } from "#app/plugins/i18n.js"; -export const achv: AchievementTranslationEntries = { +// Achievement translations for the when the player character is male +export const PGMachv: AchievementTranslationEntries = { "Achievements": { name: "Succès", }, @@ -168,4 +169,102 @@ export const achv: AchievementTranslationEntries = { name: "Invaincu·e", description: "Terminer le jeu en mode classique", }, + + "MONO_GEN_ONE": { + name: "The Original Rival", + description: "Complete the generation one only challenge.", + }, + "MONO_GEN_TWO": { + name: "Generation 1.5", + description: "Complete the generation two only challenge.", + }, + "MONO_GEN_THREE": { + name: "Too much water?", + description: "Complete the generation three only challenge.", + }, + "MONO_GEN_FOUR": { + name: "Is she really the hardest?", + description: "Complete the generation four only challenge.", + }, + "MONO_GEN_FIVE": { + name: "All Original", + description: "Complete the generation five only challenge.", + }, + "MONO_GEN_SIX": { + name: "Almost Royalty", + description: "Complete the generation six only challenge.", + }, + "MONO_GEN_SEVEN": { + name: "Only Technically", + description: "Complete the generation seven only challenge.", + }, + "MONO_GEN_EIGHT": { + name: "A Champion Time!", + description: "Complete the generation eight only challenge.", + }, + "MONO_GEN_NINE": { + name: "She was going easy on you", + description: "Complete the generation nine only challenge.", + }, + + "MonoType": { + description: "Complete the {{type}} monotype challenge.", + }, + "MONO_NORMAL": { + name: "Mono NORMAL", + }, + "MONO_FIGHTING": { + name: "I Know Kung Fu", + }, + "MONO_FLYING": { + name: "Mono FLYING", + }, + "MONO_POISON": { + name: "Kanto's Favourite", + }, + "MONO_GROUND": { + name: "Mono GROUND", + }, + "MONO_ROCK": { + name: "Brock Hard", + }, + "MONO_BUG": { + name: "Sting Like A Beedrill", + }, + "MONO_GHOST": { + name: "Who you gonna call?", + }, + "MONO_STEEL": { + name: "Mono STEEL", + }, + "MONO_FIRE": { + name: "Mono FIRE", + }, + "MONO_WATER": { + name: "When It Rains, It Pours", + }, + "MONO_GRASS": { + name: "Mono GRASS", + }, + "MONO_ELECTRIC": { + name: "Mono ELECTRIC", + }, + "MONO_PSYCHIC": { + name: "Mono PSYCHIC", + }, + "MONO_ICE": { + name: "Mono ICE", + }, + "MONO_DRAGON": { + name: "Mono DRAGON", + }, + "MONO_DARK": { + name: "It's just a phase", + }, + "MONO_FAIRY": { + name: "Mono FAIRY", + }, } as const; + +// Achievement translations for the when the player character is female (it for now uses the same translations as the male version) +export const PGFachv: AchievementTranslationEntries = PGMachv; diff --git a/src/locales/fr/config.ts b/src/locales/fr/config.ts index 058efe11dfe..f7b7467c4bc 100644 --- a/src/locales/fr/config.ts +++ b/src/locales/fr/config.ts @@ -1,6 +1,6 @@ import { ability } from "./ability"; import { abilityTriggers } from "./ability-trigger"; -import { achv } from "./achv"; +import { PGFachv, PGMachv } from "./achv"; import { battle } from "./battle"; import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; @@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler"; export const frConfig = { ability: ability, abilityTriggers: abilityTriggers, - achv: achv, battle: battle, battleMessageUiHandler: battleMessageUiHandler, berry: berry, biome: biome, challenges: challenges, commandUiHandler: commandUiHandler, + PGMachv: PGMachv, + PGFachv: PGFachv, PGMdialogue: PGMdialogue, PGFdialogue: PGFdialogue, PGMbattleSpecDialogue: PGMbattleSpecDialogue, diff --git a/src/locales/it/achv.ts b/src/locales/it/achv.ts index 42b1995bcde..bf1bfc295e8 100644 --- a/src/locales/it/achv.ts +++ b/src/locales/it/achv.ts @@ -1,6 +1,7 @@ import { AchievementTranslationEntries } from "#app/plugins/i18n.js"; -export const achv: AchievementTranslationEntries = { +// Achievement translations for the when the player character is male +export const PGMachv: AchievementTranslationEntries = { "Achievements": { name: "Achievements", }, @@ -168,4 +169,102 @@ export const achv: AchievementTranslationEntries = { name: "Undefeated", description: "Beat the game in classic mode", }, + + "MONO_GEN_ONE": { + name: "The Original Rival", + description: "Complete the generation one only challenge.", + }, + "MONO_GEN_TWO": { + name: "Generation 1.5", + description: "Complete the generation two only challenge.", + }, + "MONO_GEN_THREE": { + name: "Too much water?", + description: "Complete the generation three only challenge.", + }, + "MONO_GEN_FOUR": { + name: "Is she really the hardest?", + description: "Complete the generation four only challenge.", + }, + "MONO_GEN_FIVE": { + name: "All Original", + description: "Complete the generation five only challenge.", + }, + "MONO_GEN_SIX": { + name: "Almost Royalty", + description: "Complete the generation six only challenge.", + }, + "MONO_GEN_SEVEN": { + name: "Only Technically", + description: "Complete the generation seven only challenge.", + }, + "MONO_GEN_EIGHT": { + name: "A Champion Time!", + description: "Complete the generation eight only challenge.", + }, + "MONO_GEN_NINE": { + name: "She was going easy on you", + description: "Complete the generation nine only challenge.", + }, + + "MonoType": { + description: "Complete the {{type}} monotype challenge.", + }, + "MONO_NORMAL": { + name: "Mono NORMAL", + }, + "MONO_FIGHTING": { + name: "I Know Kung Fu", + }, + "MONO_FLYING": { + name: "Mono FLYING", + }, + "MONO_POISON": { + name: "Kanto's Favourite", + }, + "MONO_GROUND": { + name: "Mono GROUND", + }, + "MONO_ROCK": { + name: "Brock Hard", + }, + "MONO_BUG": { + name: "Sting Like A Beedrill", + }, + "MONO_GHOST": { + name: "Who you gonna call?", + }, + "MONO_STEEL": { + name: "Mono STEEL", + }, + "MONO_FIRE": { + name: "Mono FIRE", + }, + "MONO_WATER": { + name: "When It Rains, It Pours", + }, + "MONO_GRASS": { + name: "Mono GRASS", + }, + "MONO_ELECTRIC": { + name: "Mono ELECTRIC", + }, + "MONO_PSYCHIC": { + name: "Mono PSYCHIC", + }, + "MONO_ICE": { + name: "Mono ICE", + }, + "MONO_DRAGON": { + name: "Mono DRAGON", + }, + "MONO_DARK": { + name: "It's just a phase", + }, + "MONO_FAIRY": { + name: "Mono FAIRY", + }, } as const; + +// Achievement translations for the when the player character is female (it for now uses the same translations as the male version) +export const PGFachv: AchievementTranslationEntries = PGMachv; diff --git a/src/locales/it/config.ts b/src/locales/it/config.ts index 47926c05f7f..333c11ae6a8 100644 --- a/src/locales/it/config.ts +++ b/src/locales/it/config.ts @@ -1,6 +1,6 @@ import { ability } from "./ability"; import { abilityTriggers } from "./ability-trigger"; -import { achv } from "./achv"; +import { PGFachv, PGMachv } from "./achv"; import { battle } from "./battle"; import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; @@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler"; export const itConfig = { ability: ability, abilityTriggers: abilityTriggers, - achv: achv, battle: battle, battleMessageUiHandler: battleMessageUiHandler, berry: berry, biome: biome, challenges: challenges, commandUiHandler: commandUiHandler, + PGMachv: PGMachv, + PGFachv: PGFachv, PGMdialogue: PGMdialogue, PGFdialogue: PGFdialogue, PGMbattleSpecDialogue: PGMbattleSpecDialogue, diff --git a/src/locales/ko/achv.ts b/src/locales/ko/achv.ts index d48a63868b1..e1e9ae74ece 100644 --- a/src/locales/ko/achv.ts +++ b/src/locales/ko/achv.ts @@ -1,6 +1,7 @@ import { AchievementTranslationEntries } from "#app/plugins/i18n.js"; -export const achv: AchievementTranslationEntries = { +// Achievement translations for the when the player character is male +export const PGMachv: AchievementTranslationEntries = { "Achievements": { name: "업적", }, @@ -168,4 +169,102 @@ export const achv: AchievementTranslationEntries = { name: "무패", description: "클래식 모드 클리어", }, + + "MONO_GEN_ONE": { + name: "The Original Rival", + description: "Complete the generation one only challenge.", + }, + "MONO_GEN_TWO": { + name: "Generation 1.5", + description: "Complete the generation two only challenge.", + }, + "MONO_GEN_THREE": { + name: "Too much water?", + description: "Complete the generation three only challenge.", + }, + "MONO_GEN_FOUR": { + name: "Is she really the hardest?", + description: "Complete the generation four only challenge.", + }, + "MONO_GEN_FIVE": { + name: "All Original", + description: "Complete the generation five only challenge.", + }, + "MONO_GEN_SIX": { + name: "Almost Royalty", + description: "Complete the generation six only challenge.", + }, + "MONO_GEN_SEVEN": { + name: "Only Technically", + description: "Complete the generation seven only challenge.", + }, + "MONO_GEN_EIGHT": { + name: "A Champion Time!", + description: "Complete the generation eight only challenge.", + }, + "MONO_GEN_NINE": { + name: "She was going easy on you", + description: "Complete the generation nine only challenge.", + }, + + "MonoType": { + description: "Complete the {{type}} monotype challenge.", + }, + "MONO_NORMAL": { + name: "Mono NORMAL", + }, + "MONO_FIGHTING": { + name: "I Know Kung Fu", + }, + "MONO_FLYING": { + name: "Mono FLYING", + }, + "MONO_POISON": { + name: "Kanto's Favourite", + }, + "MONO_GROUND": { + name: "Mono GROUND", + }, + "MONO_ROCK": { + name: "Brock Hard", + }, + "MONO_BUG": { + name: "Sting Like A Beedrill", + }, + "MONO_GHOST": { + name: "Who you gonna call?", + }, + "MONO_STEEL": { + name: "Mono STEEL", + }, + "MONO_FIRE": { + name: "Mono FIRE", + }, + "MONO_WATER": { + name: "When It Rains, It Pours", + }, + "MONO_GRASS": { + name: "Mono GRASS", + }, + "MONO_ELECTRIC": { + name: "Mono ELECTRIC", + }, + "MONO_PSYCHIC": { + name: "Mono PSYCHIC", + }, + "MONO_ICE": { + name: "Mono ICE", + }, + "MONO_DRAGON": { + name: "Mono DRAGON", + }, + "MONO_DARK": { + name: "It's just a phase", + }, + "MONO_FAIRY": { + name: "Mono FAIRY", + }, } as const; + +// Achievement translations for the when the player character is female (it for now uses the same translations as the male version) +export const PGFachv: AchievementTranslationEntries = PGMachv; diff --git a/src/locales/ko/config.ts b/src/locales/ko/config.ts index e79afbd8212..ca14d87cc10 100644 --- a/src/locales/ko/config.ts +++ b/src/locales/ko/config.ts @@ -1,6 +1,6 @@ import { ability } from "./ability"; import { abilityTriggers } from "./ability-trigger"; -import { achv } from "./achv"; +import { PGFachv, PGMachv } from "./achv"; import { battle } from "./battle"; import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; @@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler"; export const koConfig = { ability: ability, abilityTriggers: abilityTriggers, - achv: achv, battle: battle, battleMessageUiHandler: battleMessageUiHandler, berry: berry, biome: biome, challenges: challenges, commandUiHandler: commandUiHandler, + PGMachv: PGMachv, + PGFachv: PGFachv, PGMdialogue: PGMdialogue, PGFdialogue: PGFdialogue, PGMbattleSpecDialogue: PGMbattleSpecDialogue, diff --git a/src/locales/pt_BR/achv.ts b/src/locales/pt_BR/achv.ts index b43c78ec589..e8cb0e09c9b 100644 --- a/src/locales/pt_BR/achv.ts +++ b/src/locales/pt_BR/achv.ts @@ -1,6 +1,7 @@ import { AchievementTranslationEntries } from "#app/plugins/i18n.js"; -export const achv: AchievementTranslationEntries = { +// Achievement translations for the when the player character is male +export const PGMachv: AchievementTranslationEntries = { "Achievements": { name: "Conquistas", }, @@ -170,6 +171,7 @@ export const achv: AchievementTranslationEntries = { }, "MONO_GEN_ONE": { + name: "O Início de Tudo", description: "Complete o desafio da geração um.", }, @@ -264,3 +266,6 @@ export const achv: AchievementTranslationEntries = { name: "Clube das Winx", }, } as const; + +// Achievement translations for the when the player character is female (it for now uses the same translations as the male version) +export const PGFachv: AchievementTranslationEntries = PGMachv; diff --git a/src/locales/pt_BR/config.ts b/src/locales/pt_BR/config.ts index b7c5e3a2403..7fa3c483926 100644 --- a/src/locales/pt_BR/config.ts +++ b/src/locales/pt_BR/config.ts @@ -1,6 +1,6 @@ import { ability } from "./ability"; import { abilityTriggers } from "./ability-trigger"; -import { achv } from "./achv"; +import { PGFachv, PGMachv } from "./achv"; import { battle } from "./battle"; import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; @@ -43,13 +43,14 @@ import { weather } from "./weather"; export const ptBrConfig = { ability: ability, abilityTriggers: abilityTriggers, - achv: achv, battle: battle, battleMessageUiHandler: battleMessageUiHandler, berry: berry, biome: biome, challenges: challenges, commandUiHandler: commandUiHandler, + PGMachv: PGMachv, + PGFachv: PGFachv, PGMdialogue: PGMdialogue, PGFdialogue: PGFdialogue, PGMbattleSpecDialogue: PGMbattleSpecDialogue, diff --git a/src/locales/zh_CN/achv.ts b/src/locales/zh_CN/achv.ts index 42b1995bcde..bf1bfc295e8 100644 --- a/src/locales/zh_CN/achv.ts +++ b/src/locales/zh_CN/achv.ts @@ -1,6 +1,7 @@ import { AchievementTranslationEntries } from "#app/plugins/i18n.js"; -export const achv: AchievementTranslationEntries = { +// Achievement translations for the when the player character is male +export const PGMachv: AchievementTranslationEntries = { "Achievements": { name: "Achievements", }, @@ -168,4 +169,102 @@ export const achv: AchievementTranslationEntries = { name: "Undefeated", description: "Beat the game in classic mode", }, + + "MONO_GEN_ONE": { + name: "The Original Rival", + description: "Complete the generation one only challenge.", + }, + "MONO_GEN_TWO": { + name: "Generation 1.5", + description: "Complete the generation two only challenge.", + }, + "MONO_GEN_THREE": { + name: "Too much water?", + description: "Complete the generation three only challenge.", + }, + "MONO_GEN_FOUR": { + name: "Is she really the hardest?", + description: "Complete the generation four only challenge.", + }, + "MONO_GEN_FIVE": { + name: "All Original", + description: "Complete the generation five only challenge.", + }, + "MONO_GEN_SIX": { + name: "Almost Royalty", + description: "Complete the generation six only challenge.", + }, + "MONO_GEN_SEVEN": { + name: "Only Technically", + description: "Complete the generation seven only challenge.", + }, + "MONO_GEN_EIGHT": { + name: "A Champion Time!", + description: "Complete the generation eight only challenge.", + }, + "MONO_GEN_NINE": { + name: "She was going easy on you", + description: "Complete the generation nine only challenge.", + }, + + "MonoType": { + description: "Complete the {{type}} monotype challenge.", + }, + "MONO_NORMAL": { + name: "Mono NORMAL", + }, + "MONO_FIGHTING": { + name: "I Know Kung Fu", + }, + "MONO_FLYING": { + name: "Mono FLYING", + }, + "MONO_POISON": { + name: "Kanto's Favourite", + }, + "MONO_GROUND": { + name: "Mono GROUND", + }, + "MONO_ROCK": { + name: "Brock Hard", + }, + "MONO_BUG": { + name: "Sting Like A Beedrill", + }, + "MONO_GHOST": { + name: "Who you gonna call?", + }, + "MONO_STEEL": { + name: "Mono STEEL", + }, + "MONO_FIRE": { + name: "Mono FIRE", + }, + "MONO_WATER": { + name: "When It Rains, It Pours", + }, + "MONO_GRASS": { + name: "Mono GRASS", + }, + "MONO_ELECTRIC": { + name: "Mono ELECTRIC", + }, + "MONO_PSYCHIC": { + name: "Mono PSYCHIC", + }, + "MONO_ICE": { + name: "Mono ICE", + }, + "MONO_DRAGON": { + name: "Mono DRAGON", + }, + "MONO_DARK": { + name: "It's just a phase", + }, + "MONO_FAIRY": { + name: "Mono FAIRY", + }, } as const; + +// Achievement translations for the when the player character is female (it for now uses the same translations as the male version) +export const PGFachv: AchievementTranslationEntries = PGMachv; diff --git a/src/locales/zh_CN/config.ts b/src/locales/zh_CN/config.ts index 6b2132b6406..3f5504f64ce 100644 --- a/src/locales/zh_CN/config.ts +++ b/src/locales/zh_CN/config.ts @@ -1,6 +1,6 @@ import { ability } from "./ability"; import { abilityTriggers } from "./ability-trigger"; -import { achv } from "./achv"; +import { PGFachv, PGMachv } from "./achv"; import { battle } from "./battle"; import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; @@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler"; export const zhCnConfig = { ability: ability, abilityTriggers: abilityTriggers, - achv: achv, battle: battle, battleMessageUiHandler: battleMessageUiHandler, berry: berry, biome: biome, challenges: challenges, commandUiHandler: commandUiHandler, + PGMachv: PGMachv, + PGFachv: PGFachv, PGMdialogue: PGMdialogue, PGFdialogue: PGFdialogue, PGMbattleSpecDialogue: PGMbattleSpecDialogue, diff --git a/src/locales/zh_TW/achv.ts b/src/locales/zh_TW/achv.ts index 42b1995bcde..bf1bfc295e8 100644 --- a/src/locales/zh_TW/achv.ts +++ b/src/locales/zh_TW/achv.ts @@ -1,6 +1,7 @@ import { AchievementTranslationEntries } from "#app/plugins/i18n.js"; -export const achv: AchievementTranslationEntries = { +// Achievement translations for the when the player character is male +export const PGMachv: AchievementTranslationEntries = { "Achievements": { name: "Achievements", }, @@ -168,4 +169,102 @@ export const achv: AchievementTranslationEntries = { name: "Undefeated", description: "Beat the game in classic mode", }, + + "MONO_GEN_ONE": { + name: "The Original Rival", + description: "Complete the generation one only challenge.", + }, + "MONO_GEN_TWO": { + name: "Generation 1.5", + description: "Complete the generation two only challenge.", + }, + "MONO_GEN_THREE": { + name: "Too much water?", + description: "Complete the generation three only challenge.", + }, + "MONO_GEN_FOUR": { + name: "Is she really the hardest?", + description: "Complete the generation four only challenge.", + }, + "MONO_GEN_FIVE": { + name: "All Original", + description: "Complete the generation five only challenge.", + }, + "MONO_GEN_SIX": { + name: "Almost Royalty", + description: "Complete the generation six only challenge.", + }, + "MONO_GEN_SEVEN": { + name: "Only Technically", + description: "Complete the generation seven only challenge.", + }, + "MONO_GEN_EIGHT": { + name: "A Champion Time!", + description: "Complete the generation eight only challenge.", + }, + "MONO_GEN_NINE": { + name: "She was going easy on you", + description: "Complete the generation nine only challenge.", + }, + + "MonoType": { + description: "Complete the {{type}} monotype challenge.", + }, + "MONO_NORMAL": { + name: "Mono NORMAL", + }, + "MONO_FIGHTING": { + name: "I Know Kung Fu", + }, + "MONO_FLYING": { + name: "Mono FLYING", + }, + "MONO_POISON": { + name: "Kanto's Favourite", + }, + "MONO_GROUND": { + name: "Mono GROUND", + }, + "MONO_ROCK": { + name: "Brock Hard", + }, + "MONO_BUG": { + name: "Sting Like A Beedrill", + }, + "MONO_GHOST": { + name: "Who you gonna call?", + }, + "MONO_STEEL": { + name: "Mono STEEL", + }, + "MONO_FIRE": { + name: "Mono FIRE", + }, + "MONO_WATER": { + name: "When It Rains, It Pours", + }, + "MONO_GRASS": { + name: "Mono GRASS", + }, + "MONO_ELECTRIC": { + name: "Mono ELECTRIC", + }, + "MONO_PSYCHIC": { + name: "Mono PSYCHIC", + }, + "MONO_ICE": { + name: "Mono ICE", + }, + "MONO_DRAGON": { + name: "Mono DRAGON", + }, + "MONO_DARK": { + name: "It's just a phase", + }, + "MONO_FAIRY": { + name: "Mono FAIRY", + }, } as const; + +// Achievement translations for the when the player character is female (it for now uses the same translations as the male version) +export const PGFachv: AchievementTranslationEntries = PGMachv; diff --git a/src/locales/zh_TW/config.ts b/src/locales/zh_TW/config.ts index 098b1507eb4..49e82f3b436 100644 --- a/src/locales/zh_TW/config.ts +++ b/src/locales/zh_TW/config.ts @@ -1,6 +1,6 @@ import { ability } from "./ability"; import { abilityTriggers } from "./ability-trigger"; -import { achv } from "./achv"; +import { PGFachv, PGMachv } from "./achv"; import { battle } from "./battle"; import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; @@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler"; export const zhTwConfig = { ability: ability, abilityTriggers: abilityTriggers, - achv: achv, battle: battle, battleMessageUiHandler: battleMessageUiHandler, berry: berry, biome: biome, challenges: challenges, commandUiHandler: commandUiHandler, + PGMachv: PGMachv, + PGFachv: PGFachv, PGMdialogue: PGMdialogue, PGFdialogue: PGFdialogue, PGMbattleSpecDialogue: PGMbattleSpecDialogue, diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index f7b3f6bbae8..7910a1d1239 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -205,6 +205,7 @@ declare module "i18next" { biome: SimpleTranslationEntries; challenges: SimpleTranslationEntries; commandUiHandler: SimpleTranslationEntries; + PGMachv: AchievementTranslationEntries; PGMdialogue: DialogueTranslationEntries; PGMbattleSpecDialogue: SimpleTranslationEntries; PGMmiscDialogue: SimpleTranslationEntries; @@ -213,6 +214,7 @@ declare module "i18next" { PGFbattleSpecDialogue: SimpleTranslationEntries; PGFmiscDialogue: SimpleTranslationEntries; PGFdoubleBattleDialogue: DialogueTranslationEntries; + PGFachv: AchievementTranslationEntries; egg: SimpleTranslationEntries; fightUiHandler: SimpleTranslationEntries; gameMode: SimpleTranslationEntries; @@ -248,3 +250,4 @@ export function getIsInitialized(): boolean { } let isInitialized = false; + diff --git a/src/system/achv.ts b/src/system/achv.ts index c63e2101c18..f44ea2a9301 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -3,6 +3,8 @@ import BattleScene from "../battle-scene"; import { TurnHeldItemTransferModifier } from "../modifier/modifier"; import i18next from "../plugins/i18n"; import * as Utils from "../utils"; +import { PlayerGender } from "#app/data/enums/player-gender"; +import { ParseKeys } from "i18next"; import { Challenge, SingleGenerationChallenge, SingleTypeChallenge } from "#app/data/challenge.js"; export enum AchvTier { @@ -36,9 +38,15 @@ export class Achv { this.localizationKey = localizationKey; } - getName(): string { + /** + * Get the name of the achievement based on the gender of the player + * @param playerGender - the gender of the player + * @returns the name of the achievement localized for the player gender + */ + getName(playerGender: PlayerGender): string { + const prefix = playerGender === PlayerGender.FEMALE ?"PGF" : "PGM"; // Localization key is used to get the name of the achievement - return i18next.t(`achv:${this.localizationKey}.name`); + return i18next.t(`${prefix}achv:${this.localizationKey}.name` as ParseKeys); } getDescription(): string { @@ -140,105 +148,115 @@ export class ChallengeAchv extends Achv { * @returns The description of the achievement */ export function getAchievementDescription(localizationKey: string): string { + // We need to get the player gender from the game data to add the correct prefix to the achievement name + let playerGender = PlayerGender.MALE; + if (this?.scene) { + playerGender = this.scene.gameData.gender; + } + let genderPrefix = "PGM"; + if (playerGender === PlayerGender.FEMALE) { + genderPrefix = "PGF"; + } + switch (localizationKey) { case "10K_MONEY": - return i18next.t("achv:MoneyAchv.description", {"moneyAmount": achvs._10K_MONEY.moneyAmount.toLocaleString("en-US")}); + return i18next.t(`${genderPrefix}achv:MoneyAchv.description` as ParseKeys, {"moneyAmount": achvs._10K_MONEY.moneyAmount.toLocaleString("en-US")}); case "100K_MONEY": - return i18next.t("achv:MoneyAchv.description", {"moneyAmount": achvs._100K_MONEY.moneyAmount.toLocaleString("en-US")}); + return i18next.t(`${genderPrefix}achv:MoneyAchv.description` as ParseKeys, {"moneyAmount": achvs._100K_MONEY.moneyAmount.toLocaleString("en-US")}); case "1M_MONEY": - return i18next.t("achv:MoneyAchv.description", {"moneyAmount": achvs._1M_MONEY.moneyAmount.toLocaleString("en-US")}); + return i18next.t(`${genderPrefix}achv:MoneyAchv.description` as ParseKeys, {"moneyAmount": achvs._1M_MONEY.moneyAmount.toLocaleString("en-US")}); case "10M_MONEY": - return i18next.t("achv:MoneyAchv.description", {"moneyAmount": achvs._10M_MONEY.moneyAmount.toLocaleString("en-US")}); + return i18next.t(`${genderPrefix}achv:MoneyAchv.description` as ParseKeys, {"moneyAmount": achvs._10M_MONEY.moneyAmount.toLocaleString("en-US")}); case "250_DMG": - return i18next.t("achv:DamageAchv.description", {"damageAmount": achvs._250_DMG.damageAmount.toLocaleString("en-US")}); + return i18next.t(`${genderPrefix}achv:DamageAchv.description` as ParseKeys, {"damageAmount": achvs._250_DMG.damageAmount.toLocaleString("en-US")}); case "1000_DMG": - return i18next.t("achv:DamageAchv.description", {"damageAmount": achvs._1000_DMG.damageAmount.toLocaleString("en-US")}); + return i18next.t(`${genderPrefix}achv:DamageAchv.description` as ParseKeys, {"damageAmount": achvs._1000_DMG.damageAmount.toLocaleString("en-US")}); case "2500_DMG": - return i18next.t("achv:DamageAchv.description", {"damageAmount": achvs._2500_DMG.damageAmount.toLocaleString("en-US")}); + return i18next.t(`${genderPrefix}achv:DamageAchv.description` as ParseKeys, {"damageAmount": achvs._2500_DMG.damageAmount.toLocaleString("en-US")}); case "10000_DMG": - return i18next.t("achv:DamageAchv.description", {"damageAmount": achvs._10000_DMG.damageAmount.toLocaleString("en-US")}); + return i18next.t(`${genderPrefix}achv:DamageAchv.description` as ParseKeys, {"damageAmount": achvs._10000_DMG.damageAmount.toLocaleString("en-US")}); case "250_HEAL": - return i18next.t("achv:HealAchv.description", {"healAmount": achvs._250_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")}); + return i18next.t(`${genderPrefix}achv:HealAchv.description` as ParseKeys, {"healAmount": achvs._250_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")}); case "1000_HEAL": - return i18next.t("achv:HealAchv.description", {"healAmount": achvs._1000_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")}); + return i18next.t(`${genderPrefix}achv:HealAchv.description` as ParseKeys, {"healAmount": achvs._1000_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")}); case "2500_HEAL": - return i18next.t("achv:HealAchv.description", {"healAmount": achvs._2500_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")}); + return i18next.t(`${genderPrefix}achv:HealAchv.description` as ParseKeys, {"healAmount": achvs._2500_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")}); case "10000_HEAL": - return i18next.t("achv:HealAchv.description", {"healAmount": achvs._10000_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")}); + return i18next.t(`${genderPrefix}achv:HealAchv.description` as ParseKeys, {"healAmount": achvs._10000_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")}); case "LV_100": - return i18next.t("achv:LevelAchv.description", {"level": achvs.LV_100.level}); + return i18next.t(`${genderPrefix}achv:LevelAchv.description` as ParseKeys, {"level": achvs.LV_100.level}); case "LV_250": - return i18next.t("achv:LevelAchv.description", {"level": achvs.LV_250.level}); + return i18next.t(`${genderPrefix}achv:LevelAchv.description` as ParseKeys, {"level": achvs.LV_250.level}); case "LV_1000": - return i18next.t("achv:LevelAchv.description", {"level": achvs.LV_1000.level}); + return i18next.t(`${genderPrefix}achv:LevelAchv.description` as ParseKeys, {"level": achvs.LV_1000.level}); case "10_RIBBONS": - return i18next.t("achv:RibbonAchv.description", {"ribbonAmount": achvs._10_RIBBONS.ribbonAmount.toLocaleString("en-US")}); + return i18next.t(`${genderPrefix}achv:RibbonAchv.description` as ParseKeys, {"ribbonAmount": achvs._10_RIBBONS.ribbonAmount.toLocaleString("en-US")}); case "25_RIBBONS": - return i18next.t("achv:RibbonAchv.description", {"ribbonAmount": achvs._25_RIBBONS.ribbonAmount.toLocaleString("en-US")}); + return i18next.t(`${genderPrefix}achv:RibbonAchv.description` as ParseKeys, {"ribbonAmount": achvs._25_RIBBONS.ribbonAmount.toLocaleString("en-US")}); case "50_RIBBONS": - return i18next.t("achv:RibbonAchv.description", {"ribbonAmount": achvs._50_RIBBONS.ribbonAmount.toLocaleString("en-US")}); + return i18next.t(`${genderPrefix}achv:RibbonAchv.description` as ParseKeys, {"ribbonAmount": achvs._50_RIBBONS.ribbonAmount.toLocaleString("en-US")}); case "75_RIBBONS": - return i18next.t("achv:RibbonAchv.description", {"ribbonAmount": achvs._75_RIBBONS.ribbonAmount.toLocaleString("en-US")}); + return i18next.t(`${genderPrefix}achv:RibbonAchv.description` as ParseKeys, {"ribbonAmount": achvs._75_RIBBONS.ribbonAmount.toLocaleString("en-US")}); case "100_RIBBONS": - return i18next.t("achv:RibbonAchv.description", {"ribbonAmount": achvs._100_RIBBONS.ribbonAmount.toLocaleString("en-US")}); + return i18next.t(`${genderPrefix}achv:RibbonAchv.description` as ParseKeys, {"ribbonAmount": achvs._100_RIBBONS.ribbonAmount.toLocaleString("en-US")}); case "TRANSFER_MAX_BATTLE_STAT": - return i18next.t("achv:TRANSFER_MAX_BATTLE_STAT.description"); + return i18next.t(`${genderPrefix}achv:TRANSFER_MAX_BATTLE_STAT.description` as ParseKeys); case "MAX_FRIENDSHIP": - return i18next.t("achv:MAX_FRIENDSHIP.description"); + return i18next.t(`${genderPrefix}achv:MAX_FRIENDSHIP.description` as ParseKeys); case "MEGA_EVOLVE": - return i18next.t("achv:MEGA_EVOLVE.description"); + return i18next.t(`${genderPrefix}achv:MEGA_EVOLVE.description` as ParseKeys); case "GIGANTAMAX": - return i18next.t("achv:GIGANTAMAX.description"); + return i18next.t(`${genderPrefix}achv:GIGANTAMAX.description` as ParseKeys); case "TERASTALLIZE": - return i18next.t("achv:TERASTALLIZE.description"); + return i18next.t(`${genderPrefix}achv:TERASTALLIZE.description` as ParseKeys); case "STELLAR_TERASTALLIZE": - return i18next.t("achv:STELLAR_TERASTALLIZE.description"); + return i18next.t(`${genderPrefix}achv:STELLAR_TERASTALLIZE.description` as ParseKeys); case "SPLICE": - return i18next.t("achv:SPLICE.description"); + return i18next.t(`${genderPrefix}achv:SPLICE.description` as ParseKeys); case "MINI_BLACK_HOLE": - return i18next.t("achv:MINI_BLACK_HOLE.description"); + return i18next.t(`${genderPrefix}achv:MINI_BLACK_HOLE.description` as ParseKeys); case "CATCH_MYTHICAL": - return i18next.t("achv:CATCH_MYTHICAL.description"); + return i18next.t(`${genderPrefix}achv:CATCH_MYTHICAL.description` as ParseKeys); case "CATCH_SUB_LEGENDARY": - return i18next.t("achv:CATCH_SUB_LEGENDARY.description"); + return i18next.t(`${genderPrefix}achv:CATCH_SUB_LEGENDARY.description` as ParseKeys); case "CATCH_LEGENDARY": - return i18next.t("achv:CATCH_LEGENDARY.description"); + return i18next.t(`${genderPrefix}achv:CATCH_LEGENDARY.description` as ParseKeys); case "SEE_SHINY": - return i18next.t("achv:SEE_SHINY.description"); + return i18next.t(`${genderPrefix}achv:SEE_SHINY.description` as ParseKeys); case "SHINY_PARTY": - return i18next.t("achv:SHINY_PARTY.description"); + return i18next.t(`${genderPrefix}achv:SHINY_PARTY.description` as ParseKeys); case "HATCH_MYTHICAL": - return i18next.t("achv:HATCH_MYTHICAL.description"); + return i18next.t(`${genderPrefix}achv:HATCH_MYTHICAL.description` as ParseKeys); case "HATCH_SUB_LEGENDARY": - return i18next.t("achv:HATCH_SUB_LEGENDARY.description"); + return i18next.t(`${genderPrefix}achv:HATCH_SUB_LEGENDARY.description` as ParseKeys); case "HATCH_LEGENDARY": - return i18next.t("achv:HATCH_LEGENDARY.description"); + return i18next.t(`${genderPrefix}achv:HATCH_LEGENDARY.description` as ParseKeys); case "HATCH_SHINY": - return i18next.t("achv:HATCH_SHINY.description"); + return i18next.t(`${genderPrefix}achv:HATCH_SHINY.description` as ParseKeys); case "HIDDEN_ABILITY": - return i18next.t("achv:HIDDEN_ABILITY.description"); + return i18next.t(`${genderPrefix}achv:HIDDEN_ABILITY.description` as ParseKeys); case "PERFECT_IVS": - return i18next.t("achv:PERFECT_IVS.description"); + return i18next.t(`${genderPrefix}achv:PERFECT_IVS.description` as ParseKeys); case "CLASSIC_VICTORY": - return i18next.t("achv:CLASSIC_VICTORY.description"); + return i18next.t(`${genderPrefix}achv:CLASSIC_VICTORY.description` as ParseKeys); case "MONO_GEN_ONE": - return i18next.t("achv:MONO_GEN_ONE.description"); + return i18next.t(`${genderPrefix}achv:MONO_GEN_ONE.description` as ParseKeys); case "MONO_GEN_TWO": - return i18next.t("achv:MONO_GEN_TWO.description"); + return i18next.t(`${genderPrefix}achv:MONO_GEN_TWO.description` as ParseKeys); case "MONO_GEN_THREE": - return i18next.t("achv:MONO_GEN_THREE.description"); + return i18next.t(`${genderPrefix}achv:MONO_GEN_THREE.description` as ParseKeys); case "MONO_GEN_FOUR": - return i18next.t("achv:MONO_GEN_FOUR.description"); + return i18next.t(`${genderPrefix}achv:MONO_GEN_FOUR.description` as ParseKeys); case "MONO_GEN_FIVE": - return i18next.t("achv:MONO_GEN_FIVE.description"); + return i18next.t(`${genderPrefix}achv:MONO_GEN_FIVE.description` as ParseKeys); case "MONO_GEN_SIX": - return i18next.t("achv:MONO_GEN_SIX.description"); + return i18next.t(`${genderPrefix}achv:MONO_GEN_SIX.description` as ParseKeys); case "MONO_GEN_SEVEN": - return i18next.t("achv:MONO_GEN_SEVEN.description"); + return i18next.t(`${genderPrefix}achv:MONO_GEN_SEVEN.description` as ParseKeys); case "MONO_GEN_EIGHT": - return i18next.t("achv:MONO_GEN_EIGHT.description"); + return i18next.t(`${genderPrefix}achv:MONO_GEN_EIGHT.description` as ParseKeys); case "MONO_GEN_NINE": - return i18next.t("achv:MONO_GEN_NINE.description"); + return i18next.t(`${genderPrefix}achv:MONO_GEN_NINE.description` as ParseKeys); case "MONO_NORMAL": case "MONO_FIGHTING": case "MONO_FLYING": @@ -257,7 +275,7 @@ export function getAchievementDescription(localizationKey: string): string { case "MONO_DRAGON": case "MONO_DARK": case "MONO_FAIRY": - return i18next.t("achv:MonoType.description", {"type": i18next.t(`pokemonInfo:Type.${localizationKey.slice(5)}`)}); + return i18next.t(`${genderPrefix}achv:MonoType.description` as ParseKeys, {"type": i18next.t(`pokemonInfo:Type.${localizationKey.slice(5)}`)}); default: return ""; } @@ -285,26 +303,26 @@ export const achvs = { _50_RIBBONS: new RibbonAchv("50_RIBBONS","", 50, "ultra_ribbon", 50).setSecret(true), _75_RIBBONS: new RibbonAchv("75_RIBBONS","", 75, "rogue_ribbon", 75).setSecret(true), _100_RIBBONS: new RibbonAchv("100_RIBBONS","", 100, "master_ribbon", 100).setSecret(true), - TRANSFER_MAX_BATTLE_STAT: new Achv("TRANSFER_MAX_BATTLE_STAT","", "TRANSFER_MAX_BATTLE_STAT.description", "stick", 20), - MAX_FRIENDSHIP: new Achv("MAX_FRIENDSHIP", "", "MAX_FRIENDSHIP.description", "soothe_bell", 25), - MEGA_EVOLVE: new Achv("MEGA_EVOLVE", "", "MEGA_EVOLVE.description", "mega_bracelet", 50), - GIGANTAMAX: new Achv("GIGANTAMAX", "", "GIGANTAMAX.description", "dynamax_band", 50), - TERASTALLIZE: new Achv("TERASTALLIZE","", "TERASTALLIZE.description", "tera_orb", 25), - STELLAR_TERASTALLIZE: new Achv("STELLAR_TERASTALLIZE", "", "STELLAR_TERASTALLIZE.description", "stellar_tera_shard", 25).setSecret(true), - SPLICE: new Achv("SPLICE","", "SPLICE.description", "dna_splicers", 10), - MINI_BLACK_HOLE: new ModifierAchv("MINI_BLACK_HOLE","", "MINI_BLACK_HOLE.description", "mini_black_hole", 25, modifier => modifier instanceof TurnHeldItemTransferModifier).setSecret(), - CATCH_MYTHICAL: new Achv("CATCH_MYTHICAL","", "CATCH_MYTHICAL.description", "strange_ball", 50).setSecret(), - CATCH_SUB_LEGENDARY: new Achv("CATCH_SUB_LEGENDARY","", "CATCH_SUB_LEGENDARY.description", "rb", 75).setSecret(), - CATCH_LEGENDARY: new Achv("CATCH_LEGENDARY", "", "CATCH_LEGENDARY.description", "mb", 100).setSecret(), - SEE_SHINY: new Achv("SEE_SHINY", "", "SEE_SHINY.description", "pb_gold", 75), - SHINY_PARTY: new Achv("SHINY_PARTY", "", "SHINY_PARTY.description", "shiny_charm", 100).setSecret(true), - HATCH_MYTHICAL: new Achv("HATCH_MYTHICAL", "", "HATCH_MYTHICAL.description", "pair_of_tickets", 75).setSecret(), - HATCH_SUB_LEGENDARY: new Achv("HATCH_SUB_LEGENDARY","", "HATCH_SUB_LEGENDARY.description", "mystic_ticket", 100).setSecret(), - HATCH_LEGENDARY: new Achv("HATCH_LEGENDARY","", "HATCH_LEGENDARY.description", "mystic_ticket", 125).setSecret(), - HATCH_SHINY: new Achv("HATCH_SHINY","", "HATCH_SHINY.description", "golden_mystic_ticket", 100).setSecret(), - HIDDEN_ABILITY: new Achv("HIDDEN_ABILITY","", "HIDDEN_ABILITY.description", "ability_charm", 75), - PERFECT_IVS: new Achv("PERFECT_IVS","", "PERFECT_IVS.description", "blunder_policy", 100), - CLASSIC_VICTORY: new Achv("CLASSIC_VICTORY","", "CLASSIC_VICTORY.description", "relic_crown", 150), + TRANSFER_MAX_BATTLE_STAT: new Achv("TRANSFER_MAX_BATTLE_STAT","", "TRANSFER_MAX_BATTLE_STAT.description","stick", 20), + MAX_FRIENDSHIP: new Achv("MAX_FRIENDSHIP", "", "MAX_FRIENDSHIP.description","soothe_bell", 25), + MEGA_EVOLVE: new Achv("MEGA_EVOLVE", "", "MEGA_EVOLVE.description","mega_bracelet", 50), + GIGANTAMAX: new Achv("GIGANTAMAX", "", "GIGANTAMAX.description","dynamax_band", 50), + TERASTALLIZE: new Achv("TERASTALLIZE","", "TERASTALLIZE.description","tera_orb", 25), + STELLAR_TERASTALLIZE: new Achv("STELLAR_TERASTALLIZE", "", "STELLAR_TERASTALLIZE.description","stellar_tera_shard", 25).setSecret(true), + SPLICE: new Achv("SPLICE","", "SPLICE.description","dna_splicers", 10), + MINI_BLACK_HOLE: new ModifierAchv("MINI_BLACK_HOLE","", "MINI_BLACK_HOLE.description","mini_black_hole", 25, modifier => modifier instanceof TurnHeldItemTransferModifier).setSecret(), + CATCH_MYTHICAL: new Achv("CATCH_MYTHICAL","", "CATCH_MYTHICAL.description","strange_ball", 50).setSecret(), + CATCH_SUB_LEGENDARY: new Achv("CATCH_SUB_LEGENDARY","", "CATCH_SUB_LEGENDARY.description","rb", 75).setSecret(), + CATCH_LEGENDARY: new Achv("CATCH_LEGENDARY", "", "CATCH_LEGENDARY.description","mb", 100).setSecret(), + SEE_SHINY: new Achv("SEE_SHINY", "", "SEE_SHINY.description","pb_gold", 75), + SHINY_PARTY: new Achv("SHINY_PARTY", "", "SHINY_PARTY.description","shiny_charm", 100).setSecret(true), + HATCH_MYTHICAL: new Achv("HATCH_MYTHICAL", "", "HATCH_MYTHICAL.description","pair_of_tickets", 75).setSecret(), + HATCH_SUB_LEGENDARY: new Achv("HATCH_SUB_LEGENDARY","", "HATCH_SUB_LEGENDARY.description","mystic_ticket", 100).setSecret(), + HATCH_LEGENDARY: new Achv("HATCH_LEGENDARY","", "HATCH_LEGENDARY.description","mystic_ticket", 125).setSecret(), + HATCH_SHINY: new Achv("HATCH_SHINY","", "HATCH_SHINY.description","golden_mystic_ticket", 100).setSecret(), + HIDDEN_ABILITY: new Achv("HIDDEN_ABILITY","", "HIDDEN_ABILITY.description","ability_charm", 75), + PERFECT_IVS: new Achv("PERFECT_IVS","", "PERFECT_IVS.description","blunder_policy", 100), + CLASSIC_VICTORY: new Achv("CLASSIC_VICTORY","", "CLASSIC_VICTORY.description","relic_crown", 150), MONO_GEN_ONE_VICTORY: new ChallengeAchv("MONO_GEN_ONE","", "MONO_GEN_ONE.description", "mystic_ticket", 100, c => c instanceof SingleGenerationChallenge && c.value === 1), MONO_GEN_TWO_VICTORY: new ChallengeAchv("MONO_GEN_TWO","", "MONO_GEN_TWO.description", "mystic_ticket", 100, c => c instanceof SingleGenerationChallenge && c.value === 2), MONO_GEN_THREE_VICTORY: new ChallengeAchv("MONO_GEN_THREE","", "MONO_GEN_THREE.description", "mystic_ticket", 100, c => c instanceof SingleGenerationChallenge && c.value === 3), diff --git a/src/system/voucher.ts b/src/system/voucher.ts index ba42b99d294..f5c6a5eeacf 100644 --- a/src/system/voucher.ts +++ b/src/system/voucher.ts @@ -2,6 +2,7 @@ import BattleScene from "../battle-scene"; import { TrainerType } from "../data/enums/trainer-type"; import i18next from "../plugins/i18n"; import { Achv, AchvTier, achvs, getAchievementDescription } from "./achv"; +import { PlayerGender } from "#app/data/enums/player-gender"; export enum VoucherType { REGULAR, @@ -27,7 +28,12 @@ export class Voucher { return !this.conditionFunc || this.conditionFunc(scene, args); } - getName(): string { + /** + * Get the name of the voucher + * @param playerGender - this is ignored here. It's only there to match the signature of the function in the Achv class + * @returns the name of the voucher + */ + getName(playerGender: PlayerGender): string { return getVoucherTypeName(this.voucherType); } diff --git a/src/ui/achv-bar.ts b/src/ui/achv-bar.ts index f24fda0792b..9e9b20795e3 100644 --- a/src/ui/achv-bar.ts +++ b/src/ui/achv-bar.ts @@ -2,6 +2,7 @@ import BattleScene from "../battle-scene"; import { Achv, getAchievementDescription } from "../system/achv"; import { Voucher } from "../system/voucher"; import { TextStyle, addTextObject } from "./text"; +import { PlayerGender } from "#app/data/enums/player-gender"; export default class AchvBar extends Phaser.GameObjects.Container { private defaultWidth: number; @@ -14,11 +15,13 @@ export default class AchvBar extends Phaser.GameObjects.Container { private descriptionText: Phaser.GameObjects.Text; private queue: (Achv | Voucher)[] = []; + private playerGender: PlayerGender; public shown: boolean; constructor(scene: BattleScene) { super(scene, scene.game.canvas.width / 6, 0); + this.playerGender = scene.gameData.gender; } setup(): void { @@ -64,7 +67,7 @@ export default class AchvBar extends Phaser.GameObjects.Container { this.bg.setTexture(`achv_bar${tier ? `_${tier + 1}` : ""}`); this.icon.setFrame(achv.getIconImage()); - this.titleText.setText(achv.getName()); + this.titleText.setText(achv.getName(this.playerGender)); this.scoreText.setVisible(achv instanceof Achv); if (achv instanceof Achv) { this.descriptionText.setText(getAchievementDescription((achv as Achv).localizationKey)); @@ -96,13 +99,13 @@ export default class AchvBar extends Phaser.GameObjects.Container { ease: "Sine.easeOut" }); - this.scene.time.delayedCall(10000, () => this.hide()); + this.scene.time.delayedCall(10000, () => this.hide(this.playerGender)); this.setVisible(true); this.shown = true; } - protected hide(): void { + protected hide(playerGender: PlayerGender): void { if (!this.shown) { return; } diff --git a/src/ui/achvs-ui-handler.ts b/src/ui/achvs-ui-handler.ts index a73f7560282..464a967cbfd 100644 --- a/src/ui/achvs-ui-handler.ts +++ b/src/ui/achvs-ui-handler.ts @@ -3,9 +3,11 @@ import { Button } from "../enums/buttons"; import i18next from "../plugins/i18n"; import { Achv, achvs, getAchievementDescription } from "../system/achv"; import MessageUiHandler from "./message-ui-handler"; -import { TextStyle, addTextObject } from "./text"; +import { addTextObject, TextStyle } from "./text"; import { Mode } from "./ui"; import { addWindow } from "./ui-theme"; +import { PlayerGender } from "#app/data/enums/player-gender"; +import { ParseKeys } from "i18next"; export default class AchvsUiHandler extends MessageUiHandler { private achvsContainer: Phaser.GameObjects.Container; @@ -33,7 +35,14 @@ export default class AchvsUiHandler extends MessageUiHandler { const headerBg = addWindow(this.scene, 0, 0, (this.scene.game.canvas.width / 6) - 2, 24); headerBg.setOrigin(0, 0); - const headerText = addTextObject(this.scene, 0, 0, i18next.t("achv:Achievements.name"), TextStyle.SETTINGS_LABEL); + // We need to get the player gender from the game data to add the correct prefix to the achievement name + const playerGender = this.scene.gameData.gender; + let genderPrefix = "PGM"; + if (playerGender === PlayerGender.FEMALE) { + genderPrefix = "PGF"; + } + + const headerText = addTextObject(this.scene, 0, 0, i18next.t(`${genderPrefix}achv:Achievements.name` as ParseKeys), TextStyle.SETTINGS_LABEL); headerText.setOrigin(0, 0); headerText.setPositionRelative(headerBg, 8, 4); @@ -137,7 +146,14 @@ export default class AchvsUiHandler extends MessageUiHandler { } protected showAchv(achv: Achv) { - achv.name = i18next.t(`achv:${achv.localizationKey}.name`); + // We need to get the player gender from the game data to add the correct prefix to the achievement name + const playerGender = this.scene.gameData.gender; + let genderPrefix = "PGM"; + if (playerGender === PlayerGender.FEMALE) { + genderPrefix = "PGF"; + } + + achv.name = i18next.t(`${genderPrefix}achv:${achv.localizationKey}.name` as ParseKeys); achv.description = getAchievementDescription(achv.localizationKey); const achvUnlocks = this.scene.gameData.achvUnlocks; const unlocked = achvUnlocks.hasOwnProperty(achv.id); @@ -145,7 +161,7 @@ export default class AchvsUiHandler extends MessageUiHandler { this.titleText.setText(unlocked ? achv.name : "???"); this.showText(!hidden ? achv.description : ""); this.scoreText.setText(`${achv.score}pt`); - this.unlockText.setText(unlocked ? new Date(achvUnlocks[achv.id]).toLocaleDateString() : i18next.t("achv:Locked.name")); + this.unlockText.setText(unlocked ? new Date(achvUnlocks[achv.id]).toLocaleDateString() : i18next.t(`${genderPrefix}achv:Locked.name` as ParseKeys)); } processInput(button: Button): boolean {