diff --git a/src/locales/de/config.ts b/src/locales/de/config.ts index 50cf09181fa..36fe8854e28 100644 --- a/src/locales/de/config.ts +++ b/src/locales/de/config.ts @@ -32,6 +32,7 @@ import { } from "./dialogue"; import { biome } from "./biome"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const deConfig = { ability: ability, @@ -69,5 +70,6 @@ export const deConfig = { PGMmiscDialogue: PGMmiscDialogue, PGFmiscDialogue: PGFmiscDialogue, PGMdoubleBattleDialogue: PGMdoubleBattleDialogue, - PGFdoubleBattleDialogue: PGFdoubleBattleDialogue + PGFdoubleBattleDialogue: PGFdoubleBattleDialogue, + modifierSelectUiHandler: modifierSelectUiHandler }; diff --git a/src/locales/de/modifier-select-ui-handler.ts b/src/locales/de/modifier-select-ui-handler.ts new file mode 100644 index 00000000000..7f9bf45c197 --- /dev/null +++ b/src/locales/de/modifier-select-ui-handler.ts @@ -0,0 +1,12 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "Transfer", + "reroll": "Reroll", + "lockRarities": "Lock Rarities", + "transferDesc": "Transfer a held item from one Pokémon to another.", + "rerollDesc": "Spend money to reroll your item options.", + "lockRaritiesDesc": "Lock item rarities on reroll (affects reroll cost).", + "rerollCost": "₽{{cost}}", + "itemCost": "₽{{cost}}" +} as const; diff --git a/src/locales/en/config.ts b/src/locales/en/config.ts index d01102bc3a4..a50ca747fcb 100644 --- a/src/locales/en/config.ts +++ b/src/locales/en/config.ts @@ -32,6 +32,7 @@ import { } from "./dialogue"; import { biome } from "./biome"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const enConfig = { ability: ability, @@ -69,5 +70,6 @@ export const enConfig = { PGMmiscDialogue: PGMmiscDialogue, PGFmiscDialogue: PGFmiscDialogue, PGMdoubleBattleDialogue: PGMdoubleBattleDialogue, - PGFdoubleBattleDialogue: PGFdoubleBattleDialogue + PGFdoubleBattleDialogue: PGFdoubleBattleDialogue, + modifierSelectUiHandler: modifierSelectUiHandler }; diff --git a/src/locales/en/modifier-select-ui-handler.ts b/src/locales/en/modifier-select-ui-handler.ts new file mode 100644 index 00000000000..7f9bf45c197 --- /dev/null +++ b/src/locales/en/modifier-select-ui-handler.ts @@ -0,0 +1,12 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "Transfer", + "reroll": "Reroll", + "lockRarities": "Lock Rarities", + "transferDesc": "Transfer a held item from one Pokémon to another.", + "rerollDesc": "Spend money to reroll your item options.", + "lockRaritiesDesc": "Lock item rarities on reroll (affects reroll cost).", + "rerollCost": "₽{{cost}}", + "itemCost": "₽{{cost}}" +} as const; diff --git a/src/locales/es/config.ts b/src/locales/es/config.ts index 2f33cd680ae..a12648b1833 100644 --- a/src/locales/es/config.ts +++ b/src/locales/es/config.ts @@ -32,6 +32,7 @@ import { } from "./dialogue"; import { biome } from "./biome"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const esConfig = { ability: ability, @@ -69,5 +70,6 @@ export const esConfig = { PGMmiscDialogue: PGMmiscDialogue, PGFmiscDialogue: PGFmiscDialogue, PGMdoubleBattleDialogue: PGMdoubleBattleDialogue, - PGFdoubleBattleDialogue: PGFdoubleBattleDialogue + PGFdoubleBattleDialogue: PGFdoubleBattleDialogue, + modifierSelectUiHandler: modifierSelectUiHandler }; diff --git a/src/locales/es/modifier-select-ui-handler.ts b/src/locales/es/modifier-select-ui-handler.ts new file mode 100644 index 00000000000..7f9bf45c197 --- /dev/null +++ b/src/locales/es/modifier-select-ui-handler.ts @@ -0,0 +1,12 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "Transfer", + "reroll": "Reroll", + "lockRarities": "Lock Rarities", + "transferDesc": "Transfer a held item from one Pokémon to another.", + "rerollDesc": "Spend money to reroll your item options.", + "lockRaritiesDesc": "Lock item rarities on reroll (affects reroll cost).", + "rerollCost": "₽{{cost}}", + "itemCost": "₽{{cost}}" +} as const; diff --git a/src/locales/fr/config.ts b/src/locales/fr/config.ts index f7f7201ddd7..a1176f3d12f 100644 --- a/src/locales/fr/config.ts +++ b/src/locales/fr/config.ts @@ -32,6 +32,7 @@ import { } from "./dialogue"; import { biome } from "./biome"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const frConfig = { ability: ability, @@ -69,5 +70,6 @@ export const frConfig = { PGMmiscDialogue: PGMmiscDialogue, PGFmiscDialogue: PGFmiscDialogue, PGMdoubleBattleDialogue: PGMdoubleBattleDialogue, - PGFdoubleBattleDialogue: PGFdoubleBattleDialogue + PGFdoubleBattleDialogue: PGFdoubleBattleDialogue, + modifierSelectUiHandler: modifierSelectUiHandler }; diff --git a/src/locales/fr/modifier-select-ui-handler.ts b/src/locales/fr/modifier-select-ui-handler.ts new file mode 100644 index 00000000000..2c46233d594 --- /dev/null +++ b/src/locales/fr/modifier-select-ui-handler.ts @@ -0,0 +1,12 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "Transférer", + "reroll": "Relancer", + "lockRarities": "Bloquer la rareté", + "transferDesc": "Transférer un objet tenu par un Pokémon vers un autre.", + "rerollDesc": "Payer pour relancer les objets gratuits proposés.", + "lockRaritiesDesc": "La relance proposera des objets gratuits de rareté\négale ou supérieure. Affecte le cout de relance.", + "rerollCost": "{{cost}} ₽", + "itemCost": "{{cost}} ₽" +} as const; diff --git a/src/locales/it/config.ts b/src/locales/it/config.ts index 5f76e4d4205..b94880c6293 100644 --- a/src/locales/it/config.ts +++ b/src/locales/it/config.ts @@ -32,6 +32,7 @@ import { } from "./dialogue"; import { biome } from "./biome"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const itConfig = { ability: ability, @@ -69,5 +70,6 @@ export const itConfig = { PGMmiscDialogue: PGMmiscDialogue, PGFmiscDialogue: PGFmiscDialogue, PGMdoubleBattleDialogue: PGMdoubleBattleDialogue, - PGFdoubleBattleDialogue: PGFdoubleBattleDialogue + PGFdoubleBattleDialogue: PGFdoubleBattleDialogue, + modifierSelectUiHandler: modifierSelectUiHandler }; diff --git a/src/locales/it/modifier-select-ui-handler.ts b/src/locales/it/modifier-select-ui-handler.ts new file mode 100644 index 00000000000..7f9bf45c197 --- /dev/null +++ b/src/locales/it/modifier-select-ui-handler.ts @@ -0,0 +1,12 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "Transfer", + "reroll": "Reroll", + "lockRarities": "Lock Rarities", + "transferDesc": "Transfer a held item from one Pokémon to another.", + "rerollDesc": "Spend money to reroll your item options.", + "lockRaritiesDesc": "Lock item rarities on reroll (affects reroll cost).", + "rerollCost": "₽{{cost}}", + "itemCost": "₽{{cost}}" +} as const; diff --git a/src/locales/ko/config.ts b/src/locales/ko/config.ts index 3de0e3275c2..b3d1537a4e4 100644 --- a/src/locales/ko/config.ts +++ b/src/locales/ko/config.ts @@ -32,7 +32,7 @@ import { } from "./dialogue"; import { biome } from "./biome"; import { pokemonInfoContainer } from "./pokemon-info-container"; - +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const koConfig = { ability: ability, @@ -70,5 +70,6 @@ export const koConfig = { PGMmiscDialogue: PGMmiscDialogue, PGFmiscDialogue: PGFmiscDialogue, PGMdoubleBattleDialogue: PGMdoubleBattleDialogue, - PGFdoubleBattleDialogue: PGFdoubleBattleDialogue + PGFdoubleBattleDialogue: PGFdoubleBattleDialogue, + modifierSelectUiHandler: modifierSelectUiHandler }; diff --git a/src/locales/ko/modifier-select-ui-handler.ts b/src/locales/ko/modifier-select-ui-handler.ts new file mode 100644 index 00000000000..b578319bb01 --- /dev/null +++ b/src/locales/ko/modifier-select-ui-handler.ts @@ -0,0 +1,12 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "도구 이동", + "reroll": "새로고침", + "lockRarities": "레어도 고정", + "transferDesc": "포켓몬이 지닌 도구를 다른 포켓몬에게 옮깁니다.", + "rerollDesc": "소지금을 사용하여 선택 가능한 도구들을 새로고침합니다.", + "lockRaritiesDesc": "새로고침할 때 도구 레어도를 고정합니다(새로고침 비용 상승함).", + "rerollCost": "₽{{cost}}", + "itemCost": "₽{{cost}}" +} as const; diff --git a/src/locales/pt_BR/config.ts b/src/locales/pt_BR/config.ts index ae43e0aba75..d5476054155 100644 --- a/src/locales/pt_BR/config.ts +++ b/src/locales/pt_BR/config.ts @@ -32,6 +32,7 @@ import { } from "./dialogue"; import { biome } from "./biome"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const ptBrConfig = { ability: ability, @@ -69,5 +70,6 @@ export const ptBrConfig = { PGMmiscDialogue: PGMmiscDialogue, PGFmiscDialogue: PGFmiscDialogue, PGMdoubleBattleDialogue: PGMdoubleBattleDialogue, - PGFdoubleBattleDialogue: PGFdoubleBattleDialogue + PGFdoubleBattleDialogue: PGFdoubleBattleDialogue, + modifierSelectUiHandler: modifierSelectUiHandler }; diff --git a/src/locales/pt_BR/modifier-select-ui-handler.ts b/src/locales/pt_BR/modifier-select-ui-handler.ts new file mode 100644 index 00000000000..7f9bf45c197 --- /dev/null +++ b/src/locales/pt_BR/modifier-select-ui-handler.ts @@ -0,0 +1,12 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "Transfer", + "reroll": "Reroll", + "lockRarities": "Lock Rarities", + "transferDesc": "Transfer a held item from one Pokémon to another.", + "rerollDesc": "Spend money to reroll your item options.", + "lockRaritiesDesc": "Lock item rarities on reroll (affects reroll cost).", + "rerollCost": "₽{{cost}}", + "itemCost": "₽{{cost}}" +} as const; diff --git a/src/locales/zh_CN/config.ts b/src/locales/zh_CN/config.ts index 245727d874b..8d86ed63fd1 100644 --- a/src/locales/zh_CN/config.ts +++ b/src/locales/zh_CN/config.ts @@ -32,6 +32,7 @@ import { } from "./dialogue"; import { biome } from "./biome"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const zhCnConfig = { ability: ability, @@ -69,5 +70,6 @@ export const zhCnConfig = { PGMmiscDialogue: PGMmiscDialogue, PGFmiscDialogue: PGFmiscDialogue, PGMdoubleBattleDialogue: PGMdoubleBattleDialogue, - PGFdoubleBattleDialogue: PGFdoubleBattleDialogue + PGFdoubleBattleDialogue: PGFdoubleBattleDialogue, + modifierSelectUiHandler: modifierSelectUiHandler }; diff --git a/src/locales/zh_CN/modifier-select-ui-handler.ts b/src/locales/zh_CN/modifier-select-ui-handler.ts new file mode 100644 index 00000000000..b4fb8a0462b --- /dev/null +++ b/src/locales/zh_CN/modifier-select-ui-handler.ts @@ -0,0 +1,12 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "交换道具", + "reroll": "刷新掉落", + "lockRarities": "锁定稀有度", + "transferDesc": "将一只宝可梦所持有的道具交换给另一只。", + "rerollDesc": "花钱刷新掉落道具选项。", + "lockRaritiesDesc": "在刷新时锁定道具稀有度(影响刷新费用)。", + "rerollCost": "₽{{cost}}", + "itemCost": "₽{{cost}}" +} as const; diff --git a/src/locales/zh_TW/config.ts b/src/locales/zh_TW/config.ts index c213aa4b0df..4043072589e 100644 --- a/src/locales/zh_TW/config.ts +++ b/src/locales/zh_TW/config.ts @@ -31,6 +31,7 @@ import { } from "./dialogue"; import { biome } from "./biome"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const zhTWConfig = { ability: ability, @@ -67,5 +68,6 @@ export const zhTWConfig = { PGMmiscDialogue: PGMmiscDialogue, PGFmiscDialogue: PGFmiscDialogue, PGMdoubleBattleDialogue: PGMdoubleBattleDialogue, - PGFdoubleBattleDialogue: PGFdoubleBattleDialogue + PGFdoubleBattleDialogue: PGFdoubleBattleDialogue, + modifierSelectUiHandler: modifierSelectUiHandler }; diff --git a/src/locales/zh_TW/modifier-select-ui-handler.ts b/src/locales/zh_TW/modifier-select-ui-handler.ts new file mode 100644 index 00000000000..7f9bf45c197 --- /dev/null +++ b/src/locales/zh_TW/modifier-select-ui-handler.ts @@ -0,0 +1,12 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "Transfer", + "reroll": "Reroll", + "lockRarities": "Lock Rarities", + "transferDesc": "Transfer a held item from one Pokémon to another.", + "rerollDesc": "Spend money to reroll your item options.", + "lockRaritiesDesc": "Lock item rarities on reroll (affects reroll cost).", + "rerollCost": "₽{{cost}}", + "itemCost": "₽{{cost}}" +} as const; diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 06c660434d5..c62576993af 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -221,6 +221,7 @@ declare module "i18next" { PGFbattleSpecDialogue: SimpleTranslationEntries; PGFmiscDialogue: SimpleTranslationEntries; PGFdoubleBattleDialogue: DialogueTranslationEntries; + modifierSelectUiHandler: SimpleTranslationEntries; }; } } diff --git a/src/ui/modifier-select-ui-handler.ts b/src/ui/modifier-select-ui-handler.ts index 37718243b8b..ce91fdf68ce 100644 --- a/src/ui/modifier-select-ui-handler.ts +++ b/src/ui/modifier-select-ui-handler.ts @@ -7,6 +7,7 @@ import { Mode } from "./ui"; import { LockModifierTiersModifier, PokemonHeldItemModifier } from "../modifier/modifier"; import { handleTutorial, Tutorial } from "../tutorial"; import {Button} from "../enums/buttons"; +import i18next from "i18next"; export const SHOP_OPTIONS_ROW_LIMIT = 6; @@ -41,27 +42,22 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { ui.add(this.modifierContainer); this.transferButtonContainer = this.scene.add.container((this.scene.game.canvas.width / 6) - 1, -64); - this.transferButtonContainer.setName("container-transfer-btn"); this.transferButtonContainer.setVisible(false); ui.add(this.transferButtonContainer); - const transferButtonText = addTextObject(this.scene, -4, -2, "Transfer", TextStyle.PARTY); - transferButtonText.setName("text-transfer-btn"); + const transferButtonText = addTextObject(this.scene, -4, -2, i18next.t("modifierSelectUiHandler:transfer"), TextStyle.PARTY); transferButtonText.setOrigin(1, 0); this.transferButtonContainer.add(transferButtonText); this.rerollButtonContainer = this.scene.add.container(16, -64); - this.rerollButtonContainer.setName("container-reroll-brn"); this.rerollButtonContainer.setVisible(false); ui.add(this.rerollButtonContainer); - const rerollButtonText = addTextObject(this.scene, -4, -2, "Reroll", TextStyle.PARTY); - rerollButtonText.setName("text-reroll-btn"); + const rerollButtonText = addTextObject(this.scene, -4, -2, i18next.t("modifierSelectUiHandler:reroll"), TextStyle.PARTY); rerollButtonText.setOrigin(0, 0); this.rerollButtonContainer.add(rerollButtonText); this.rerollCostText = addTextObject(this.scene, 0, 0, "", TextStyle.MONEY); - this.rerollCostText.setName("text-reroll-cost"); this.rerollCostText.setOrigin(0, 0); this.rerollCostText.setPositionRelative(rerollButtonText, rerollButtonText.displayWidth + 5, 1); this.rerollButtonContainer.add(this.rerollCostText); @@ -70,7 +66,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { this.lockRarityButtonContainer.setVisible(false); ui.add(this.lockRarityButtonContainer); - this.lockRarityButtonText = addTextObject(this.scene, -4, -2, "Lock Rarities", TextStyle.PARTY); + this.lockRarityButtonText = addTextObject(this.scene, -4, -2, i18next.t("modifierSelectUiHandler:lockRarities"), TextStyle.PARTY); this.lockRarityButtonText.setOrigin(0, 0); this.lockRarityButtonContainer.add(this.lockRarityButtonText); } @@ -146,7 +142,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { const maxUpgradeCount = typeOptions.map(to => to.upgradeCount).reduce((max, current) => Math.max(current, max), 0); this.scene.showFieldOverlay(750); - this.scene.updateAndShowText(750); + this.scene.updateAndShowLuckText(750); this.scene.updateMoneyText(); let i = 0; @@ -303,13 +299,13 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { ui.showText(options[this.cursor].modifierTypeOption.type.getDescription(this.scene)); } else if (!cursor) { this.cursorObj.setPosition(6, this.lockRarityButtonContainer.visible ? -72 : -60); - ui.showText("Spend money to reroll your item options."); + ui.showText(i18next.t("modifierSelectUiHandler:rerollDesc")); } else if (cursor === 1) { this.cursorObj.setPosition((this.scene.game.canvas.width / 6) - 50, -60); - ui.showText("Transfer a held item from one Pokémon to another."); + ui.showText(i18next.t("modifierSelectUiHandler:transferDesc")); } else { this.cursorObj.setPosition(6, -60); - ui.showText("Lock item rarities on reroll (affects reroll cost)."); + ui.showText(i18next.t("modifierSelectUiHandler:lockRaritiesDesc")); } return ret; @@ -362,8 +358,9 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { updateRerollCostText(): void { const canReroll = this.scene.money >= this.rerollCost; + const rerollCostFormatted = this.rerollCost.toLocaleString(i18next.language); - this.rerollCostText.setText(`₽${this.rerollCost.toLocaleString("en-US")}`); + this.rerollCostText.setText(i18next.t("modifierSelectUiHandler:rerollCost", { cost: rerollCostFormatted })); this.rerollCostText.setColor(this.getTextColor(canReroll ? TextStyle.MONEY : TextStyle.PARTY_RED)); this.rerollCostText.setShadowColor(this.getTextColor(canReroll ? TextStyle.MONEY : TextStyle.PARTY_RED, true)); } @@ -618,8 +615,9 @@ class ModifierOption extends Phaser.GameObjects.Container { updateCostText(): void { const scene = this.scene as BattleScene; const textStyle = this.modifierTypeOption.cost <= scene.money ? TextStyle.MONEY : TextStyle.PARTY_RED; + const itemCostFormatted = this.modifierTypeOption.cost.toLocaleString(i18next.language); - this.itemCostText.setText(`₽${this.modifierTypeOption.cost.toLocaleString("en-US")}`); + this.itemCostText.setText(i18next.t("modifierSelectUiHandler:itemCost", { cost: itemCostFormatted })); this.itemCostText.setColor(getTextColor(textStyle, false, scene.uiTheme)); this.itemCostText.setShadowColor(getTextColor(textStyle, true, scene.uiTheme)); }