Use LocalisableStrings for date and time formats

This commit is contained in:
Susko3
2022-12-16 00:05:47 +01:00
parent 60c8ef3fe5
commit 0f34d908c7
10 changed files with 24 additions and 17 deletions

View File

@ -9,6 +9,7 @@ using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Localisation;
@ -309,7 +310,8 @@ namespace osu.Game.Screens.Ranking.Expanded
private void updateDisplay()
{
Text = prefer24HourTime.Value ? $"Played on {time.ToLocalTime():d MMMM yyyy HH:mm}" : $"Played on {time.ToLocalTime():d MMMM yyyy h:mm tt}";
Text = LocalisableString.Format("Played on {0}",
time.ToLocalTime().ToLocalisableString(prefer24HourTime.Value ? @"d MMMM yyyy HH:mm" : @"d MMMM yyyy h:mm tt"));
}
}
}