From 48be6646a6f304f54834a3454a8a509f4e35e35b Mon Sep 17 00:00:00 2001 From: andy840119 Date: Tue, 27 Dec 2022 21:38:07 +0800 Subject: [PATCH] Fix the test case broken. It's caused due to `RulesetConfigManager` get the data by .ToString(CultureInfo.InvariantCulture) in the bindbable, not by ToString(). See: https://github.com/ppy/osu/issues/21611 --- osu.Game.Rulesets.Karaoke/Bindables/BindableCultureInfo.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Bindables/BindableCultureInfo.cs b/osu.Game.Rulesets.Karaoke/Bindables/BindableCultureInfo.cs index da9a1a5a5..4be103e91 100644 --- a/osu.Game.Rulesets.Karaoke/Bindables/BindableCultureInfo.cs +++ b/osu.Game.Rulesets.Karaoke/Bindables/BindableCultureInfo.cs @@ -26,11 +26,11 @@ public override void Parse(object? input) switch (input) { case string str: - Value = new CultureInfo(str); + Value = CultureInfoUtils.CreateLoadCultureInfoByCode(str); break; case int lcid: - Value = new CultureInfo(lcid); + Value = CultureInfoUtils.CreateLoadCultureInfoById(lcid); break; case CultureInfo cultureInfo: @@ -46,6 +46,6 @@ public override void Parse(object? input) protected override Bindable CreateInstance() => new BindableCultureInfo(); public override string ToString(string format, IFormatProvider formatProvider) - => CultureInfoUtils.GetLanguageDisplayText(Value); + => Value != null ? CultureInfoUtils.GetSaveCultureInfoCode(Value) : string.Empty; } }