From 5b029ae7a2baea780b3dec01b7c96ef060534271 Mon Sep 17 00:00:00 2001 From: WilliamWsyHK Date: Thu, 27 Dec 2018 23:08:34 +0800 Subject: [PATCH] System Language can be configurable. (#535) --- Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs | 17 ++++++++++++++--- Ryujinx/Config.cs | 5 +++++ Ryujinx/Ryujinx.conf | 4 ++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs b/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs index 74513795e5..d1d54d0eaf 100644 --- a/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs +++ b/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs @@ -54,8 +54,6 @@ namespace Ryujinx.HLE.HOS.SystemState public SystemStateMgr() { - SetLanguage(SystemLanguage.AmericanEnglish); - SetAudioOutputAsBuiltInSpeaker(); _profiles = new ConcurrentDictionary(); @@ -71,7 +69,20 @@ namespace Ryujinx.HLE.HOS.SystemState { DesiredLanguageCode = GetLanguageCode((int)language); - DesiredTitleLanguage = Enum.Parse(Enum.GetName(typeof(SystemLanguage), language)); + switch (language) + { + case SystemLanguage.Taiwanese: + case SystemLanguage.TraditionalChinese: + DesiredTitleLanguage = TitleLanguage.Taiwanese; + break; + case SystemLanguage.Chinese: + case SystemLanguage.SimplifiedChinese: + DesiredTitleLanguage = TitleLanguage.Chinese; + break; + default: + DesiredTitleLanguage = Enum.Parse(Enum.GetName(typeof(SystemLanguage), language)); + break; + } } public void SetAudioOutputAsTv() diff --git a/Ryujinx/Config.cs b/Ryujinx/Config.cs index 216ed0a579..e7b346eaf6 100644 --- a/Ryujinx/Config.cs +++ b/Ryujinx/Config.cs @@ -1,6 +1,7 @@ using LibHac; using Ryujinx.Common.Logging; using Ryujinx.HLE; +using Ryujinx.HLE.HOS.SystemState; using Ryujinx.HLE.Input; using Ryujinx.UI.Input; using System; @@ -61,6 +62,10 @@ namespace Ryujinx } } + SystemLanguage SetLanguage = Enum.Parse(parser.Value("System_Language")); + + device.System.State.SetLanguage(SetLanguage); + device.System.State.DockedMode = Convert.ToBoolean(parser.Value("Docked_Mode")); device.EnableDeviceVsync = Convert.ToBoolean(parser.Value("Enable_Vsync")); diff --git a/Ryujinx/Ryujinx.conf b/Ryujinx/Ryujinx.conf index 5b646a2ada..c04d7b5ac9 100644 --- a/Ryujinx/Ryujinx.conf +++ b/Ryujinx/Ryujinx.conf @@ -22,6 +22,10 @@ Logging_Enable_Error = true #Filtered log classes, seperated by ", ", eg. `Logging_Filtered_Classes = Loader, ServiceFS` Logging_Filtered_Classes = +#System Language list: https://gist.github.com/HorrorTroll/b6e4a88d774c3c9b3bdf54d79a7ca43b +#Change System Language +System_Language = AmericanEnglish + #Enable or Disable Docked Mode Docked_Mode = false