Merge pull request #14003 from Game4all/localise-profile-overlay-header-stats

Localise profile overlay numeric statistics
This commit is contained in:
Dan Balasescu
2021-07-25 12:20:38 +09:00
committed by GitHub
24 changed files with 59 additions and 46 deletions

View File

@ -7,6 +7,7 @@ using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Utils;
@ -63,7 +64,7 @@ namespace osu.Game.Screens.Play.Break
valueText.Text = newText;
}
protected virtual string Format(T count)
protected virtual LocalisableString Format(T count)
{
if (count is Enum countEnum)
return countEnum.GetDescription();
@ -86,6 +87,6 @@ namespace osu.Game.Screens.Play.Break
{
}
protected override string Format(double count) => count.FormatAccuracy();
protected override LocalisableString Format(double count) => count.FormatAccuracy();
}
}

View File

@ -4,6 +4,7 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
@ -31,7 +32,7 @@ namespace osu.Game.Screens.Play.HUD
Current.BindTo(scoreProcessor.Combo);
}
protected override string FormatCount(int count)
protected override LocalisableString FormatCount(int count)
{
return $@"{count}x";
}

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
@ -44,7 +45,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
protected override Easing RollingEasing => AccuracyCircle.ACCURACY_TRANSFORM_EASING;
protected override string FormatCount(double count) => count.FormatAccuracy();
protected override LocalisableString FormatCount(double count) => count.FormatAccuracy();
protected override OsuSpriteText CreateSpriteText() => base.CreateSpriteText().With(s =>
{

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
@ -26,7 +27,7 @@ namespace osu.Game.Screens.Ranking.Expanded
RelativeSizeAxes = Axes.X;
}
protected override string FormatCount(long count) => count.ToString("N0");
protected override LocalisableString FormatCount(long count) => count.ToString("N0");
protected override OsuSpriteText CreateSpriteText() => base.CreateSpriteText().With(s =>
{