This commit is contained in:
fabske0 2025-08-15 19:39:09 +02:00 committed by GitHub
commit 3359b76952
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 12 deletions

View File

@ -3,7 +3,7 @@ import { EFFECTIVE_STATS, getShortenedStatKey, Stat } from "#enums/stat";
import { TextStyle } from "#enums/text-style"; import { TextStyle } from "#enums/text-style";
import { UiTheme } from "#enums/ui-theme"; import { UiTheme } from "#enums/ui-theme";
import { getBBCodeFrag } from "#ui/text"; import { getBBCodeFrag } from "#ui/text";
import { toTitleCase } from "#utils/strings"; import { toCamelCase } from "#utils/strings";
import i18next from "i18next"; import i18next from "i18next";
export function getNatureName( export function getNatureName(
@ -13,7 +13,7 @@ export function getNatureName(
ignoreBBCode = false, ignoreBBCode = false,
uiTheme: UiTheme = UiTheme.DEFAULT, uiTheme: UiTheme = UiTheme.DEFAULT,
): string { ): string {
let ret = toTitleCase(Nature[nature]); let ret = toCamelCase(Nature[nature]);
//Translating nature //Translating nature
if (i18next.exists(`nature:${ret}`)) { if (i18next.exists(`nature:${ret}`)) {
ret = i18next.t(`nature:${ret}` as any); ret = i18next.t(`nature:${ret}` as any);

View File

@ -31,14 +31,14 @@ export class ConfirmUiHandler extends AbstractOptionSelectUiHandler {
const config: OptionSelectConfig = { const config: OptionSelectConfig = {
options: [ options: [
{ {
label: i18next.t("partyUiHandler:SUMMARY"), label: i18next.t("partyUiHandler:summary"),
handler: () => { handler: () => {
args[0](); args[0]();
return true; return true;
}, },
}, },
{ {
label: i18next.t("partyUiHandler:POKEDEX"), label: i18next.t("partyUiHandler:pokedex"),
handler: () => { handler: () => {
args[1](); args[1]();
return true; return true;

View File

@ -27,7 +27,7 @@ import { addBBCodeTextObject, addTextObject, getTextColor } from "#ui/text";
import { addWindow } from "#ui/ui-theme"; import { addWindow } from "#ui/ui-theme";
import { applyChallenges } from "#utils/challenge-utils"; import { applyChallenges } from "#utils/challenge-utils";
import { BooleanHolder, getLocalizedSpriteKey, randInt } from "#utils/common"; import { BooleanHolder, getLocalizedSpriteKey, randInt } from "#utils/common";
import { toTitleCase } from "#utils/strings"; import { toCamelCase, toTitleCase } from "#utils/strings";
import i18next from "i18next"; import i18next from "i18next";
import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
@ -1573,12 +1573,12 @@ export class PartyUiHandler extends MessageUiHandler {
const formChangeItemModifiers = this.getFormChangeItemsModifiers(pokemon); const formChangeItemModifiers = this.getFormChangeItemsModifiers(pokemon);
if (formChangeItemModifiers && option >= PartyOption.FORM_CHANGE_ITEM) { if (formChangeItemModifiers && option >= PartyOption.FORM_CHANGE_ITEM) {
const modifier = 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) { } 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 { } else {
if (this.localizedOptions.includes(option)) { if (this.localizedOptions.includes(option)) {
optionName = i18next.t(`partyUiHandler:${PartyOption[option]}`); optionName = i18next.t(`partyUiHandler:${toCamelCase(PartyOption[option])}`);
} else { } else {
optionName = toTitleCase(PartyOption[option]); optionName = toTitleCase(PartyOption[option]);
} }
@ -1595,7 +1595,7 @@ export class PartyUiHandler extends MessageUiHandler {
.getLevelMoves() .getLevelMoves()
.find(plm => plm[1] === move); .find(plm => plm[1] === move);
} else if (option === PartyOption.ALL) { } else if (option === PartyOption.ALL) {
optionName = i18next.t("partyUiHandler:ALL"); optionName = i18next.t("partyUiHandler:all");
} else { } else {
const itemModifiers = this.getItemModifiers(pokemon); const itemModifiers = this.getItemModifiers(pokemon);
const itemModifier = itemModifiers[option]; const itemModifier = itemModifiers[option];
@ -2190,7 +2190,7 @@ class PartyDiscardModeButton extends Phaser.GameObjects.Container {
setup(party: PartyUiHandler) { setup(party: PartyUiHandler) {
this.transferIcon = globalScene.add.sprite(0, 0, "party_transfer"); this.transferIcon = globalScene.add.sprite(0, 0, "party_transfer");
this.discardIcon = globalScene.add.sprite(0, 0, "party_discard"); 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.party = party;
this.add(this.transferIcon); this.add(this.transferIcon);
@ -2238,14 +2238,14 @@ class PartyDiscardModeButton extends Phaser.GameObjects.Container {
this.transferIcon.setVisible(true); this.transferIcon.setVisible(true);
this.discardIcon.setVisible(false); this.discardIcon.setVisible(false);
this.textBox.setVisible(true); 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; this.transferIcon.displayWidth = this.textBox.text.length * 9 + 3;
break; break;
case PartyUiMode.DISCARD: case PartyUiMode.DISCARD:
this.transferIcon.setVisible(false); this.transferIcon.setVisible(false);
this.discardIcon.setVisible(true); this.discardIcon.setVisible(true);
this.textBox.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; this.discardIcon.displayWidth = this.textBox.text.length * 9 + 3;
break; break;
} }