From cb5016d10ff161b2bf47e36092fcc35a62b13046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?hibiya=20=28=EA=B9=80=EC=A2=85=EC=9D=B4=29?= Date: Sun, 23 Jun 2024 10:55:09 +0900 Subject: [PATCH] [Localization] include pokemon names, stats into battle:stat* keys (#2373) * [Localization] include pokemon names, stats into battle:stat* keys * [Localization(fr)] Update stat change messages Co-Authored-By: Lugiad * [Localization(es)] Update stat change messages Co-Authored-By: GoldTra <162721984+GoldTra@users.noreply.github.com> --------- Co-authored-by: Lugiad Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> --- src/data/battle-stat.ts | 62 ++++++++++++----------- src/locales/de/battle.ts | 16 +++--- src/locales/en/battle.ts | 16 +++--- src/locales/es/battle.ts | 16 +++--- src/locales/fr/battle.ts | 18 +++---- src/locales/it/battle.ts | 16 +++--- src/locales/ko/battle.ts | 16 +++--- src/locales/pt_BR/battle.ts | 16 +++--- src/locales/zh_CN/battle.ts | 16 +++--- src/locales/zh_TW/battle.ts | 16 +++--- src/phases.ts | 2 +- src/test/lokalisation/battle-stat.test.ts | 2 +- 12 files changed, 108 insertions(+), 104 deletions(-) diff --git a/src/data/battle-stat.ts b/src/data/battle-stat.ts index 86764f9973a..7dccd4f8a7c 100644 --- a/src/data/battle-stat.ts +++ b/src/data/battle-stat.ts @@ -32,34 +32,38 @@ export function getBattleStatName(stat: BattleStat) { } } -export function getBattleStatLevelChangeDescription(levels: integer, up: boolean) { - if (up) { - switch (levels) { - case 1: - return i18next.t("battle:statRose"); - case 2: - return i18next.t("battle:statSharplyRose"); - case 3: - case 4: - case 5: - case 6: - return i18next.t("battle:statRoseDrastically"); - default: - return i18next.t("battle:statWontGoAnyHigher"); +export function getBattleStatLevelChangeDescription(pokemonNameWithAffix: string, stats: string, levels: integer, up: boolean) { + const stringKey = (() => { + if (up) { + switch (levels) { + case 1: + return "battle:statRose"; + case 2: + return "battle:statSharplyRose"; + case 3: + case 4: + case 5: + case 6: + return "battle:statRoseDrastically"; + default: + return "battle:statWontGoAnyHigher"; + } + } else { + switch (levels) { + case 1: + return "battle:statFell"; + case 2: + return "battle:statHarshlyFell"; + case 3: + case 4: + case 5: + case 6: + return "battle:statSeverelyFell"; + default: + return "battle:statWontGoAnyLower"; + } } - } else { - switch (levels) { - case 1: - return i18next.t("battle:statFell"); - case 2: - return i18next.t("battle:statHarshlyFell"); - case 3: - case 4: - case 5: - case 6: - return i18next.t("battle:statSeverelyFell"); - default: - return i18next.t("battle:statWontGoAnyLower"); - } - } + })(); + + return i18next.t(stringKey, { pokemonNameWithAffix, stats }); } diff --git a/src/locales/de/battle.ts b/src/locales/de/battle.ts index f7db3c143ce..bcbd8c3298d 100644 --- a/src/locales/de/battle.ts +++ b/src/locales/de/battle.ts @@ -64,14 +64,14 @@ export const battle: SimpleTranslationEntries = { "drainMessage": "{{pokemonName}} wurde Energie abgesaugt", "regainHealth": "KP von {{pokemonName}} wurden wieder aufgefrischt!", "fainted": "{{pokemonNameWithAffix}} wurde besiegt!", - "statRose": "steigt", - "statSharplyRose": "steigt stark", - "statRoseDrastically": "steigt drastisch", - "statWontGoAnyHigher": "kann nicht weiter erhöht werden", - "statFell": "sinkt", - "statHarshlyFell": "sinkt stark", - "statSeverelyFell": "sinkt drastisch", - "statWontGoAnyLower": "kann nicht weiter sinken", + "statRose": "{{stats}} von {{pokemonNameWithAffix}} steigt!", + "statSharplyRose": "{{stats}} von {{pokemonNameWithAffix}} steigt stark!", + "statRoseDrastically": "{{stats}} von {{pokemonNameWithAffix}} steigt drastisch!", + "statWontGoAnyHigher": "{{stats}} von {{pokemonNameWithAffix}} kann nicht weiter erhöht werden!", + "statFell": "{{stats}} von {{pokemonNameWithAffix}} sinkt!", + "statHarshlyFell": "{{stats}} von {{pokemonNameWithAffix}} sinkt stark!", + "statSeverelyFell": "{{stats}} von {{pokemonNameWithAffix}} sinkt drastisch!", + "statWontGoAnyLower": "{{stats}} von {{pokemonNameWithAffix}} kann nicht weiter sinken!", "ppReduced": "It reduced the PP of {{targetName}}'s\n{{moveName}} by {{reduction}}!", "battlerTagsRechargingLapse": "{{pokemonNameWithAffix}} kann sich wegen des Rückstoßes durch den Angriff nicht bewegen!", "battlerTagsTrappedOnAdd": "{{pokemonNameWithAffix}} kann nicht mehr fliehen!", diff --git a/src/locales/en/battle.ts b/src/locales/en/battle.ts index e2334e43c8a..37196286252 100644 --- a/src/locales/en/battle.ts +++ b/src/locales/en/battle.ts @@ -64,14 +64,14 @@ export const battle: SimpleTranslationEntries = { "drainMessage": "{{pokemonName}} had its\nenergy drained!", "regainHealth": "{{pokemonName}} regained\nhealth!", "fainted": "{{pokemonNameWithAffix}} fainted!", - "statRose": "rose", - "statSharplyRose": "sharply rose", - "statRoseDrastically": "rose drastically", - "statWontGoAnyHigher": "won't go any higher", - "statFell": "fell", - "statHarshlyFell": "harshly fell", - "statSeverelyFell": "severely fell", - "statWontGoAnyLower": "won't go any lower", + "statRose": "{{pokemonNameWithAffix}}'s {{stats}} rose!", + "statSharplyRose": "{{pokemonNameWithAffix}}'s {{stats}} sharply rose!", + "statRoseDrastically": "{{pokemonNameWithAffix}}'s {{stats}} rose drastically!", + "statWontGoAnyHigher": "{{pokemonNameWithAffix}}'s {{stats}} won't go any higher!", + "statFell": "{{pokemonNameWithAffix}}'s {{stats}} fell!", + "statHarshlyFell": "{{pokemonNameWithAffix}}'s {{stats}} harshly fell!", + "statSeverelyFell": "{{pokemonNameWithAffix}}'s {{stats}} severely fell!", + "statWontGoAnyLower": "{{pokemonNameWithAffix}}'s {{stats}} won't go any lower!", "ppReduced": "It reduced the PP of {{targetName}}'s\n{{moveName}} by {{reduction}}!", "battlerTagsRechargingLapse": "{{pokemonNameWithAffix}} must\nrecharge!", "battlerTagsTrappedOnAdd": "{{pokemonNameWithAffix}} can no\nlonger escape!", diff --git a/src/locales/es/battle.ts b/src/locales/es/battle.ts index e86e1bb160d..058aa5fce5a 100644 --- a/src/locales/es/battle.ts +++ b/src/locales/es/battle.ts @@ -64,14 +64,14 @@ export const battle: SimpleTranslationEntries = { "drainMessage": "¡{{pokemonName}} tuvo su\nenergía absorbida!", "regainHealth": "¡{{pokemonName}} recuperó\nPS!", "fainted": "¡{{pokemonNameWithAffix}} se debilitó!", - "statRose": "rose", - "statSharplyRose": "sharply rose", - "statRoseDrastically": "rose drastically", - "statWontGoAnyHigher": "won't go any higher", - "statFell": "fell", - "statHarshlyFell": "harshly fell", - "statSeverelyFell": "severely fell", - "statWontGoAnyLower": "won't go any lower", + "statRose": "¡El {{stats}} de {{pokemonNameWithAffix}} ha subido!", + "statSharplyRose": "¡El {{stats}} de {{pokemonNameWithAffix}} ha subido mucho!", + "statRoseDrastically": "¡El {{stats}} de {{pokemonNameWithAffix}} ha subido muchísimo!", + "statWontGoAnyHigher": "¡El {{stats}} de {{pokemonNameWithAffix}} no puede subir más!", + "statFell": "¡El {{stats}} de {{pokemonNameWithAffix}} ha bajado!", + "statHarshlyFell": "¡El {{stats}} de {{pokemonNameWithAffix}}} ha bajado mucho!", + "statSeverelyFell": "¡El {{stats}} de {{pokemonNameWithAffix}} ha bajado muchísimo!", + "statWontGoAnyLower": "¡El {{stats}} de {{pokemonNameWithAffix}} no puede bajar más!", "ppReduced": "It reduced the PP of {{targetName}}'s\n{{moveName}} by {{reduction}}!", "battlerTagsRechargingLapse": "{{pokemonNameWithAffix}} must\nrecharge!", "battlerTagsTrappedOnAdd": "{{pokemonNameWithAffix}} can no\nlonger escape!", diff --git a/src/locales/fr/battle.ts b/src/locales/fr/battle.ts index dd90d59dc2e..69a19e20065 100644 --- a/src/locales/fr/battle.ts +++ b/src/locales/fr/battle.ts @@ -64,15 +64,15 @@ export const battle: SimpleTranslationEntries = { "drainMessage": "L’énergie de {{pokemonName}}\nest drainée !", "regainHealth": "{{pokemonName}} récupère\ndes PV !", "fainted": "{{pokemonNameWithAffix}}\nest K.O. !", - "statRose": "augmente", - "statSharplyRose": "augmente beaucoup", - "statRoseDrastically": "augmente énormément", - "statWontGoAnyHigher": "ne peut plus augmenter", - "statFell": "baisse", - "statHarshlyFell": "baisse beaucoup", - "statSeverelyFell": "baisse énormément", - "statWontGoAnyLower": "ne peut plus baisser", - "ppReduced": "Les PP de la capacité {{moveName}}\nde {{targetName}} sont réduits de {{reduction}} !", + "statRose": "{{stats}} de {{pokemonNameWithAffix}}\naugmente !", + "statSharplyRose": "{{stats}} de {{pokemonNameWithAffix}}\naugmente beaucoup !", + "statRoseDrastically": "{{stats}} de {{pokemonNameWithAffix}}\naugmente énormément !", + "statWontGoAnyHigher": "{{stats}} de {{pokemonNameWithAffix}}\nne peut plus augmenter !", + "statFell": "{{stats}} de {{pokemonNameWithAffix}}\nbaisse !", + "statHarshlyFell": "{{stats}} de {{pokemonNameWithAffix}}\nbaisse beaucoup !", + "statSeverelyFell": "{{stats}} de {{pokemonNameWithAffix}}\nbaisse énormément !", + "statWontGoAnyLower": "{{stats}} de {{pokemonNameWithAffix}}\nne peut plus baisser !", + "ppReduced": "Les PP de la capacité {{moveName}}\nde {{targetName}} baissent de {{reduction}} !", "battlerTagsRechargingLapse": "Le contrecoup empêche {{pokemonNameWithAffix}}\n de bouger !", "battlerTagsTrappedOnAdd": "{{pokemonNameWithAffix}}\nne peut plus s’échapper !", "battlerTagsTrappedOnRemove": "{{pokemonNameWithAffix}} est libéré\nde la capacité {{moveName}} !", diff --git a/src/locales/it/battle.ts b/src/locales/it/battle.ts index 867bbbd4e57..9cb2b7913f8 100644 --- a/src/locales/it/battle.ts +++ b/src/locales/it/battle.ts @@ -64,14 +64,14 @@ export const battle: SimpleTranslationEntries = { "drainMessage": "Viene prelevata energia\n da{{pokemonName}}!", "regainHealth": "{{pokemonName}} ha rigenerato\npunti salute!", "fainted": "{{pokemonNameWithAffix}} non è più in\ngrado di combattere!", - "statRose": "è aumentato/a", - "statSharplyRose": "è aumentato/a molto", - "statRoseDrastically": "è aumentato/a drasticamente", - "statWontGoAnyHigher": "non può aumentare più di così", - "statFell": "è diminuito/a", - "statHarshlyFell": "è diminuito/a molto", - "statSeverelyFell": "è diminuito/a drasticamente", - "statWontGoAnyLower": "non può diminuire più di così", + "statRose": "{{pokemonNameWithAffix}}'s {{stats}} è aumentato/a!", + "statSharplyRose": "{{pokemonNameWithAffix}}'s {{stats}} è aumentato/a molto!", + "statRoseDrastically": "{{pokemonNameWithAffix}}'s {{stats}} è aumentato/a drasticamente!", + "statWontGoAnyHigher": "{{pokemonNameWithAffix}}'s {{stats}} non può aumentare più di così!", + "statFell": "{{pokemonNameWithAffix}}'s {{stats}} è diminuito/a!", + "statHarshlyFell": "{{pokemonNameWithAffix}}'s {{stats}} è diminuito/a molto!", + "statSeverelyFell": "{{pokemonNameWithAffix}}'s {{stats}} è diminuito/a drasticamente!", + "statWontGoAnyLower": "{{pokemonNameWithAffix}}'s {{stats}} non può diminuire più di così!", "ppReduced": "It reduced the PP of {{targetName}}'s\n{{moveName}} by {{reduction}}!", "battlerTagsRechargingLapse": "{{pokemonNameWithAffix}} deve\nricaricarsi!", "battlerTagsTrappedOnAdd": "{{pokemonNameWithAffix}} non può\npiù fuggire!", diff --git a/src/locales/ko/battle.ts b/src/locales/ko/battle.ts index 9d212db4df7..38976500f8b 100644 --- a/src/locales/ko/battle.ts +++ b/src/locales/ko/battle.ts @@ -64,14 +64,14 @@ export const battle: SimpleTranslationEntries = { "drainMessage": "{{pokemonName}}[[로]]부터\n체력을 흡수했다!", "regainHealth": "{{pokemonName}}[[는]]\n체력을 회복했다!", "fainted": "{{pokemonNameWithAffix}}[[는]] 쓰러졌다!", - "statRose": "[[가]] 올라갔다!", - "statSharplyRose": "[[가]] 크게 올라갔다!", - "statRoseDrastically": "[[가]] 매우 크게 올라갔다!", - "statWontGoAnyHigher": "[[는]] 더 올라가지 않는다!", - "statFell": "[[가]] 떨어졌다!", - "statHarshlyFell": "[[가]] 크게 떨어졌다!", - "statSeverelyFell": "[[가]] 매우 크게 떨어졌다!", - "statWontGoAnyLower": "[[는]] 더 떨어지지 않는다!", + "statRose": "{{pokemonNameWithAffix}}의\n{{stats}}[[가]] 올라갔다!", + "statSharplyRose": "{{pokemonNameWithAffix}}의\n{{stats}}[[가]] 크게 올라갔다!", + "statRoseDrastically": "{{pokemonNameWithAffix}}의\n{{stats}}[[가]] 매우 크게 올라갔다!", + "statWontGoAnyHigher": "{{pokemonNameWithAffix}}의\n{{stats}}[[는]] 더 올라가지 않는다!", + "statFell": "{{pokemonNameWithAffix}}의\n{{stats}}[[가]] 떨어졌다!", + "statHarshlyFell": "{{pokemonNameWithAffix}}의\n{{stats}}[[가]] 크게 떨어졌다!", + "statSeverelyFell": "{{pokemonNameWithAffix}}의\n{{stats}}[[가]] 매우 크게 떨어졌다!", + "statWontGoAnyLower": "{{pokemonNameWithAffix}}의\n{{stats}}[[는]] 더 떨어지지 않는다!", "ppReduced": "{{targetName}}의\n{{moveName}}[[를]] {{reduction}} 깎았다!", "battlerTagsRechargingLapse": "공격의 반동으로\n{{pokemonNameWithAffix}}[[는]] 움직일 수 없다!", "battlerTagsTrappedOnAdd": "{{pokemonNameWithAffix}}[[는]]\n이제 도망칠 수 없다!", diff --git a/src/locales/pt_BR/battle.ts b/src/locales/pt_BR/battle.ts index 7235df7e547..d7d4a640db2 100644 --- a/src/locales/pt_BR/battle.ts +++ b/src/locales/pt_BR/battle.ts @@ -64,14 +64,14 @@ export const battle: SimpleTranslationEntries = { "drainMessage": "{{pokemonName}} teve sua\nenergia drenada!", "regainHealth": "{{pokemonName}} recuperou\npontos de saúde!", "fainted": "{{pokemonNameWithAffix}} desmaiou!", - "statRose": "aumentou", - "statSharplyRose": "aumentou bruscamente", - "statRoseDrastically": "aumentou drasticamente", - "statWontGoAnyHigher": "não vai mais aumentar", - "statFell": "diminuiu", - "statHarshlyFell": "diminuiu duramente", - "statSeverelyFell": "diminuiu severamente", - "statWontGoAnyLower": "não vai mais diminuir", + "statRose": "{{pokemonNameWithAffix}}'s {{stats}} aumentou!", + "statSharplyRose": "{{pokemonNameWithAffix}}'s {{stats}} aumentou bruscamente!", + "statRoseDrastically": "{{pokemonNameWithAffix}}'s {{stats}} aumentou drasticamente!", + "statWontGoAnyHigher": "{{pokemonNameWithAffix}}'s {{stats}} não vai mais aumentar!", + "statFell": "{{pokemonNameWithAffix}}'s {{stats}} diminuiu!", + "statHarshlyFell": "{{pokemonNameWithAffix}}'s {{stats}} diminuiu duramente!", + "statSeverelyFell": "{{pokemonNameWithAffix}}'s {{stats}} diminuiu severamente!", + "statWontGoAnyLower": "{{pokemonNameWithAffix}}'s {{stats}} não vai mais diminuir!", "ppReduced": "O PP do movimento {{moveName}} de\n{{targetName}} foi reduzido em {{reduction}}!", "battlerTagsRechargingLapse": "{{pokemonNameWithAffix}} precisa\nrecarregar!", "battlerTagsTrappedOnAdd": "{{pokemonNameWithAffix}} não pode\nmais escapar!", diff --git a/src/locales/zh_CN/battle.ts b/src/locales/zh_CN/battle.ts index fdf5b3dd27b..c70a96d9516 100644 --- a/src/locales/zh_CN/battle.ts +++ b/src/locales/zh_CN/battle.ts @@ -64,14 +64,14 @@ export const battle: SimpleTranslationEntries = { "drainMessage": "{{pokemonName}} 吸取了体力!", "regainHealth": "{{pokemonName}} 回复了体力!", "fainted": "{{pokemonNameWithAffix}} 倒下了!", - "statRose": "提高了!", - "statSharplyRose": "大幅提高了!", - "statRoseDrastically": "极大幅提高了!", - "statWontGoAnyHigher": "已经无法再提高了!", - "statFell": "降低了!", - "statHarshlyFell": "大幅降低了!", - "statSeverelyFell": "极大幅降低了!", - "statWontGoAnyLower": "已经无法再降低了!", + "statRose": "{{pokemonNameWithAffix}}'s {{stats}} 提高了!", + "statSharplyRose": "{{pokemonNameWithAffix}}'s {{stats}} 大幅提高了!", + "statRoseDrastically": "{{pokemonNameWithAffix}}'s {{stats}} 极大幅提高了!", + "statWontGoAnyHigher": "{{pokemonNameWithAffix}}'s {{stats}} 已经无法再提高了!", + "statFell": "{{pokemonNameWithAffix}}'s {{stats}} 降低了!", + "statHarshlyFell": "{{pokemonNameWithAffix}}'s {{stats}} 大幅降低了!", + "statSeverelyFell": "{{pokemonNameWithAffix}}'s {{stats}} 极大幅降低了!", + "statWontGoAnyLower": "{{pokemonNameWithAffix}}'s {{stats}} 已经无法再降低了!", "ppReduced": "降低了 {{targetName}} 的\n{{moveName}} 的PP{{reduction}}点!", "battlerTagsRechargingLapse": "{{pokemonNameWithAffix}}因攻击的反作用力而无法动弹!", "battlerTagsTrappedOnAdd": "{{pokemonNameWithAffix}}不能逃跑!", diff --git a/src/locales/zh_TW/battle.ts b/src/locales/zh_TW/battle.ts index 526207b85b8..bab1d09a8df 100644 --- a/src/locales/zh_TW/battle.ts +++ b/src/locales/zh_TW/battle.ts @@ -61,14 +61,14 @@ export const battle: SimpleTranslationEntries = { "drainMessage": "{{pokemonName}} had its\nenergy drained!", "regainHealth": "{{pokemonName}} regained\nhealth!", "fainted": "{{pokemonNameWithAffix}} fainted!", - "statRose": "rose", - "statSharplyRose": "sharply rose", - "statRoseDrastically": "rose drastically", - "statWontGoAnyHigher": "won't go any higher", - "statFell": "fell", - "statHarshlyFell": "harshly fell", - "statSeverelyFell": "severely fell", - "statWontGoAnyLower": "won't go any lower", + "statRose": "{{pokemonNameWithAffix}}'s {{stats}} rose!", + "statSharplyRose": "{{pokemonNameWithAffix}}'s {{stats}} sharply rose!", + "statRoseDrastically": "{{pokemonNameWithAffix}}'s {{stats}} rose drastically!", + "statWontGoAnyHigher": "{{pokemonNameWithAffix}}'s {{stats}} won't go any higher!", + "statFell": "{{pokemonNameWithAffix}}'s {{stats}} fell!", + "statHarshlyFell": "{{pokemonNameWithAffix}}'s {{stats}} harshly fell!", + "statSeverelyFell": "{{pokemonNameWithAffix}}'s {{stats}} severely fell!", + "statWontGoAnyLower": "{{pokemonNameWithAffix}}'s {{stats}} won't go any lower!", "ppReduced": "It reduced the PP of {{targetName}}'s\n{{moveName}} by {{reduction}}!", "battlerTagsRechargingLapse": "{{pokemonNameWithAffix}} must\nrecharge!", "battlerTagsTrappedOnAdd": "{{pokemonNameWithAffix}} can no\nlonger escape!", diff --git a/src/phases.ts b/src/phases.ts index 704f5e84391..1cbf53b760c 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -3380,7 +3380,7 @@ export class StatChangePhase extends PokemonPhase { } else { statsFragment = getBattleStatName(relLevelStats[0]); } - messages.push(getPokemonMessage(this.getPokemon(), `'s ${statsFragment} ${getBattleStatLevelChangeDescription(Math.abs(parseInt(rl)), levels >= 1)}!`)); + messages.push(getBattleStatLevelChangeDescription(getPokemonNameWithAffix(this.getPokemon()), statsFragment, Math.abs(parseInt(rl)), levels >= 1)); }); return messages; diff --git a/src/test/lokalisation/battle-stat.test.ts b/src/test/lokalisation/battle-stat.test.ts index cd21f638258..d894d705947 100644 --- a/src/test/lokalisation/battle-stat.test.ts +++ b/src/test/lokalisation/battle-stat.test.ts @@ -41,7 +41,7 @@ function testBattleStatName(stat: BattleStat, expectMessage: string) { } function testBattleStatLevelChangeDescription(levels: integer, up: boolean, expectMessage: string) { - const message = getBattleStatLevelChangeDescription(levels, up); + const message = getBattleStatLevelChangeDescription("{{pokemonNameWithAffix}}", "{{stats}}", levels, up); console.log(`message ${message}, expected ${expectMessage}`); expect(message).toBe(expectMessage); }