Update `TimeSpan` localisation to use `ToLocalisableString`

This commit is contained in:
Salman Ahmed 2022-04-28 11:12:50 +03:00
parent edeefc2850
commit c8665dc93b
1 changed files with 4 additions and 3 deletions

View File

@ -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>