From 35cf80705e919779dc32803903d1b89401f8dd8f Mon Sep 17 00:00:00 2001 From: fabske0 <192151969+fabske0@users.noreply.github.com> Date: Tue, 12 Aug 2025 13:56:06 +0200 Subject: [PATCH] change biome locales uses --- src/data/balance/biomes.ts | 9 +++++---- src/ui/pokedex-page-ui-handler.ts | 14 +++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/data/balance/biomes.ts b/src/data/balance/biomes.ts index d8297636393..c0c57cb15fb 100644 --- a/src/data/balance/biomes.ts +++ b/src/data/balance/biomes.ts @@ -7,6 +7,7 @@ import { TimeOfDay } from "#enums/time-of-day"; import { TrainerType } from "#enums/trainer-type"; import { randSeedInt } from "#utils/common"; import { getEnumValues } from "#utils/enums"; +import { toCamelCase } from "#utils/strings"; import i18next from "i18next"; export function getBiomeName(biome: BiomeId | -1) { @@ -15,13 +16,13 @@ export function getBiomeName(biome: BiomeId | -1) { } switch (biome) { case BiomeId.GRASS: - return i18next.t("biome:GRASS"); + return i18next.t("biome:grass"); case BiomeId.RUINS: - return i18next.t("biome:RUINS"); + return i18next.t("biome:ruins"); case BiomeId.END: - return i18next.t("biome:END"); + return i18next.t("biome:end"); default: - return i18next.t(`biome:${BiomeId[biome].toUpperCase()}`); + return i18next.t(`biome:${toCamelCase(BiomeId[biome])}`); } } diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index 49658d9cfc9..2623eaa9097 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -57,7 +57,7 @@ import { addWindow } from "#ui/ui-theme"; import { BooleanHolder, getLocalizedSpriteKey, isNullOrUndefined, padInt, rgbHexToRgba } from "#utils/common"; import { getEnumValues } from "#utils/enums"; import { getPokemonSpecies, getPokemonSpeciesForm } from "#utils/pokemon-utils"; -import { toTitleCase } from "#utils/strings"; +import { toCamelCase, toTitleCase } from "#utils/strings"; import { argbFromRgba } from "@material/material-color-utilities"; import i18next from "i18next"; import type BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText"; @@ -1517,13 +1517,13 @@ export class PokedexPageUiHandler extends MessageUiHandler { this.biomes.map(b => { options.push({ label: - i18next.t(`biome:${BiomeId[b.biome].toUpperCase()}`) + + i18next.t(`biome:${toCamelCase(BiomeId[b.biome])}`) + " - " + - i18next.t(`biome:${BiomePoolTier[b.tier].toUpperCase()}`) + + i18next.t(`biome:${toCamelCase(BiomePoolTier[b.tier])}`) + (b.tod.length === 1 && b.tod[0] === -1 ? "" : " (" + - b.tod.map(tod => i18next.t(`biome:${TimeOfDay[tod].toUpperCase()}`)).join(", ") + + b.tod.map(tod => i18next.t(`biome:${toCamelCase(TimeOfDay[tod])}`)).join(", ") + ")"), handler: () => false, }); @@ -1538,13 +1538,13 @@ export class PokedexPageUiHandler extends MessageUiHandler { this.preBiomes.map(b => { options.push({ label: - i18next.t(`biome:${BiomeId[b.biome].toUpperCase()}`) + + i18next.t(`biome:${toCamelCase(BiomeId[b.biome])}`) + " - " + - i18next.t(`biome:${BiomePoolTier[b.tier].toUpperCase()}`) + + i18next.t(`biome:${toCamelCase(BiomePoolTier[b.tier])}`) + (b.tod.length === 1 && b.tod[0] === -1 ? "" : " (" + - b.tod.map(tod => i18next.t(`biome:${TimeOfDay[tod].toUpperCase()}`)).join(", ") + + b.tod.map(tod => i18next.t(`biome:${toCamelCase(TimeOfDay[tod])}`)).join(", ") + ")"), handler: () => false, });