From 67cdbe949403403d9f82f01fe0ebc2d819e2d6c3 Mon Sep 17 00:00:00 2001 From: Awesomeangotti Date: Mon, 27 Apr 2026 17:14:22 -0400 Subject: [PATCH] Complete language selection for splash and reformat the splashes json file for easier splash management --- assets/Splashes/Splashes.json | 115 +++++++++++++++++++------ src/Ryujinx/Common/SplashTextHelper.cs | 106 ++++------------------- 2 files changed, 106 insertions(+), 115 deletions(-) diff --git a/assets/Splashes/Splashes.json b/assets/Splashes/Splashes.json index 07958cce1..210f27316 100644 --- a/assets/Splashes/Splashes.json +++ b/assets/Splashes/Splashes.json @@ -1,29 +1,88 @@ { - "Locales": [ - { - "Translations": { - "ar_SA": "", - "de_DE": "", - "el_GR": "", - "en_US": "JOKE!", - "es_ES": "", - "fr_FR": "", - "he_IL": "", - "it_IT": "", - "ja_JP": "", - "ko_KR": "", - "no_NO": "", - "pl_PL": "", - "pt_BR": "", - "ru_RU": "", - "sv_SE": "", - "th_TH": "", - "tr_TR": "", - "uk_UA": "", - "zh_CN": "", - "zh_TW": "" - } - - } - ] -} \ No newline at end of file + "Locales": { + "ar_SA": [], + "de_DE": [], + "el_GR": [], + "en_US": [ + "Ryubing is my middle name", + "Giving it 110 percent!", + "I don't think therefore I don't am!", + "All hail egg", + "Insert cringy joke here", + "ITS RYUBINGING TIME", + "I hate mondays...", + "Fantastical!", + "Now with 100% more humor!", + "'Not S&P approved' has been approved by S&P", + "ARE YOU NOT ENTERTAINED?", + "It's an emulator!", + "Now the real game begins", + "Cooked fresh since 2018!", + "Must've been the wind...", + "I used to be an adventurer like you before I took an arrow to the knee", + "Ryubing!", + "May contain nuts!", + "May include occasional pop culture references!", + "100% organically grown!", + "Have a nice day : )", + "Spoats car!", + "Bottom text", + "Im sorry dave. I'm afraid I can't do that.", + "That's no moon", + "Sir, finishing this fight.", + "I see how it is...", + "Space! The final frontier!", + "If you could not tell already, I love making bad jokes : )", + "this.", + "Probably contains no baked beans", + "Y'all ready for this?", + "Removed herobrine", + "Right to repair!", + "Programmed in C#!", + "Forgejo has dethroned Gitlab!", + "Any ideas what to put here?", + "Good morning!", + "Good afternoon!", + "Good evening!", + "I hope you are having a great day!", + "Please insert disc two!", + "I... AM RYUBING!", + "Ryubingin' it up", + "bing bing wahoo", + "egg", + "No, lossless scaling is NOT supported", + "How do you people do anything?", + "One dollar.", + "Somebody once told me!", + "Its that time of the month again!", + "Brewed from only the finest memes", + "Async shader compilation would destroy my soul", + "Trans rights are human rights!", + ":3", + ":3", + ":3", + "Please connect a controller!", + "Never gonna give you up!", + "The game was rigged from the start", + "Ganon is watching you!", + "Now with 100% more JSON in the splash code!", + "Countless hours of fun!" + ], + "es_ES": [], + "fr_FR": [], + "he_IL": [], + "it_IT": [], + "ja_JP": [], + "ko_KR": [], + "no_NO": [], + "pl_PL": [], + "pt_BR": [], + "ru_RU": [], + "sv_SE": [], + "th_TH": [], + "tr_TR": [], + "uk_UA": [], + "zh_CN": [], + "zh_TW": [] + } +} diff --git a/src/Ryujinx/Common/SplashTextHelper.cs b/src/Ryujinx/Common/SplashTextHelper.cs index e3eeaf32e..5028b25b7 100644 --- a/src/Ryujinx/Common/SplashTextHelper.cs +++ b/src/Ryujinx/Common/SplashTextHelper.cs @@ -1,8 +1,7 @@ using System.Collections.Generic; using Ryujinx.Common.Logging; using Gommon; -using Ryujinx.Ava.Common.Locale; -using System; +using Ryujinx.Ava.Systems.Configuration; using System.Text.Json; namespace Ryujinx.Common @@ -35,100 +34,33 @@ namespace Ryujinx.Common return $"{_Final_Splash}"; } - private static SplashLocalesJson _Splash_Json; + private static _Splash_Locales _Splash_Json; private static string _Get_Lang_Json() { - foreach (string uri in EmbeddedResources.GetAllAvailableResources("Ryujinx/Assets/Splashes", ".json")) + try { - string data; - string path = uri[..^".json".Length]; - path = path.Replace('.', '/'); - path = path.Append(".json"); - data = EmbeddedResources.ReadAllText(path); - _Splash_Json = JsonSerializer.Deserialize(data); // There will theoretically only ever be one splashes.json + foreach (string uri in EmbeddedResources.GetAllAvailableResources("Ryujinx/Assets/Splashes", ".json")) + { + string data; + string path = uri[..^".json".Length]; + path = path.Replace('.', '/'); + path = path.Append(".json"); + data = EmbeddedResources.ReadAllText(path); + _Splash_Json = JsonSerializer.Deserialize<_Splash_Locales>(data); + } + return _Splash_Json.Locales[ConfigurationState.Instance.UI.LanguageCode.Value].GetRandomElement(); + } + catch + { + return ""; } - return _Splash_Json.Locales.GetRandomElement().Translations["en_US"]; // Just need to get locale selection now - } - - public struct SplashLocalesJson - { - public List Locales { get; set; } } - public struct SplashLocalesEntry + public struct _Splash_Locales { - public Dictionary Translations { get; set; } + public Dictionary> Locales { get; set; } } - - // Original splash list. Held here for temporary reasons - private static List _Main_Splashes = new() - { - "Ryubing is my middle name", - "Giving it 110 percent!", - "I don't think therefore I don't am!", - "All hail egg", - "Insert cringy joke here", - "ITS RYUBINGING TIME", - "I hate mondays...", - "Fantastical!", - "Now with 100% more humor!", - //"Wishlist party cosmos!", - "\"Not S&P approved\" has been approved by S&P", - "ARE YOU NOT ENTERTAINED?", - "It's an emulator!", - "Now the real game begins", - "Cooked fresh since 2018!", - "Must've been the wind...", - "I used to be an adventurer like you before I took an arrow to the knee", - "Ryubing!", - "May contain nuts!", - "May include occasional pop culture references!", - "100% organically grown!", - "Have a nice day : )", - "Spoats car!", // I love my inside jokes. - "Bottom text", - "Im sorry dave. I'm afraid I can't do that.", - "That's no moon", - "Sir, finishing this fight.", - "I see how it is...", - "Space! The final frontier!", - "If you could not tell already, I love making bad jokes : )", - "this.", - "Probably contains no baked beans", - "Y'all ready for this?", - "Removed herobrine", - "Right to repair!", - "Programmed in C#!", - "Forgejo has dethroned Gitlab!", - "Any ideas what to put here?", - "Good morning!", - "Good afternoon!", - "Good evening!", - "I hope you are having a great day!", - "Please insert disc two!", - "I... AM RYUBING!", - "Ryubingin' it up", - "bing bing wahoo", - "egg", - "No, lossless scaling is NOT supported", - "How do you people do anything?", - "One dollar.", - "Somebody once told me!", - "Its that time of the month again!", - "Brewed from only the finest memes", - "Async shader compilation would destroy my soul", - "Trans rights are human rights!", - ":3", - ":3", - "Please connect a controller!", - "Never gonna give you up!", - "The game was rigged from the start", - "Ganon is watching you!", - "Now with 100% less JSON in the splash code!", - "With every splash I get closer to insanity!", - - }; }