From 74941bd7f8ecf88d136fec5d15ffc695a48bfbb3 Mon Sep 17 00:00:00 2001 From: Enoch Date: Fri, 12 Jul 2024 00:28:01 +0900 Subject: [PATCH] [Mirror][Localization] Translate summary #2336 (#2907) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Translate pokemon summary * Translate pokemon summary to fr * Translate pokemon summary to de * Translate pokemon summary to es * Translate pokemon summary to it * Translate pokemon summary to ko * Translate pokemon summary to pt br * Translate pokemon summary to zh cn * Translate pokemon summary to zh tw * Fix import * Update partially for en and ko * Update interface name for en * Merge trainerLabel&Text and calculate typeLabel width * Update src/locales/es/pokemon-summary.ts Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> * Apply translations key to all languages with interface TranslationEtries * Update ko/translationKey of status * Update ko/translationKey of pokemonInfo * Update de/translationKeys of memostring and metFragment * Update de/translationKeys of memostring and metFragment 2 * Update src/locales/ko/pokemon-summary.ts Co-authored-by: Enoch * Update src/locales/ko/pokemon-summary.ts Co-authored-by: returntoice * Update src/locales/pt_BR/pokemon-summary.ts Co-authored-by: José Ricardo Fleury Oliveira * Update src/locales/ko/pokemon-summary.ts * Update src/locales/pt_BR/pokemon-summary.ts Co-authored-by: José Ricardo Fleury Oliveira * Update pokemon-summary.ts [Localization(it)] * remove unused code * Update src/locales/zh_CN/pokemon-summary.ts Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com> * Update src/locales/zh_CN/pokemon-summary.ts Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com> * Update src/locales/zh_CN/pokemon-summary.ts Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com> * Update src/locales/es/pokemon-summary.ts Co-authored-by: Arxxer * Update src/locales/es/pokemon-summary.ts Co-authored-by: Arxxer --------- Co-authored-by: Alexis Co-authored-by: Mr.WaterT Co-authored-by: Alexis Faizeau Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: returntoice Co-authored-by: José Ricardo Fleury Oliveira Co-authored-by: 송지원 Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com> Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com> Co-authored-by: Arxxer --- src/data/pokemon-stat.ts | 2 +- src/locales/de/config.ts | 2 ++ src/locales/de/pokemon-summary.ts | 20 ++++++++++++ src/locales/en/config.ts | 2 ++ src/locales/en/pokemon-summary.ts | 20 ++++++++++++ src/locales/es/config.ts | 2 ++ src/locales/es/pokemon-summary.ts | 20 ++++++++++++ src/locales/fr/config.ts | 2 ++ src/locales/fr/pokemon-summary.ts | 20 ++++++++++++ src/locales/it/config.ts | 2 ++ src/locales/it/pokemon-summary.ts | 20 ++++++++++++ src/locales/ko/config.ts | 2 ++ src/locales/ko/pokemon-summary.ts | 47 ++++++++++++++++++++++++++++ src/locales/pt_BR/config.ts | 2 ++ src/locales/pt_BR/pokemon-summary.ts | 20 ++++++++++++ src/locales/zh_CN/config.ts | 2 ++ src/locales/zh_CN/pokemon-summary.ts | 19 +++++++++++ src/locales/zh_TW/config.ts | 2 ++ src/locales/zh_TW/pokemon-summary.ts | 20 ++++++++++++ src/ui/summary-ui-handler.ts | 44 +++++++++++++++----------- 20 files changed, 250 insertions(+), 20 deletions(-) create mode 100644 src/locales/de/pokemon-summary.ts create mode 100644 src/locales/en/pokemon-summary.ts create mode 100644 src/locales/es/pokemon-summary.ts create mode 100644 src/locales/fr/pokemon-summary.ts create mode 100644 src/locales/it/pokemon-summary.ts create mode 100644 src/locales/ko/pokemon-summary.ts create mode 100644 src/locales/pt_BR/pokemon-summary.ts create mode 100644 src/locales/zh_CN/pokemon-summary.ts create mode 100644 src/locales/zh_TW/pokemon-summary.ts diff --git a/src/data/pokemon-stat.ts b/src/data/pokemon-stat.ts index a6bf77b1daa..63dc0cfbc51 100644 --- a/src/data/pokemon-stat.ts +++ b/src/data/pokemon-stat.ts @@ -10,7 +10,7 @@ export enum Stat { } export function getStatName(stat: Stat, shorten: boolean = false) { - let ret: string; + let ret: string = ""; switch (stat) { case Stat.HP: ret = !shorten ? i18next.t("pokemonInfo:Stat.HP") : i18next.t("pokemonInfo:Stat.HPshortened"); diff --git a/src/locales/de/config.ts b/src/locales/de/config.ts index ffbb2733205..dab2772acb6 100644 --- a/src/locales/de/config.ts +++ b/src/locales/de/config.ts @@ -33,6 +33,7 @@ import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonInfo } from "./pokemon-info"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { pokemonSummary } from "./pokemon-summary"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; @@ -82,6 +83,7 @@ export const deConfig = { pokemon: pokemon, pokemonInfo: pokemonInfo, pokemonInfoContainer: pokemonInfoContainer, + pokemonSummary: pokemonSummary, saveSlotSelectUiHandler: saveSlotSelectUiHandler, settings: settings, splashMessages: splashMessages, diff --git a/src/locales/de/pokemon-summary.ts b/src/locales/de/pokemon-summary.ts new file mode 100644 index 00000000000..69683d4d4a0 --- /dev/null +++ b/src/locales/de/pokemon-summary.ts @@ -0,0 +1,20 @@ +import { TranslationEntries } from "#app/interfaces/locales"; + +export const pokemonSummary: TranslationEntries = { + "pokemonInfo": "Pokémon Info", + "status": "Status", + "powerAccuracyCategory": "Stärke\nGenauigkeit\nKategorie", + "type": "Typ", + "unknownTrainer": "Unbekannt", + "ot": "OT", + "nature": "Wesen", + "expPoints": "Erf. Punkte", + "nextLv": "Nächstes Lvl.", + "cancel": "Abbrechen", + + "memoString": "Wesen: {{natureFragment}}\n{{metFragment}}", + "metFragment": { + "normal": "Herkunft: {{biome}}\nMit Lv. {{level}} erhalten.", + "apparently": "Herkunft: {{biome}}\nOffenbar mit Lv. {{level}} erhalten.", + }, +} as const; diff --git a/src/locales/en/config.ts b/src/locales/en/config.ts index 1c5449a2e88..e7f0a284e63 100644 --- a/src/locales/en/config.ts +++ b/src/locales/en/config.ts @@ -36,6 +36,7 @@ import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonInfo } from "./pokemon-info"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { pokemonSummary } from "./pokemon-summary"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; @@ -82,6 +83,7 @@ export const enConfig = { pokemon: pokemon, pokemonInfo: pokemonInfo, pokemonInfoContainer: pokemonInfoContainer, + pokemonSummary: pokemonSummary, saveSlotSelectUiHandler: saveSlotSelectUiHandler, settings: settings, splashMessages: splashMessages, diff --git a/src/locales/en/pokemon-summary.ts b/src/locales/en/pokemon-summary.ts new file mode 100644 index 00000000000..484ea2a9d67 --- /dev/null +++ b/src/locales/en/pokemon-summary.ts @@ -0,0 +1,20 @@ +import { TranslationEntries } from "#app/interfaces/locales"; + +export const pokemonSummary: TranslationEntries = { + "pokemonInfo": "Pokémon Info", + "status": "Status", + "powerAccuracyCategory": "Power\nAccuracy\nCategory", + "type": "Type", + "unknownTrainer": "Unknown", + "ot": "OT", + "nature": "nature", + "expPoints": "Exp. Points", + "nextLv": "Next Lv.", + "cancel": "Cancel", + + "memoString": "{{natureFragment}} nature,\n{{metFragment}}", + "metFragment": { + "normal": "met at Lv{{level}},\n{{biome}}.", + "apparently": "apparently met at Lv{{level}},\n{{biome}}.", + }, +} as const; diff --git a/src/locales/es/config.ts b/src/locales/es/config.ts index 341fafa4ca9..b9ccb5204b2 100644 --- a/src/locales/es/config.ts +++ b/src/locales/es/config.ts @@ -33,6 +33,7 @@ import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonInfo } from "./pokemon-info"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { pokemonSummary } from "./pokemon-summary"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; @@ -82,6 +83,7 @@ export const esConfig = { pokemon: pokemon, pokemonInfo: pokemonInfo, pokemonInfoContainer: pokemonInfoContainer, + pokemonSummary: pokemonSummary, saveSlotSelectUiHandler: saveSlotSelectUiHandler, settings: settings, splashMessages: splashMessages, diff --git a/src/locales/es/pokemon-summary.ts b/src/locales/es/pokemon-summary.ts new file mode 100644 index 00000000000..2eca4f118c6 --- /dev/null +++ b/src/locales/es/pokemon-summary.ts @@ -0,0 +1,20 @@ +import { TranslationEntries } from "#app/interfaces/locales"; + +export const pokemonSummary: TranslationEntries = { + "pokemonInfo": "Info. Pokémon", + "status": "Estado", + "powerAccuracyCategory": "Potencia\nPrecisión\nCategoría", + "type": "Tipo", + "unknownTrainer": "Desconocido", + "ot": "EO", + "nature": "Naturaleza", + "expPoints": "Puntos Exp.", + "nextLv": "Nv. siguiente", + "cancel": "Salir", + + "memoString": "Naturaleza {{natureFragment}},\n{{metFragment}}", + "metFragment": { + "normal": "encontrado al Nv. {{level}},\n{{biome}}.", + "apparently": "aparentemente encontrado al Nv. {{level}},\n{{biome}}.", + }, +} as const; diff --git a/src/locales/fr/config.ts b/src/locales/fr/config.ts index d8f9a6601c1..e2edc4716f8 100644 --- a/src/locales/fr/config.ts +++ b/src/locales/fr/config.ts @@ -33,6 +33,7 @@ import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonInfo } from "./pokemon-info"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { pokemonSummary } from "./pokemon-summary"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; @@ -82,6 +83,7 @@ export const frConfig = { pokemon: pokemon, pokemonInfo: pokemonInfo, pokemonInfoContainer: pokemonInfoContainer, + pokemonSummary: pokemonSummary, saveSlotSelectUiHandler: saveSlotSelectUiHandler, settings: settings, splashMessages: splashMessages, diff --git a/src/locales/fr/pokemon-summary.ts b/src/locales/fr/pokemon-summary.ts new file mode 100644 index 00000000000..d325900365b --- /dev/null +++ b/src/locales/fr/pokemon-summary.ts @@ -0,0 +1,20 @@ +import { TranslationEntries } from "#app/interfaces/locales"; + +export const pokemonSummary: TranslationEntries = { + "pokemonInfo": "Info Pokémon", + "status": "Résumé", + "powerAccuracyCategory": "Puissance\nPrécision\nCatégorie", + "type": "Type", + "unknownTrainer": "Inconnu", + "ot": "D.O.", + "nature": "de nature", + "expPoints": "Points Exp.", + "nextLv": "N. suivant", + "cancel": "Annuler", + + "memoString": "{{natureFragment}} de nature,\n{{metFragment}}", + "metFragment": { + "normal": "rencontré au N.{{level}},\n{{biome}}.", + "apparently": "apparemment rencontré au N.{{level}},\n{{biome}}.", + }, +} as const; diff --git a/src/locales/it/config.ts b/src/locales/it/config.ts index 5b370b00e4b..e64fac02480 100644 --- a/src/locales/it/config.ts +++ b/src/locales/it/config.ts @@ -33,6 +33,7 @@ import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonInfo } from "./pokemon-info"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { pokemonSummary } from "./pokemon-summary"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; @@ -82,6 +83,7 @@ export const itConfig = { pokemon: pokemon, pokemonInfo: pokemonInfo, pokemonInfoContainer: pokemonInfoContainer, + pokemonSummary: pokemonSummary, saveSlotSelectUiHandler: saveSlotSelectUiHandler, settings: settings, splashMessages: splashMessages, diff --git a/src/locales/it/pokemon-summary.ts b/src/locales/it/pokemon-summary.ts new file mode 100644 index 00000000000..7f17440b16c --- /dev/null +++ b/src/locales/it/pokemon-summary.ts @@ -0,0 +1,20 @@ +import { TranslationEntries } from "#app/interfaces/locales"; + +export const pokemonSummary: TranslationEntries = { + "pokemonInfo": "Info Pokémon", + "status": "Stato", + "powerAccuracyCategory": "Potenza\nPrecisione\nCategoria", + "type": "Tipo", + "unknownTrainer": "Sconosciuto", + "ot": "AO", + "nature": "natura", + "expPoints": "Punti Esp.", + "nextLv": "Prossimo Lv.", + "cancel": "Annulla", + + "memoString": "Natura {{natureFragment}},\n{{metFragment}}", + "metFragment": { + "normal": "incontrato al Lv.{{level}},\n{{biome}}.", + "apparently": "apparentemente incontrato al Lv.{{level}},\n{{biome}}.", + }, +} as const; diff --git a/src/locales/ko/config.ts b/src/locales/ko/config.ts index 5b29a46c044..31a3444f721 100644 --- a/src/locales/ko/config.ts +++ b/src/locales/ko/config.ts @@ -33,6 +33,7 @@ import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonInfo } from "./pokemon-info"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { pokemonSummary } from "./pokemon-summary"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; @@ -82,6 +83,7 @@ export const koConfig = { pokemon: pokemon, pokemonInfo: pokemonInfo, pokemonInfoContainer: pokemonInfoContainer, + pokemonSummary: pokemonSummary, saveSlotSelectUiHandler: saveSlotSelectUiHandler, settings: settings, splashMessages: splashMessages, diff --git a/src/locales/ko/pokemon-summary.ts b/src/locales/ko/pokemon-summary.ts new file mode 100644 index 00000000000..029588a7cf2 --- /dev/null +++ b/src/locales/ko/pokemon-summary.ts @@ -0,0 +1,47 @@ +import { TranslationEntries } from "#app/interfaces/locales"; + +export const pokemonSummary: TranslationEntries = { + "pokemonInfo": "스테이터스", + "status": "상태 이상", + "powerAccuracyCategory": "위력\n명중\n분류", + "type": "타입", + "unknownTrainer": "알수없음", + "ot": "어버이", + "nature": "성격", + "expPoints": "현재 경험치", + "nextLv": "다음 레벨까지", + "cancel": "그만둔다", + + "memoString": "{{natureFragment}}.\n{{metFragment}}", + "metFragment": { + "normal": "{{biome}}에서\nLv{{level}}일 때 만났다.", + "apparently": "{{biome}}에서\nLv{{level}}일 때 만난 것 같다.", + }, + "natureFragment": { + "Hardy": "{{nature}}하는 성격", + "Lonely": "{{nature}}을 타는 성격", + "Brave": "{{nature}}한 성격", + "Adamant": "{{nature}}스러운 성격", + "Naughty" : "{{nature}}같은 성격", + "Bold" : "{{nature}}한 성격", + "Docile" : "{{nature}}한 성격", + "Relaxed" : "{{nature}}한 성격", + "Impish" : "{{nature}}같은 성격", + "Lax" : "{{nature}}거리는 성격", + "Timid" : "{{nature}}같은 성격", + "Hasty" : "{{nature}}한 성격", + "Serious" : "{{nature}}한 성격", + "Jolly" : "{{nature}}한 성격", + "Naive" : "{{nature}}한 성격", + "Modest" : "{{nature}}스러운 성격", + "Mild" : "{{nature}}한 성격", + "Quiet" : "{{nature}}한 성격", + "Bashful" : "{{nature}}을 타는 성격", + "Rash" : "{{nature}}거리는 성격", + "Calm" : "{{nature}}한 성격", + "Gentle" : "{{nature}}한 성격", + "Sassy" : "{{nature}}진 성격", + "Careful" : "{{nature}}한 성격", + "Quirky": "{{nature}}스러운 성격", + }, +} as const; diff --git a/src/locales/pt_BR/config.ts b/src/locales/pt_BR/config.ts index c02da112770..3fda45b5c00 100644 --- a/src/locales/pt_BR/config.ts +++ b/src/locales/pt_BR/config.ts @@ -33,6 +33,7 @@ import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonInfo } from "./pokemon-info"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { pokemonSummary } from "./pokemon-summary"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; @@ -82,6 +83,7 @@ export const ptBrConfig = { pokemon: pokemon, pokemonInfo: pokemonInfo, pokemonInfoContainer: pokemonInfoContainer, + pokemonSummary: pokemonSummary, saveSlotSelectUiHandler: saveSlotSelectUiHandler, statusEffect: statusEffect, terrain: terrain, diff --git a/src/locales/pt_BR/pokemon-summary.ts b/src/locales/pt_BR/pokemon-summary.ts new file mode 100644 index 00000000000..a492e701c94 --- /dev/null +++ b/src/locales/pt_BR/pokemon-summary.ts @@ -0,0 +1,20 @@ +import { TranslationEntries } from "#app/interfaces/locales"; + +export const pokemonSummary: TranslationEntries = { + "pokemonInfo": "Info. Pokémon", + "status": "Status", + "powerAccuracyCategory": "Poder\nPrecisão\nCategoria", + "type": "Tipo", + "unknownTrainer": "Desconhecido", + "ot": "TO", + "nature": "natureza", + "expPoints": "Pontos EXP.", + "nextLv": "Próx. Nv.", + "cancel": "Cancelar", + + "memoString": "Natureza {{natureFragment}},\n{{metFragment}}", + "metFragment": { + "normal": "encontrado no Nv.{{level}},\n{{biome}}.", + "apparently": "aparentemente encontrado no Nv.{{level}},\n{{biome}}.", + }, +} as const; diff --git a/src/locales/zh_CN/config.ts b/src/locales/zh_CN/config.ts index eaf7ba4cc09..dea8c9c156c 100644 --- a/src/locales/zh_CN/config.ts +++ b/src/locales/zh_CN/config.ts @@ -33,6 +33,7 @@ import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonInfo } from "./pokemon-info"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { pokemonSummary } from "./pokemon-summary"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; @@ -82,6 +83,7 @@ export const zhCnConfig = { pokemon: pokemon, pokemonInfo: pokemonInfo, pokemonInfoContainer: pokemonInfoContainer, + pokemonSummary: pokemonSummary, saveSlotSelectUiHandler: saveSlotSelectUiHandler, settings: settings, splashMessages: splashMessages, diff --git a/src/locales/zh_CN/pokemon-summary.ts b/src/locales/zh_CN/pokemon-summary.ts new file mode 100644 index 00000000000..24f0fbeed97 --- /dev/null +++ b/src/locales/zh_CN/pokemon-summary.ts @@ -0,0 +1,19 @@ +import { TranslationEntries } from "#app/interfaces/locales"; + +export const pokemonSummary: TranslationEntries = { + "pokemonInfo": "宝可梦信息", + "status": "状态", + "powerAccuracyCategory": "威力\n命中率\n类别", + "type": "属性", + "unknownTrainer": "未知", + "ot": "训练师", + "nature": "性格", + "expPoints": "经验值", + "nextLv": "下一级", + "cancel": "取消", + + "memoString": "{{natureFragment}} 性格,\n{{metFragment}}", + "metFragment": { + "apparently": "命中注定般地相遇于Lv.{{level}},\n{{biome}}。", + }, +} as const; diff --git a/src/locales/zh_TW/config.ts b/src/locales/zh_TW/config.ts index f19a6941a88..4ee773f1308 100644 --- a/src/locales/zh_TW/config.ts +++ b/src/locales/zh_TW/config.ts @@ -33,6 +33,7 @@ import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonInfo } from "./pokemon-info"; import { pokemonInfoContainer } from "./pokemon-info-container"; +import { pokemonSummary } from "./pokemon-summary"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; @@ -82,6 +83,7 @@ export const zhTwConfig = { pokemon: pokemon, pokemonInfo: pokemonInfo, pokemonInfoContainer: pokemonInfoContainer, + pokemonSummary: pokemonSummary, saveSlotSelectUiHandler: saveSlotSelectUiHandler, settings: settings, splashMessages: splashMessages, diff --git a/src/locales/zh_TW/pokemon-summary.ts b/src/locales/zh_TW/pokemon-summary.ts new file mode 100644 index 00000000000..484ea2a9d67 --- /dev/null +++ b/src/locales/zh_TW/pokemon-summary.ts @@ -0,0 +1,20 @@ +import { TranslationEntries } from "#app/interfaces/locales"; + +export const pokemonSummary: TranslationEntries = { + "pokemonInfo": "Pokémon Info", + "status": "Status", + "powerAccuracyCategory": "Power\nAccuracy\nCategory", + "type": "Type", + "unknownTrainer": "Unknown", + "ot": "OT", + "nature": "nature", + "expPoints": "Exp. Points", + "nextLv": "Next Lv.", + "cancel": "Cancel", + + "memoString": "{{natureFragment}} nature,\n{{metFragment}}", + "metFragment": { + "normal": "met at Lv{{level}},\n{{biome}}.", + "apparently": "apparently met at Lv{{level}},\n{{biome}}.", + }, +} as const; diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index ae94951bc4c..c55bedb7289 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -15,7 +15,7 @@ import { Stat, getStatName } from "../data/pokemon-stat"; import { PokemonHeldItemModifier } from "../modifier/modifier"; import { StatusEffect } from "../data/status-effect"; import { getBiomeName } from "../data/biomes"; -import { getNatureName, getNatureStatMultiplier } from "../data/nature"; +import { Nature, getNatureName, getNatureStatMultiplier } from "../data/nature"; import { loggedInUser } from "../account"; import { Variant, getVariantTint } from "#app/data/variant"; import {Button} from "#enums/buttons"; @@ -122,7 +122,7 @@ export default class SummaryUiHandler extends UiHandler { this.tabSprite.setOrigin(1, 1); this.summaryContainer.add(this.tabSprite); - const summaryLabel = addTextObject(this.scene, 4, -165, "Pokémon Info", TextStyle.SUMMARY); + const summaryLabel = addTextObject(this.scene, 4, -165, i18next.t("pokemonSummary:pokemonInfo"), TextStyle.SUMMARY); summaryLabel.setOrigin(0, 1); this.summaryContainer.add(summaryLabel); @@ -207,7 +207,7 @@ export default class SummaryUiHandler extends UiHandler { this.statusContainer.add(statusBg); - const statusLabel = addTextObject(this.scene, 3, 0, "Status", TextStyle.SUMMARY); + const statusLabel = addTextObject(this.scene, 3, 0, i18next.t("pokemonSummary:status"), TextStyle.SUMMARY); statusLabel.setOrigin(0, 0); this.statusContainer.add(statusLabel); @@ -227,7 +227,7 @@ export default class SummaryUiHandler extends UiHandler { moveEffectBg.setOrigin(0, 0); this.moveEffectContainer.add(moveEffectBg); - const moveEffectLabels = addTextObject(this.scene, 8, 12, "Power\nAccuracy\nCategory", TextStyle.SUMMARY); + const moveEffectLabels = addTextObject(this.scene, 8, 12, i18next.t("pokemonSummary:powerAccuracyCategory"), TextStyle.SUMMARY); moveEffectLabels.setLineSpacing(9); moveEffectLabels.setOrigin(0, 0); @@ -677,12 +677,7 @@ export default class SummaryUiHandler extends UiHandler { const profileContainer = this.scene.add.container(0, -pageBg.height); pageContainer.add(profileContainer); - const trainerLabel = addTextObject(this.scene, 7, 12, "OT/", TextStyle.SUMMARY_ALT); - trainerLabel.setOrigin(0, 0); - profileContainer.add(trainerLabel); - - const trainerText = addTextObject(this.scene, 25, 12, loggedInUser?.username || "Unknown", - this.scene.gameData.gender === PlayerGender.FEMALE ? TextStyle.SUMMARY_PINK : TextStyle.SUMMARY_BLUE); + const trainerText = addBBCodeTextObject(this.scene, 7, 12, `${i18next.t("pokemonSummary:ot")}/${getBBCodeFrag(loggedInUser?.username || i18next.t("pokemonSummary:unknown"), this.scene.gameData.gender === PlayerGender.FEMALE ? TextStyle.SUMMARY_PINK : TextStyle.SUMMARY_BLUE)}`, TextStyle.SUMMARY_ALT); trainerText.setOrigin(0, 0); profileContainer.add(trainerText); @@ -690,12 +685,12 @@ export default class SummaryUiHandler extends UiHandler { trainerIdText.setOrigin(0, 0); profileContainer.add(trainerIdText); - const typeLabel = addTextObject(this.scene, 7, 28, "Type/", TextStyle.WINDOW_ALT); + const typeLabel = addTextObject(this.scene, 7, 28, `${i18next.t("pokemonSummary:type")}/`, TextStyle.WINDOW_ALT); typeLabel.setOrigin(0, 0); profileContainer.add(typeLabel); const getTypeIcon = (index: integer, type: Type, tera: boolean = false) => { - const xCoord = 39 + 34 * index; + const xCoord = typeLabel.width * typeLabel.scale + 9 + 34 * index; const typeIcon = !tera ? this.scene.add.sprite(xCoord, 42, `types${Utils.verifyLang(i18next.resolvedLanguage) ? `_${i18next.resolvedLanguage}` : ""}`, Type[type].toLowerCase()) : this.scene.add.sprite(xCoord, 42, "type_tera"); if (tera) { @@ -796,7 +791,20 @@ export default class SummaryUiHandler extends UiHandler { this.passiveContainer?.nameText.setVisible(false); this.passiveContainer?.descriptionText.setVisible(false); - const memoString = `${getBBCodeFrag(Utils.toReadableString(getNatureName(this.pokemon.getNature())), TextStyle.SUMMARY_RED)}${getBBCodeFrag(" nature,", TextStyle.WINDOW_ALT)}\n${getBBCodeFrag(`${this.pokemon.metBiome === -1 ? "apparently " : ""}met at Lv`, TextStyle.WINDOW_ALT)}${getBBCodeFrag(this.pokemon.metLevel.toString(), TextStyle.SUMMARY_RED)}${getBBCodeFrag(",", TextStyle.WINDOW_ALT)}\n${getBBCodeFrag(getBiomeName(this.pokemon.metBiome), TextStyle.SUMMARY_RED)}${getBBCodeFrag(".", TextStyle.WINDOW_ALT)}`; + const closeFragment = getBBCodeFrag("", TextStyle.WINDOW_ALT); + const rawNature = Utils.toReadableString(Nature[this.pokemon.getNature()]); + const nature = `${getBBCodeFrag(Utils.toReadableString(getNatureName(this.pokemon.getNature())), TextStyle.SUMMARY_RED)}${closeFragment}`; + + const memoString = i18next.t("pokemonSummary:memoString", { + metFragment: i18next.t(`pokemonSummary:metFragment.${this.pokemon.metBiome === -1? "apparently": "normal"}`, { + biome: `${getBBCodeFrag(getBiomeName(this.pokemon.metBiome), TextStyle.SUMMARY_RED)}${closeFragment}`, + level: `${getBBCodeFrag(this.pokemon.metLevel.toString(), TextStyle.SUMMARY_RED)}${closeFragment}`, + }), + natureFragment: + i18next.exists(`pokemonSummary:natureFragment.${rawNature}`) ? + i18next.t(`pokemonSummary:natureFragment.${rawNature}`, { nature: nature }) : + nature, + }); const memoText = addBBCodeTextObject(this.scene, 7, 113, memoString, TextStyle.WINDOW_ALT); memoText.setOrigin(0, 0); @@ -809,9 +817,7 @@ export default class SummaryUiHandler extends UiHandler { const stats = Utils.getEnumValues(Stat) as Stat[]; stats.forEach((stat, s) => { - const statName = stat !== Stat.HP - ? getStatName(stat) - : "HP"; + const statName = getStatName(stat); const rowIndex = s % 3; const colIndex = Math.floor(s / 3); @@ -848,11 +854,11 @@ export default class SummaryUiHandler extends UiHandler { const relLvExp = getLevelRelExp(this.pokemon.level + 1, this.pokemon.species.growthRate); const expRatio = this.pokemon.level < this.scene.getMaxExpLevel() ? this.pokemon.levelExp / relLvExp : 0; - const expLabel = addTextObject(this.scene, 6, 112, "EXP. Points", TextStyle.SUMMARY); + const expLabel = addTextObject(this.scene, 6, 112, i18next.t("pokemonSummary:expPoints"), TextStyle.SUMMARY); expLabel.setOrigin(0, 0); statsContainer.add(expLabel); - const nextLvExpLabel = addTextObject(this.scene, 6, 128, "Next Lv.", TextStyle.SUMMARY); + const nextLvExpLabel = addTextObject(this.scene, 6, 128, i18next.t("pokemonSummary:nextLv"), TextStyle.SUMMARY); nextLvExpLabel.setOrigin(0, 0); statsContainer.add(nextLvExpLabel); @@ -893,7 +899,7 @@ export default class SummaryUiHandler extends UiHandler { extraRowOverlay.setOrigin(0, 1); this.extraMoveRowContainer.add(extraRowOverlay); - const extraRowText = addTextObject(this.scene, 35, 0, this.summaryUiMode === SummaryUiMode.LEARN_MOVE ? this.newMove.name : "Cancel", + const extraRowText = addTextObject(this.scene, 35, 0, this.summaryUiMode === SummaryUiMode.LEARN_MOVE ? this.newMove.name : i18next.t("pokemonSummary:cancel"), this.summaryUiMode === SummaryUiMode.LEARN_MOVE ? TextStyle.SUMMARY_PINK : TextStyle.SUMMARY); extraRowText.setOrigin(0, 1); this.extraMoveRowContainer.add(extraRowText);