Compare commits

...

3 Commits

Author SHA1 Message Date
fabske0
3359b76952
Merge c884de339a into 19af9bdb8b 2025-08-15 19:39:09 +02:00
fabske0
c884de339a chnage party ui locales use 2025-08-15 16:11:00 +02:00
fabske0
1b57ee0959 chnage nature locales use 2025-08-14 21:51:09 +02:00
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 { UiTheme } from "#enums/ui-theme";
import { getBBCodeFrag } from "#ui/text";
import { toTitleCase } from "#utils/strings";
import { toCamelCase } from "#utils/strings";
import i18next from "i18next";
export function getNatureName(
@ -13,7 +13,7 @@ export function getNatureName(
ignoreBBCode = false,
uiTheme: UiTheme = UiTheme.DEFAULT,
): string {
let ret = toTitleCase(Nature[nature]);
let ret = toCamelCase(Nature[nature]);
//Translating nature
if (i18next.exists(`nature:${ret}`)) {
ret = i18next.t(`nature:${ret}` as any);

View File

@ -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;

View File

@ -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];
@ -2190,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);
@ -2238,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;
}