From 8dce9fa2f9f976ae206e8567e2cb997d08daf634 Mon Sep 17 00:00:00 2001 From: Alessandro Bruzzese <69127023+Bruzzii@users.noreply.github.com> Date: Thu, 16 May 2024 10:37:40 +0200 Subject: [PATCH] Added splash messages literals for all languages (#600) * Added splash messages literals for all languages * Removed debug code + fixed function casing --------- Co-authored-by: Benjamin Odom --- src/data/splash-messages.ts | 80 +++++++++++++++++-------------- src/locales/de/config.ts | 2 + src/locales/de/splash-messages.ts | 37 ++++++++++++++ src/locales/en/config.ts | 2 + src/locales/en/splash-messages.ts | 37 ++++++++++++++ src/locales/es/config.ts | 2 + src/locales/es/splash-messages.ts | 37 ++++++++++++++ src/locales/fr/config.ts | 2 + src/locales/fr/splash-messages.ts | 37 ++++++++++++++ src/locales/it/config.ts | 2 + src/locales/it/splash-messages.ts | 37 ++++++++++++++ src/plugins/i18n.ts | 1 + src/ui/title-ui-handler.ts | 8 ++-- 13 files changed, 244 insertions(+), 40 deletions(-) create mode 100644 src/locales/de/splash-messages.ts create mode 100644 src/locales/en/splash-messages.ts create mode 100644 src/locales/es/splash-messages.ts create mode 100644 src/locales/fr/splash-messages.ts create mode 100644 src/locales/it/splash-messages.ts diff --git a/src/data/splash-messages.ts b/src/data/splash-messages.ts index 198ff07cec9..3a40429e9b6 100644 --- a/src/data/splash-messages.ts +++ b/src/data/splash-messages.ts @@ -1,37 +1,45 @@ -export const battleCountSplashMessage = '{COUNT} Battles Won!'; +import i18next from "../plugins/i18n"; -export const splashMessages = Array(10).fill(battleCountSplashMessage); -splashMessages.push(...[ - 'Join the Discord!', - 'Infinite Levels!', - 'Everything Stacks!', - 'Optional Save Scumming!', - '35 Biomes!', - 'Open Source!', - 'Play with 5x Speed!', - 'Live Bug Testing!', - 'Heavy RoR2 Influence!', - 'Pokémon Risk and Pokémon Rain!', - 'Now with 33% More Salt!', - 'Infinite Fusion at Home!', - 'Broken Egg Moves!', - 'Magnificent!', - 'Mubstitute!', - 'That\'s Crazy!', - 'Orance Juice!', - 'Questionable Balancing!', - 'Cool Shaders!', - 'AI-Free!', - 'Sudden Difficulty Spikes!', - 'Based on an Unfinished Flash Game!', - 'More Addictive than Intended!', - 'Mostly Consistent Seeds!', - 'Achievement Points Don\'t Do Anything!', - 'You Do Not Start at Level 2000!', - 'Don\'t Talk About the Manaphy Egg Incident!', - 'Also Try Pokéngine!', - 'Also Try Emerald Rogue!', - 'Also Try Radical Red!', - 'Eevee Expo!', - 'YNOproject!' -]); \ No newline at end of file +export function getBattleCountSplashMessage(): string { + return `{COUNT} ${i18next.t('splashMessages:battlesWon')}`; +} + +export function getSplashMessages(): string[] { + const splashMessages = Array(10).fill(getBattleCountSplashMessage()); + splashMessages.push(...[ + i18next.t('splashMessages:joinTheDiscord'), + i18next.t('splashMessages:infiniteLevel'), + i18next.t('splashMessages:everythingStacks'), + i18next.t('splashMessages:optionalSaveScumming'), + i18next.t('splashMessages:biomes'), + i18next.t('splashMessages:openSource'), + i18next.t('splashMessages:playWith5xSpeed'), + i18next.t('splashMessages:liveBugTesting'), + i18next.t('splashMessages:heavyRoR2Influence'), + i18next.t('splashMessages:pokemonRiskAndPokemonRain'), + i18next.t('splashMessages:nowWithMoreSalt'), + i18next.t('splashMessages:infiniteFusionAtHome'), + i18next.t('splashMessages:brokenEggMoves'), + i18next.t('splashMessages:magnificent'), + i18next.t('splashMessages:mubstitute'), + i18next.t('splashMessages:thatsCrazy'), + i18next.t('splashMessages:oranceJuice'), + i18next.t('splashMessages:questionableBalancing'), + i18next.t('splashMessages:coolShaders'), + i18next.t('splashMessages:aiFree'), + i18next.t('splashMessages:suddenDifficultySpikes'), + i18next.t('splashMessages:basedOnAnUnfinishedFlashGame'), + i18next.t('splashMessages:moreAddictiveThanIntended'), + i18next.t('splashMessages:mostlyConsistentSeeds'), + i18next.t('splashMessages:achievementPointsDontDoAnything'), + i18next.t('splashMessages:youDoNotStartAtLevel'), + i18next.t('splashMessages:dontTalkAboutTheManaphyEggIncident'), + i18next.t('splashMessages:alsoTryPokengine'), + i18next.t('splashMessages:alsoTryEmeraldRogue'), + i18next.t('splashMessages:alsoTryRadicalRed'), + i18next.t('splashMessages:eeveeExpo'), + i18next.t('splashMessages:ynoproject'), + ]); + + return splashMessages +} \ No newline at end of file diff --git a/src/locales/de/config.ts b/src/locales/de/config.ts index 7c8b455ef3d..72200a5141c 100644 --- a/src/locales/de/config.ts +++ b/src/locales/de/config.ts @@ -15,6 +15,7 @@ import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { tutorial } from "./tutorial"; +import { splashMessages } from "./splash-messages" export const deConfig = { @@ -32,6 +33,7 @@ export const deConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + splashMessages: splashMessages, nature: nature, growth: growth, modifierType: modifierType, diff --git a/src/locales/de/splash-messages.ts b/src/locales/de/splash-messages.ts new file mode 100644 index 00000000000..6815d7f1824 --- /dev/null +++ b/src/locales/de/splash-messages.ts @@ -0,0 +1,37 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const splashMessages: SimpleTranslationEntries = { + "battlesWon": "Battles Won!", + "joinTheDiscord": "Join the Discord!", + "infiniteLevels": "Infinite Levels!", + "everythingStacks": "Everything Stacks!", + "optionalSaveScumming": "Optional Save Scumming!", + "biomes": "35 Biomes!", + "openSource": "Open Source!", + "playWithSpeed": "Play with 5x Speed!", + "liveBugTesting": "Live Bug Testing!", + "heavyInfluence": "Heavy RoR2 Influence!", + "pokemonRiskAndPokemonRain": "Pokémon Risk and Pokémon Rain!", + "nowWithMoreSalt": "Now with 33% More Salt!", + "infiniteFusionAtHome": "Infinite Fusion at Home!", + "brokenEggMoves": "Broken Egg Moves!", + "magnificent": "Magnificent!", + "mubstitute": "Mubstitute!", + "thatsCrazy": "That\'s Crazy!", + "oranceJuice": "Orance Juice!", + "questionableBalancing": "Questionable Balancing!", + "coolShaders": "Cool Shaders!", + "aiFree": "AI-Free!", + "suddenDifficultySpikes": "Sudden Difficulty Spikes!", + "basedOnAnUnfinishedFlashGame": "Based on an Unfinished Flash Game!", + "moreAddictiveThanIntended": "More Addictive than Intended!", + "mostlyConsistentSeeds": "Mostly Consistent Seeds!", + "achievementPointsDontDoAnything": "Achievement Points Don\'t Do Anything!", + "youDoNotStartAtLevel": "You Do Not Start at Level 2000!", + "dontTalkAboutTheManaphyEggIncident": "Don\'t Talk About the Manaphy Egg Incident!", + "alsoTryPokengine": "Also Try Pokéngine!", + "alsoTryEmeraldRogue": "Also Try Emerald Rogue!", + "alsoTryRadicalRed": "Also Try Radical Red!", + "eeveeExpo": "Eevee Expo!", + "ynoproject": "YNOproject!", +} as const; \ No newline at end of file diff --git a/src/locales/en/config.ts b/src/locales/en/config.ts index f6b385fe433..295c3ff5c33 100644 --- a/src/locales/en/config.ts +++ b/src/locales/en/config.ts @@ -15,6 +15,7 @@ import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { tutorial } from "./tutorial"; +import { splashMessages } from "./splash-messages" import { weather } from "./weather"; @@ -33,6 +34,7 @@ export const enConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + splashMessages: splashMessages, nature: nature, growth: growth, weather: weather, diff --git a/src/locales/en/splash-messages.ts b/src/locales/en/splash-messages.ts new file mode 100644 index 00000000000..6815d7f1824 --- /dev/null +++ b/src/locales/en/splash-messages.ts @@ -0,0 +1,37 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const splashMessages: SimpleTranslationEntries = { + "battlesWon": "Battles Won!", + "joinTheDiscord": "Join the Discord!", + "infiniteLevels": "Infinite Levels!", + "everythingStacks": "Everything Stacks!", + "optionalSaveScumming": "Optional Save Scumming!", + "biomes": "35 Biomes!", + "openSource": "Open Source!", + "playWithSpeed": "Play with 5x Speed!", + "liveBugTesting": "Live Bug Testing!", + "heavyInfluence": "Heavy RoR2 Influence!", + "pokemonRiskAndPokemonRain": "Pokémon Risk and Pokémon Rain!", + "nowWithMoreSalt": "Now with 33% More Salt!", + "infiniteFusionAtHome": "Infinite Fusion at Home!", + "brokenEggMoves": "Broken Egg Moves!", + "magnificent": "Magnificent!", + "mubstitute": "Mubstitute!", + "thatsCrazy": "That\'s Crazy!", + "oranceJuice": "Orance Juice!", + "questionableBalancing": "Questionable Balancing!", + "coolShaders": "Cool Shaders!", + "aiFree": "AI-Free!", + "suddenDifficultySpikes": "Sudden Difficulty Spikes!", + "basedOnAnUnfinishedFlashGame": "Based on an Unfinished Flash Game!", + "moreAddictiveThanIntended": "More Addictive than Intended!", + "mostlyConsistentSeeds": "Mostly Consistent Seeds!", + "achievementPointsDontDoAnything": "Achievement Points Don\'t Do Anything!", + "youDoNotStartAtLevel": "You Do Not Start at Level 2000!", + "dontTalkAboutTheManaphyEggIncident": "Don\'t Talk About the Manaphy Egg Incident!", + "alsoTryPokengine": "Also Try Pokéngine!", + "alsoTryEmeraldRogue": "Also Try Emerald Rogue!", + "alsoTryRadicalRed": "Also Try Radical Red!", + "eeveeExpo": "Eevee Expo!", + "ynoproject": "YNOproject!", +} as const; \ No newline at end of file diff --git a/src/locales/es/config.ts b/src/locales/es/config.ts index 84a05233616..6c36db3ed45 100644 --- a/src/locales/es/config.ts +++ b/src/locales/es/config.ts @@ -15,6 +15,7 @@ import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { tutorial } from "./tutorial"; +import { splashMessages } from "./splash-messages" import { weather } from "./weather"; @@ -33,6 +34,7 @@ export const esConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + splashMessages: splashMessages, nature: nature, growth: growth, weather: weather, diff --git a/src/locales/es/splash-messages.ts b/src/locales/es/splash-messages.ts new file mode 100644 index 00000000000..6815d7f1824 --- /dev/null +++ b/src/locales/es/splash-messages.ts @@ -0,0 +1,37 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const splashMessages: SimpleTranslationEntries = { + "battlesWon": "Battles Won!", + "joinTheDiscord": "Join the Discord!", + "infiniteLevels": "Infinite Levels!", + "everythingStacks": "Everything Stacks!", + "optionalSaveScumming": "Optional Save Scumming!", + "biomes": "35 Biomes!", + "openSource": "Open Source!", + "playWithSpeed": "Play with 5x Speed!", + "liveBugTesting": "Live Bug Testing!", + "heavyInfluence": "Heavy RoR2 Influence!", + "pokemonRiskAndPokemonRain": "Pokémon Risk and Pokémon Rain!", + "nowWithMoreSalt": "Now with 33% More Salt!", + "infiniteFusionAtHome": "Infinite Fusion at Home!", + "brokenEggMoves": "Broken Egg Moves!", + "magnificent": "Magnificent!", + "mubstitute": "Mubstitute!", + "thatsCrazy": "That\'s Crazy!", + "oranceJuice": "Orance Juice!", + "questionableBalancing": "Questionable Balancing!", + "coolShaders": "Cool Shaders!", + "aiFree": "AI-Free!", + "suddenDifficultySpikes": "Sudden Difficulty Spikes!", + "basedOnAnUnfinishedFlashGame": "Based on an Unfinished Flash Game!", + "moreAddictiveThanIntended": "More Addictive than Intended!", + "mostlyConsistentSeeds": "Mostly Consistent Seeds!", + "achievementPointsDontDoAnything": "Achievement Points Don\'t Do Anything!", + "youDoNotStartAtLevel": "You Do Not Start at Level 2000!", + "dontTalkAboutTheManaphyEggIncident": "Don\'t Talk About the Manaphy Egg Incident!", + "alsoTryPokengine": "Also Try Pokéngine!", + "alsoTryEmeraldRogue": "Also Try Emerald Rogue!", + "alsoTryRadicalRed": "Also Try Radical Red!", + "eeveeExpo": "Eevee Expo!", + "ynoproject": "YNOproject!", +} as const; \ No newline at end of file diff --git a/src/locales/fr/config.ts b/src/locales/fr/config.ts index 84c20a957ed..f6245f4eeaa 100644 --- a/src/locales/fr/config.ts +++ b/src/locales/fr/config.ts @@ -15,6 +15,7 @@ import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { tutorial } from "./tutorial"; +import { splashMessages } from "./splash-messages" import { weather } from "./weather"; @@ -33,6 +34,7 @@ export const frConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + splashMessages: splashMessages, nature: nature, growth: growth, weather: weather, diff --git a/src/locales/fr/splash-messages.ts b/src/locales/fr/splash-messages.ts new file mode 100644 index 00000000000..6815d7f1824 --- /dev/null +++ b/src/locales/fr/splash-messages.ts @@ -0,0 +1,37 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const splashMessages: SimpleTranslationEntries = { + "battlesWon": "Battles Won!", + "joinTheDiscord": "Join the Discord!", + "infiniteLevels": "Infinite Levels!", + "everythingStacks": "Everything Stacks!", + "optionalSaveScumming": "Optional Save Scumming!", + "biomes": "35 Biomes!", + "openSource": "Open Source!", + "playWithSpeed": "Play with 5x Speed!", + "liveBugTesting": "Live Bug Testing!", + "heavyInfluence": "Heavy RoR2 Influence!", + "pokemonRiskAndPokemonRain": "Pokémon Risk and Pokémon Rain!", + "nowWithMoreSalt": "Now with 33% More Salt!", + "infiniteFusionAtHome": "Infinite Fusion at Home!", + "brokenEggMoves": "Broken Egg Moves!", + "magnificent": "Magnificent!", + "mubstitute": "Mubstitute!", + "thatsCrazy": "That\'s Crazy!", + "oranceJuice": "Orance Juice!", + "questionableBalancing": "Questionable Balancing!", + "coolShaders": "Cool Shaders!", + "aiFree": "AI-Free!", + "suddenDifficultySpikes": "Sudden Difficulty Spikes!", + "basedOnAnUnfinishedFlashGame": "Based on an Unfinished Flash Game!", + "moreAddictiveThanIntended": "More Addictive than Intended!", + "mostlyConsistentSeeds": "Mostly Consistent Seeds!", + "achievementPointsDontDoAnything": "Achievement Points Don\'t Do Anything!", + "youDoNotStartAtLevel": "You Do Not Start at Level 2000!", + "dontTalkAboutTheManaphyEggIncident": "Don\'t Talk About the Manaphy Egg Incident!", + "alsoTryPokengine": "Also Try Pokéngine!", + "alsoTryEmeraldRogue": "Also Try Emerald Rogue!", + "alsoTryRadicalRed": "Also Try Radical Red!", + "eeveeExpo": "Eevee Expo!", + "ynoproject": "YNOproject!", +} as const; \ No newline at end of file diff --git a/src/locales/it/config.ts b/src/locales/it/config.ts index 0247a7e0f80..11b1b9e5628 100644 --- a/src/locales/it/config.ts +++ b/src/locales/it/config.ts @@ -15,6 +15,7 @@ import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { tutorial } from "./tutorial"; +import { splashMessages } from "./splash-messages" import { weather } from "./weather"; @@ -33,6 +34,7 @@ export const itConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + splashMessages: splashMessages, nature: nature, growth: growth, weather: weather, diff --git a/src/locales/it/splash-messages.ts b/src/locales/it/splash-messages.ts new file mode 100644 index 00000000000..3bddc68f0b5 --- /dev/null +++ b/src/locales/it/splash-messages.ts @@ -0,0 +1,37 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const splashMessages: SimpleTranslationEntries = { + "battlesWon": "Battaglie Vinte!", + "joinTheDiscord": "Entra nel Discord!", + "infiniteLevels": "Livelli Infiniti!", + "everythingStacks": "Tutto si impila!", + "optionalSaveScumming": "Salvataggio Facoltativo!", + "biomes": "35 Biomi!", + "openSource": "Open Source!", + "playWithSpeed": "Gioca con il 5x di Velocità!", + "liveBugTesting": "Test dei Bug in Tempo Reale!", + "heavyInfluence": "Influenzato da RoR2!", + "pokemonRiskAndPokemonRain": "Pokémon Risk e Pokémon Rain!", + "nowWithMoreSalt": "Adesso con il 33% di sale in più!", + "infiniteFusionAtHome": "Fusioni Infinite a Casa!", + "brokenEggMoves": "Mosse delle Uova Rotte!", + "magnificent": "Magnifico!", + "mubstitute": "Mubstitute!", + "thatsCrazy": "È Pazzesco!", + "oranceJuice": "Succo d\'Arancia!", + "questionableBalancing": "Bilanciamento Discutibile!", + "coolShaders": "Shader fantastici!", + "aiFree": "Senza Intelligenza Artificiale!", + "suddenDifficultySpikes": "Picchi di Difficoltà Improvvisi!", + "basedOnAnUnfinishedFlashGame": "Basato su un Gioco Flash Incompiuto!", + "moreAddictiveThanIntended": "Crea Dipendeza più del Dovuto!", + "mostlyConsistentSeeds": "Seeds Consistenti!", + "achievementPointsDontDoAnything": "I Punti Obiettivo non Fanno Nulla!", + "youDoNotStartAtLevel": "Non Cominci dal Livello 2000!", + "dontTalkAboutTheManaphyEggIncident": "Non Parlare dell'Incidente dell'Uovo di Manaphy!", + "alsoTryPokengine": "Prova anche Pokéngine!", + "alsoTryEmeraldRogue": "Prova anche Emerald Rogue!", + "alsoTryRadicalRed": "Prova anche Radical Red!", + "eeveeExpo": "Eevee Expo!", + "ynoproject": "YNOproject!", +} as const; \ No newline at end of file diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index ffd45317121..1e0363f1688 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -124,6 +124,7 @@ declare module 'i18next' { fightUiHandler: SimpleTranslationEntries; tutorial: SimpleTranslationEntries; starterSelectUiHandler: SimpleTranslationEntries; + splashMessages: SimpleTranslationEntries; nature: SimpleTranslationEntries; growth: SimpleTranslationEntries; egg: SimpleTranslationEntries; diff --git a/src/ui/title-ui-handler.ts b/src/ui/title-ui-handler.ts index c808611b093..4da4f189f6b 100644 --- a/src/ui/title-ui-handler.ts +++ b/src/ui/title-ui-handler.ts @@ -4,7 +4,7 @@ import OptionSelectUiHandler from "./option-select-ui-handler"; import { Mode } from "./ui"; import * as Utils from "../utils"; import { TextStyle, addTextObject } from "./text"; -import { battleCountSplashMessage, splashMessages } from "../data/splash-messages"; +import { getBattleCountSplashMessage, getSplashMessages } from "../data/splash-messages"; import i18next from "i18next"; export default class TitleUiHandler extends OptionSelectUiHandler { @@ -63,8 +63,8 @@ export default class TitleUiHandler extends OptionSelectUiHandler { .then(request => request.json()) .then(stats => { this.playerCountLabel.setText(`${stats.playerCount} ${i18next.t("menu:playersOnline")}`); - if (this.splashMessage === battleCountSplashMessage) - this.splashMessageText.setText(battleCountSplashMessage.replace('{COUNT}', stats.battleCount.toLocaleString('en-US'))); + if (this.splashMessage === getBattleCountSplashMessage()) + this.splashMessageText.setText(getBattleCountSplashMessage().replace('{COUNT}', stats.battleCount.toLocaleString('en-US'))); }) .catch(err => { console.error("Failed to fetch title stats:\n", err); @@ -75,7 +75,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler { const ret = super.show(args); if (ret) { - this.splashMessage = Utils.randItem(splashMessages); + this.splashMessage = Utils.randItem(getSplashMessages()); this.splashMessageText.setText(this.splashMessage.replace('{COUNT}', '?')); const ui = this.getUi();