From c884de339ae807bbae237265a03ceff3c7b071dc Mon Sep 17 00:00:00 2001 From: fabske0 <192151969+fabske0@users.noreply.github.com> Date: Fri, 15 Aug 2025 16:11:00 +0200 Subject: [PATCH] chnage party ui locales use --- src/ui/confirm-ui-handler.ts | 4 ++-- src/ui/party-ui-handler.ts | 23 ++++++++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/ui/confirm-ui-handler.ts b/src/ui/confirm-ui-handler.ts index 49e88556f1b..529d1bd8bbb 100644 --- a/src/ui/confirm-ui-handler.ts +++ b/src/ui/confirm-ui-handler.ts @@ -31,14 +31,14 @@ export class ConfirmUiHandler extends AbstractOptionSelectUiHandler { const config: OptionSelectConfig = { options: [ { - label: i18next.t("partyUiHandler:SUMMARY"), + label: i18next.t("partyUiHandler:summary"), handler: () => { args[0](); return true; }, }, { - label: i18next.t("partyUiHandler:POKEDEX"), + label: i18next.t("partyUiHandler:pokedex"), handler: () => { args[1](); return true; diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index 566eeee4e44..6ca134ebd75 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -27,7 +27,7 @@ import { addBBCodeTextObject, addTextObject, getTextColor } from "#ui/text"; import { addWindow } from "#ui/ui-theme"; import { applyChallenges } from "#utils/challenge-utils"; import { BooleanHolder, getLocalizedSpriteKey, randInt } from "#utils/common"; -import { toTitleCase } from "#utils/strings"; +import { toCamelCase, toTitleCase } from "#utils/strings"; import i18next from "i18next"; import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; @@ -1573,12 +1573,12 @@ export class PartyUiHandler extends MessageUiHandler { const formChangeItemModifiers = this.getFormChangeItemsModifiers(pokemon); if (formChangeItemModifiers && option >= PartyOption.FORM_CHANGE_ITEM) { const modifier = formChangeItemModifiers[option - PartyOption.FORM_CHANGE_ITEM]; - optionName = `${modifier.active ? i18next.t("partyUiHandler:DEACTIVATE") : i18next.t("partyUiHandler:ACTIVATE")} ${modifier.type.name}`; + optionName = `${modifier.active ? i18next.t("partyUiHandler:deactivate") : i18next.t("partyUiHandler:activate")} ${modifier.type.name}`; } else if (option === PartyOption.UNPAUSE_EVOLUTION) { - optionName = `${pokemon.pauseEvolutions ? i18next.t("partyUiHandler:UNPAUSE_EVOLUTION") : i18next.t("partyUiHandler:PAUSE_EVOLUTION")}`; + optionName = `${pokemon.pauseEvolutions ? i18next.t("partyUiHandler:unpausedEvolution") : i18next.t("partyUiHandler:pauseEvolution")}`; } else { if (this.localizedOptions.includes(option)) { - optionName = i18next.t(`partyUiHandler:${PartyOption[option]}`); + optionName = i18next.t(`partyUiHandler:${toCamelCase(PartyOption[option])}`); } else { optionName = toTitleCase(PartyOption[option]); } @@ -1595,7 +1595,7 @@ export class PartyUiHandler extends MessageUiHandler { .getLevelMoves() .find(plm => plm[1] === move); } else if (option === PartyOption.ALL) { - optionName = i18next.t("partyUiHandler:ALL"); + optionName = i18next.t("partyUiHandler:all"); } else { const itemModifiers = this.getItemModifiers(pokemon); const itemModifier = itemModifiers[option]; @@ -2142,7 +2142,12 @@ class PartyCancelButton extends Phaser.GameObjects.Container { this.partyCancelPb = partyCancelPb; - const partyCancelText = addTextObject(-10, -7, i18next.t("partyUiHandler:cancel"), TextStyle.PARTY_CANCEL_BUTTON); + const partyCancelText = addTextObject( + -10, + -7, + i18next.t("partyUiHandler:cancelButton"), + TextStyle.PARTY_CANCEL_BUTTON, + ); this.add(partyCancelText); } @@ -2185,7 +2190,7 @@ class PartyDiscardModeButton extends Phaser.GameObjects.Container { setup(party: PartyUiHandler) { this.transferIcon = globalScene.add.sprite(0, 0, "party_transfer"); this.discardIcon = globalScene.add.sprite(0, 0, "party_discard"); - this.textBox = addTextObject(-8, -7, i18next.t("partyUiHandler:TRANSFER"), TextStyle.PARTY); + this.textBox = addTextObject(-8, -7, i18next.t("partyUiHandler:transfer"), TextStyle.PARTY); this.party = party; this.add(this.transferIcon); @@ -2233,14 +2238,14 @@ class PartyDiscardModeButton extends Phaser.GameObjects.Container { this.transferIcon.setVisible(true); this.discardIcon.setVisible(false); this.textBox.setVisible(true); - this.textBox.setText(i18next.t("partyUiHandler:TRANSFER")); + this.textBox.setText(i18next.t("partyUiHandler:transfer")); this.transferIcon.displayWidth = this.textBox.text.length * 9 + 3; break; case PartyUiMode.DISCARD: this.transferIcon.setVisible(false); this.discardIcon.setVisible(true); this.textBox.setVisible(true); - this.textBox.setText(i18next.t("partyUiHandler:DISCARD")); + this.textBox.setText(i18next.t("partyUiHandler:discard")); this.discardIcon.displayWidth = this.textBox.text.length * 9 + 3; break; }