From 696d8f27f5fa3fbb1ac031c987282652b7ef5cb8 Mon Sep 17 00:00:00 2001 From: Lugiad Date: Thu, 4 Jul 2024 22:40:54 +0200 Subject: [PATCH] [Localization] modifier-select-ui-handler Locales (#2527) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update modifier-select-ui-handler.ts * Update i18next.d.ts * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Update modifier-select-ui-handler.ts * Update modifier-select-ui-handler.ts * Update modifier-select-ui-handler.ts * Update modifier-select-ui-handler.ts * Update modifier-select-ui-handler.ts * Update modifier-select-ui-handler.ts * Update modifier-select-ui-handler.ts * Update modifier-select-ui-handler.ts * Update modifier-select-ui-handler.ts * Update modifier-select-ui-handler.ts * Update src/locales/ko/modifier-select-ui-handler.ts Co-authored-by: yun <97648143+ddullgi@users.noreply.github.com> * Update src/locales/zh_CN/modifier-select-ui-handler.ts Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com> * Update src/locales/de/modifier-select-ui-handler.ts Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> * Update config.ts * Update modifier-select-ui-handler.ts * Update src/locales/pt_BR/modifier-select-ui-handler.ts Co-authored-by: José Ricardo Fleury Oliveira * Update src/locales/es/modifier-select-ui-handler.ts Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> * Update modifier-select-ui-handler.ts [Localization(it)] * Update src/locales/es/modifier-select-ui-handler.ts Co-authored-by: InnocentGameDev * Adaptive buttons and cursors * Update modifier-select-ui-handler.ts * Update modifier-select-ui-handler.ts --------- Co-authored-by: yun <97648143+ddullgi@users.noreply.github.com> Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com> Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com> Co-authored-by: InnocentGameDev Co-authored-by: hjh --- src/locales/de/config.ts | 4 +- src/locales/de/modifier-select-ui-handler.ts | 14 +++++++ src/locales/en/config.ts | 2 + src/locales/en/modifier-select-ui-handler.ts | 14 +++++++ src/locales/es/config.ts | 4 +- src/locales/es/modifier-select-ui-handler.ts | 15 +++++++ src/locales/fr/config.ts | 4 +- src/locales/fr/modifier-select-ui-handler.ts | 14 +++++++ src/locales/it/config.ts | 4 +- src/locales/it/modifier-select-ui-handler.ts | 14 +++++++ src/locales/ko/config.ts | 4 +- src/locales/ko/modifier-select-ui-handler.ts | 14 +++++++ src/locales/pt_BR/config.ts | 4 +- .../pt_BR/modifier-select-ui-handler.ts | 14 +++++++ src/locales/zh_CN/config.ts | 4 +- .../zh_CN/modifier-select-ui-handler.ts | 14 +++++++ src/locales/zh_TW/config.ts | 4 +- .../zh_TW/modifier-select-ui-handler.ts | 14 +++++++ src/ui/modifier-select-ui-handler.ts | 40 ++++++++++++------- src/ui/text.ts | 2 +- 20 files changed, 179 insertions(+), 24 deletions(-) create mode 100644 src/locales/de/modifier-select-ui-handler.ts create mode 100644 src/locales/en/modifier-select-ui-handler.ts create mode 100644 src/locales/es/modifier-select-ui-handler.ts create mode 100644 src/locales/fr/modifier-select-ui-handler.ts create mode 100644 src/locales/it/modifier-select-ui-handler.ts create mode 100644 src/locales/ko/modifier-select-ui-handler.ts create mode 100644 src/locales/pt_BR/modifier-select-ui-handler.ts create mode 100644 src/locales/zh_CN/modifier-select-ui-handler.ts create mode 100644 src/locales/zh_TW/modifier-select-ui-handler.ts diff --git a/src/locales/de/config.ts b/src/locales/de/config.ts index 77834849d2f..92544d87ea3 100644 --- a/src/locales/de/config.ts +++ b/src/locales/de/config.ts @@ -43,6 +43,7 @@ import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; import { settings } from "./settings.js"; import { common } from "./common.js"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const deConfig = { ability: ability, @@ -90,5 +91,6 @@ export const deConfig = { tutorial: tutorial, voucher: voucher, weather: weather, - partyUiHandler: partyUiHandler + partyUiHandler: partyUiHandler, + 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..78248f82da1 --- /dev/null +++ b/src/locales/de/modifier-select-ui-handler.ts @@ -0,0 +1,14 @@ +import { SimpleTranslationEntries } from "#app/interfaces/locales"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "Übertragen", + "reroll": "Neu rollen", + "lockRarities": "Seltenheit festsetzen", + "checkTeam": "Team überprüfen", + "transferDesc": "Übertrage ein gehaltenes Item zu einem anderen Pokémon.", + "rerollDesc": "Nutze Geld um die Items neu zu rollen.", + "lockRaritiesDesc": "Setze die Seltenheit der Items fest. (Beeinflusst die Rollkosten).", + "checkTeamDesc": "Überprüfe dein Team or nutze Formänderungsitems.", + "rerollCost": "{{formattedMoney}}₽", + "itemCost": "{{formattedMoney}}₽" +} as const; diff --git a/src/locales/en/config.ts b/src/locales/en/config.ts index 1d40e61bbad..a318bbe0128 100644 --- a/src/locales/en/config.ts +++ b/src/locales/en/config.ts @@ -43,6 +43,7 @@ import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const enConfig = { ability: ability, @@ -91,4 +92,5 @@ export const enConfig = { tutorial: tutorial, voucher: voucher, weather: weather, + 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..64cf3aa2ba3 --- /dev/null +++ b/src/locales/en/modifier-select-ui-handler.ts @@ -0,0 +1,14 @@ +import { SimpleTranslationEntries } from "#app/interfaces/locales"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "Transfer", + "reroll": "Reroll", + "lockRarities": "Lock Rarities", + "checkTeam": "Check Team", + "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).", + "checkTeamDesc": "Check your team or use a form changing item.", + "rerollCost": "₽{{formattedMoney}}", + "itemCost": "₽{{formattedMoney}}" +} as const; diff --git a/src/locales/es/config.ts b/src/locales/es/config.ts index 551c7a2f6dc..bedd53dcc29 100644 --- a/src/locales/es/config.ts +++ b/src/locales/es/config.ts @@ -43,6 +43,7 @@ import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; import { settings } from "./settings.js"; import { common } from "./common.js"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const esConfig = { ability: ability, @@ -90,5 +91,6 @@ export const esConfig = { tutorial: tutorial, voucher: voucher, weather: weather, - partyUiHandler: partyUiHandler + partyUiHandler: partyUiHandler, + 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..e78be5d4ea5 --- /dev/null +++ b/src/locales/es/modifier-select-ui-handler.ts @@ -0,0 +1,15 @@ +import { SimpleTranslationEntries } from "#app/interfaces/locales"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "Transferir", + "reroll": "Actualizar", + "lockRarities": "Bloquear rarezas", + "checkTeam": "Ver Equipo", + "transferDesc": "Transfiere un objeto que lleva un Pokémon a otro.", + "rerollDesc": "Gasta dinero para actualizar las opciones de objetos.", + "lockRaritiesDesc": "Bloquea las rarezas de los objetos al actualizar (afecta el costo de actualización).", + "checkTeamDesc": "Revisa tu equipo o usa un objeto que cambia de forma.", + "rerollCost": "{{formattedMoney}} ₽", + "itemCost": "{{formattedMoney}} ₽" + +} as const; diff --git a/src/locales/fr/config.ts b/src/locales/fr/config.ts index 04af81adf52..55eae8c1dd5 100644 --- a/src/locales/fr/config.ts +++ b/src/locales/fr/config.ts @@ -43,6 +43,7 @@ import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; import { settings } from "./settings.js"; import { common } from "./common.js"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const frConfig = { ability: ability, @@ -90,5 +91,6 @@ export const frConfig = { tutorial: tutorial, voucher: voucher, weather: weather, - partyUiHandler: partyUiHandler + partyUiHandler: partyUiHandler, + 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..7e3d4837e54 --- /dev/null +++ b/src/locales/fr/modifier-select-ui-handler.ts @@ -0,0 +1,14 @@ +import { SimpleTranslationEntries } from "#app/interfaces/locales"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "Transférer", + "reroll": "Relancer", + "lockRarities": "Bloquer la rareté", + "checkTeam": "Consulter Équipe", + "transferDesc": "Transférer un objet tenu par un Pokémon vers un autre.", + "rerollDesc": "Payer pour relancer les objets gratuits proposés.", + "lockRaritiesDesc": "Assure la relance de proposer des objets gratuits de rareté égale ou supérieure. Affecte le cout de relance.", + "checkTeamDesc": "Consulter votre équipe ou utiliser un objet\nde changement de forme.", + "rerollCost": "{{formattedMoney}} ₽", + "itemCost": "{{formattedMoney}} ₽" +} as const; diff --git a/src/locales/it/config.ts b/src/locales/it/config.ts index ac2e37c2df5..9175d40b97f 100644 --- a/src/locales/it/config.ts +++ b/src/locales/it/config.ts @@ -43,6 +43,7 @@ import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; import { settings } from "./settings.js"; import { common } from "./common.js"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const itConfig = { ability: ability, @@ -90,5 +91,6 @@ export const itConfig = { tutorial: tutorial, voucher: voucher, weather: weather, - partyUiHandler: partyUiHandler + partyUiHandler: partyUiHandler, + 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..f0852a7d87c --- /dev/null +++ b/src/locales/it/modifier-select-ui-handler.ts @@ -0,0 +1,14 @@ +import { SimpleTranslationEntries } from "#app/interfaces/locales"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "Trasferisci", + "reroll": "Rerolla", + "lockRarities": "Blocca le rarità", + "checkTeam": "Stato squadra", + "transferDesc": "Trasferisci un oggetto da un Pokémon ad un altro.", + "rerollDesc": "Spendi soldi per rerollare le ricompense.", + "lockRaritiesDesc": "Blocca le rarità al reroll (influisce sui costi).", + "checkTeamDesc": "Controlla la squadra Pokémon.", + "rerollCost": "{{formattedMoney}}₽", + "itemCost": "{{formattedMoney}}₽" +} as const; diff --git a/src/locales/ko/config.ts b/src/locales/ko/config.ts index 59603c8519d..dc64e12356a 100644 --- a/src/locales/ko/config.ts +++ b/src/locales/ko/config.ts @@ -43,6 +43,7 @@ import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; import { settings } from "./settings.js"; import { common } from "./common.js"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const koConfig = { ability: ability, @@ -90,5 +91,6 @@ export const koConfig = { tutorial: tutorial, voucher: voucher, weather: weather, - partyUiHandler: partyUiHandler + partyUiHandler: partyUiHandler, + 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..c25b6d57af2 --- /dev/null +++ b/src/locales/ko/modifier-select-ui-handler.ts @@ -0,0 +1,14 @@ +import { SimpleTranslationEntries } from "#app/interfaces/locales"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "건네주기", + "reroll": "갱신", + "lockRarities": "희귀도 고정", + "checkTeam": "파티 확인", + "transferDesc": "지닌 물건을 다른 포켓몬에게 건네줍니다.", + "rerollDesc": "돈을 소모하여 아이템 목록을 새로 고칩니다.", + "lockRaritiesDesc": "갱신되는 아이템의 희귀도가 고정됩니다(갱신 비용 증가).", + "checkTeamDesc": "파티를 확인하거나 폼 변경 아이템을 사용합니다.", + "rerollCost": "₽{{formattedMoney}}", + "itemCost": "₽{{formattedMoney}}" +} as const; diff --git a/src/locales/pt_BR/config.ts b/src/locales/pt_BR/config.ts index ac4176144c6..5a571815c97 100644 --- a/src/locales/pt_BR/config.ts +++ b/src/locales/pt_BR/config.ts @@ -43,6 +43,7 @@ import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; import { settings } from "./settings.js"; import { common } from "./common.js"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const ptBrConfig = { ability: ability, @@ -90,5 +91,6 @@ export const ptBrConfig = { trainerNames: trainerNames, tutorial: tutorial, voucher: voucher, - weather: weather + weather: weather, + 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..fd9dfcf4c30 --- /dev/null +++ b/src/locales/pt_BR/modifier-select-ui-handler.ts @@ -0,0 +1,14 @@ +import { SimpleTranslationEntries } from "#app/interfaces/locales"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "Alterar", + "reroll": "Atualizar", + "lockRarities": "Travar Raridades", + "checkTeam": "Checar Time", + "transferDesc": "Transfira um item segurado de um Pokémon para outro.", + "rerollDesc": "Gaste dinheiro para atualizar as suas opções de itens.", + "lockRaritiesDesc": "Trava a raridade dos itens na atualização (afeta o custo da atualização).", + "checkTeamDesc": "Cheque seu time ou use um item de mudança de forma.", + "rerollCost": "₽{{formattedMoney}}", + "itemCost": "₽{{formattedMoney}}" +} as const; diff --git a/src/locales/zh_CN/config.ts b/src/locales/zh_CN/config.ts index 1d987eaec16..8f654b56d9a 100644 --- a/src/locales/zh_CN/config.ts +++ b/src/locales/zh_CN/config.ts @@ -43,6 +43,7 @@ import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; import { settings } from "./settings.js"; import { common } from "./common.js"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const zhCnConfig = { ability: ability, @@ -90,5 +91,6 @@ export const zhCnConfig = { tutorial: tutorial, voucher: voucher, weather: weather, - partyUiHandler: partyUiHandler + partyUiHandler: partyUiHandler, + 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..a836f07e910 --- /dev/null +++ b/src/locales/zh_CN/modifier-select-ui-handler.ts @@ -0,0 +1,14 @@ +import { SimpleTranslationEntries } from "#app/interfaces/locales"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "交换道具", + "reroll": "刷新商店", + "lockRarities": "锁定稀有度", + "checkTeam": "查看队伍", + "transferDesc": "将宝可梦携带的道具交换给其他宝可梦", + "rerollDesc": "花钱刷新道具", + "lockRaritiesDesc": "在刷新时锁定道具稀有度(影响刷新费用)", + "checkTeamDesc": "检查队伍或使用形态改变道具", + "rerollCost": "₽{{formattedMoney}}", + "itemCost": "₽{{formattedMoney}}" +} as const; diff --git a/src/locales/zh_TW/config.ts b/src/locales/zh_TW/config.ts index 688f3b47033..e4dfafdd43e 100644 --- a/src/locales/zh_TW/config.ts +++ b/src/locales/zh_TW/config.ts @@ -43,6 +43,7 @@ import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; import { settings } from "./settings.js"; import { common } from "./common.js"; +import { modifierSelectUiHandler } from "./modifier-select-ui-handler"; export const zhTwConfig = { ability: ability, @@ -90,5 +91,6 @@ export const zhTwConfig = { tutorial: tutorial, voucher: voucher, weather: weather, - partyUiHandler: partyUiHandler + partyUiHandler: partyUiHandler, + 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..64cf3aa2ba3 --- /dev/null +++ b/src/locales/zh_TW/modifier-select-ui-handler.ts @@ -0,0 +1,14 @@ +import { SimpleTranslationEntries } from "#app/interfaces/locales"; + +export const modifierSelectUiHandler: SimpleTranslationEntries = { + "transfer": "Transfer", + "reroll": "Reroll", + "lockRarities": "Lock Rarities", + "checkTeam": "Check Team", + "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).", + "checkTeamDesc": "Check your team or use a form changing item.", + "rerollCost": "₽{{formattedMoney}}", + "itemCost": "₽{{formattedMoney}}" +} as const; diff --git a/src/ui/modifier-select-ui-handler.ts b/src/ui/modifier-select-ui-handler.ts index c403dc28abb..3cfd103b4e2 100644 --- a/src/ui/modifier-select-ui-handler.ts +++ b/src/ui/modifier-select-ui-handler.ts @@ -1,7 +1,7 @@ import BattleScene from "../battle-scene"; import { getPlayerShopModifierTypeOptionsForWave, ModifierTypeOption, TmModifierType } from "../modifier/modifier-type"; import { getPokeballAtlasKey, PokeballType } from "../data/pokeball"; -import { addTextObject, getModifierTierTextTint, getTextColor, TextStyle } from "./text"; +import { addTextObject, getTextStyleOptions, getModifierTierTextTint, getTextColor, TextStyle } from "./text"; import AwaitableUiHandler from "./awaitable-ui-handler"; import { Mode } from "./ui"; import { LockModifierTiersModifier, PokemonHeldItemModifier } from "../modifier/modifier"; @@ -10,6 +10,7 @@ import {Button} from "#enums/buttons"; import MoveInfoOverlay from "./move-info-overlay"; import { allMoves } from "../data/move"; import * as Utils from "./../utils"; +import i18next from "i18next"; export const SHOP_OPTIONS_ROW_LIMIT = 6; @@ -27,6 +28,8 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { private rowCursor: integer = 0; private player: boolean; private rerollCost: integer; + private transferButtonWidth: integer; + private checkButtonWidth: integer; public options: ModifierOption[]; public shopOptionsRows: ModifierOption[][]; @@ -46,22 +49,29 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { this.modifierContainer = this.scene.add.container(0, 0); ui.add(this.modifierContainer); - this.transferButtonContainer = this.scene.add.container((this.scene.game.canvas.width / 6) - 71, -64); + const canvas = document.createElement("canvas"); + const context = canvas.getContext("2d"); + const [ , styleOptions, , , ] = getTextStyleOptions(TextStyle.PARTY, (this.scene as BattleScene).uiTheme); + context.font = styleOptions.fontSize + "px " + styleOptions.fontFamily; + this.transferButtonWidth = context.measureText(i18next.t("modifierSelectUiHandler:transfer")).width; + this.checkButtonWidth = context.measureText(i18next.t("modifierSelectUiHandler:checkTeam")).width; + + this.transferButtonContainer = this.scene.add.container((this.scene.game.canvas.width - this.checkButtonWidth) / 6 - 21, -64); this.transferButtonContainer.setName("transfer-btn"); this.transferButtonContainer.setVisible(false); ui.add(this.transferButtonContainer); - const transferButtonText = addTextObject(this.scene, -4, -2, "Transfer", TextStyle.PARTY); + const transferButtonText = addTextObject(this.scene, -4, -2, i18next.t("modifierSelectUiHandler:transfer"), TextStyle.PARTY); transferButtonText.setName("text-transfer-btn"); transferButtonText.setOrigin(1, 0); this.transferButtonContainer.add(transferButtonText); - this.checkButtonContainer = this.scene.add.container((this.scene.game.canvas.width / 6) - 1, -64); + this.checkButtonContainer = this.scene.add.container((this.scene.game.canvas.width) / 6 - 1, -64); this.checkButtonContainer.setName("use-btn"); this.checkButtonContainer.setVisible(false); ui.add(this.checkButtonContainer); - const checkButtonText = addTextObject(this.scene, -4, -2, "Check Team", TextStyle.PARTY); + const checkButtonText = addTextObject(this.scene, -4, -2, i18next.t("modifierSelectUiHandler:checkTeam"), TextStyle.PARTY); checkButtonText.setName("text-use-btn"); checkButtonText.setOrigin(1, 0); this.checkButtonContainer.add(checkButtonText); @@ -71,7 +81,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { this.rerollButtonContainer.setVisible(false); ui.add(this.rerollButtonContainer); - const rerollButtonText = addTextObject(this.scene, -4, -2, "Reroll", TextStyle.PARTY); + const rerollButtonText = addTextObject(this.scene, -4, -2, i18next.t("modifierSelectUiHandler:reroll"), TextStyle.PARTY); rerollButtonText.setName("text-reroll-btn"); rerollButtonText.setOrigin(0, 0); this.rerollButtonContainer.add(rerollButtonText); @@ -86,7 +96,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); @@ -390,16 +400,16 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { } } else if (cursor === 0) { 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) - 120, -60); - ui.showText("Transfer a held item from one Pokémon to another."); + this.cursorObj.setPosition((this.scene.game.canvas.width - this.transferButtonWidth - this.checkButtonWidth)/6 - 30, -60); + ui.showText(i18next.t("modifierSelectUiHandler:transferDesc")); } else if (cursor === 2) { - this.cursorObj.setPosition((this.scene.game.canvas.width / 6) - 60, -60); - ui.showText("Check your team or use a form changing item."); + this.cursorObj.setPosition((this.scene.game.canvas.width - this.checkButtonWidth)/6 - 10, -60); + ui.showText(i18next.t("modifierSelectUiHandler:checkTeamDesc")); } else { this.cursorObj.setPosition(6, -60); - ui.showText("Lock item rarities on reroll (affects reroll cost)."); + ui.showText(i18next.t("modifierSelectUiHandler:lockRaritiesDesc")); } return ret; @@ -456,7 +466,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { const formattedMoney = Utils.formatMoney(this.scene.moneyFormat, this.rerollCost); - this.rerollCostText.setText(`₽${formattedMoney}`); + this.rerollCostText.setText(i18next.t("modifierSelectUiHandler:rerollCost", { formattedMoney })); this.rerollCostText.setColor(this.getTextColor(canReroll ? TextStyle.MONEY : TextStyle.PARTY_RED)); this.rerollCostText.setShadowColor(this.getTextColor(canReroll ? TextStyle.MONEY : TextStyle.PARTY_RED, true)); } @@ -720,7 +730,7 @@ class ModifierOption extends Phaser.GameObjects.Container { const formattedMoney = Utils.formatMoney(scene.moneyFormat, this.modifierTypeOption.cost); - this.itemCostText.setText(`₽${formattedMoney}`); + this.itemCostText.setText(i18next.t("modifierSelectUiHandler:itemCost", { formattedMoney })); this.itemCostText.setColor(getTextColor(textStyle, false, scene.uiTheme)); this.itemCostText.setShadowColor(getTextColor(textStyle, true, scene.uiTheme)); } diff --git a/src/ui/text.ts b/src/ui/text.ts index dd1ac57523a..d192ae076a7 100644 --- a/src/ui/text.ts +++ b/src/ui/text.ts @@ -82,7 +82,7 @@ export function addTextInputObject(scene: Phaser.Scene, x: number, y: number, wi return ret; } -function getTextStyleOptions(style: TextStyle, uiTheme: UiTheme, extraStyleOptions?: Phaser.Types.GameObjects.Text.TextStyle): [ number, Phaser.Types.GameObjects.Text.TextStyle | InputText.IConfig, string, number, number ] { +export function getTextStyleOptions(style: TextStyle, uiTheme: UiTheme, extraStyleOptions?: Phaser.Types.GameObjects.Text.TextStyle): [ number, Phaser.Types.GameObjects.Text.TextStyle | InputText.IConfig, string, number, number ] { let shadowXpos = 4; let shadowYpos = 5; const scale = 0.1666666667;