1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

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

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 @@ namespace osu.Game.Extensions
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>