mirror of https://github.com/ppy/osu
Update `TimeSpan` localisation to use `ToLocalisableString`
This commit is contained in:
parent
edeefc2850
commit
c8665dc93b
|
@ -3,6 +3,7 @@
|
|||
|
||||
using System;
|
||||
using Humanizer;
|
||||
using osu.Framework.Extensions.LocalisationExtensions;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Resources.Localisation.Web;
|
||||
|
||||
|
@ -42,12 +43,12 @@ public static LocalisableString ToFormattedDuration(this double milliseconds) =>
|
|||
public static LocalisableString ToFormattedDuration(this TimeSpan timeSpan)
|
||||
{
|
||||
if (timeSpan.TotalDays >= 1)
|
||||
return new LocalisableFormattableString(timeSpan, @"dd\:hh\:mm\:ss");
|
||||
return timeSpan.ToLocalisableString(@"dd\:hh\:mm\:ss");
|
||||
|
||||
if (timeSpan.TotalHours >= 1)
|
||||
return new LocalisableFormattableString(timeSpan, @"hh\:mm\:ss");
|
||||
return timeSpan.ToLocalisableString(@"hh\:mm\:ss");
|
||||
|
||||
return new LocalisableFormattableString(timeSpan, @"mm\:ss");
|
||||
return timeSpan.ToLocalisableString(@"mm\:ss");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue