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

Remove simple localisable .ToString() calls

This commit is contained in:
Bartłomiej Dach 2021-10-30 18:50:34 +02:00
parent 11de924704
commit ed00cd9fc5
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
5 changed files with 7 additions and 7 deletions

View File

@ -101,7 +101,7 @@ namespace osu.Game.Overlays.Changelog
t.Colour = colour.PinkLighter;
})
{
Text = ChangelogStrings.SupportText2.ToString(),
Text = ChangelogStrings.SupportText2,
Margin = new MarginPadding { Top = 10 },
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,

View File

@ -83,7 +83,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
cp.Font = OsuFont.Default.With(size: 24);
})
{
Text = HeaderText.ToString(),
Text = HeaderText,
TextAnchor = Anchor.TopCentre,
Margin = new MarginPadding(10),
RelativeSizeAxes = Axes.X,

View File

@ -16,8 +16,7 @@ namespace osu.Game.Overlays.Settings
public override LocalisableString LabelText
{
get => labelText;
// checkbox doesn't properly support localisation yet.
set => ((OsuCheckbox)Control).LabelText = (labelText = value).ToString();
set => ((OsuCheckbox)Control).LabelText = labelText = value;
}
}
}

View File

@ -68,7 +68,7 @@ namespace osu.Game.Overlays.Settings
{
set
{
bool hasValue = !string.IsNullOrWhiteSpace(value.ToString());
bool hasValue = value != default;
if (warningText == null)
{
@ -80,7 +80,7 @@ namespace osu.Game.Overlays.Settings
}
warningText.Alpha = hasValue ? 1 : 0;
warningText.Text = value.ToString(); // TODO: Remove ToString() call after TextFlowContainer supports localisation (see https://github.com/ppy/osu-framework/issues/4636).
warningText.Text = value ?? default;
}
}

View File

@ -4,6 +4,7 @@
using System.Collections.Specialized;
using Humanizer;
using osu.Framework.Allocation;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
@ -46,7 +47,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
private void updateCount(object sender, NotifyCollectionChangedEventArgs e)
{
count.Clear();
count.AddText(Playlist.Count.ToString(), s => s.Font = s.Font.With(weight: FontWeight.Bold));
count.AddText(Playlist.Count.ToLocalisableString(), s => s.Font = s.Font.With(weight: FontWeight.Bold));
count.AddText(" ");
count.AddText("Beatmap".ToQuantity(Playlist.Count, ShowQuantityAs.None));
}