Skip to content

Commit

Permalink
Fix the test case broken.
Browse files Browse the repository at this point in the history
It's caused due to `RulesetConfigManager` get the data by .ToString(CultureInfo.InvariantCulture) in the bindbable, not by ToString().

See:
ppy/osu#21611
  • Loading branch information
andy840119 committed Dec 27, 2022
1 parent 76d9193 commit 48be664
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions osu.Game.Rulesets.Karaoke/Bindables/BindableCultureInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -46,6 +46,6 @@ public override void Parse(object? input)
protected override Bindable<CultureInfo?> CreateInstance() => new BindableCultureInfo();

public override string ToString(string format, IFormatProvider formatProvider)
=> CultureInfoUtils.GetLanguageDisplayText(Value);
=> Value != null ? CultureInfoUtils.GetSaveCultureInfoCode(Value) : string.Empty;
}
}

0 comments on commit 48be664

Please sign in to comment.