mirror of https://github.com/ppy/osu
Remove simple localisable `.ToString()` calls
This commit is contained in:
parent
11de924704
commit
ed00cd9fc5
|
@ -101,7 +101,7 @@ private void load(OsuColour colour, TextureStore textures, OverlayColourProvider
|
|||
t.Colour = colour.PinkLighter;
|
||||
})
|
||||
{
|
||||
Text = ChangelogStrings.SupportText2.ToString(),
|
||||
Text = ChangelogStrings.SupportText2,
|
||||
Margin = new MarginPadding { Top = 10 },
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
|
|
|
@ -83,7 +83,7 @@ private void load(OsuColour colours)
|
|||
cp.Font = OsuFont.Default.With(size: 24);
|
||||
})
|
||||
{
|
||||
Text = HeaderText.ToString(),
|
||||
Text = HeaderText,
|
||||
TextAnchor = Anchor.TopCentre,
|
||||
Margin = new MarginPadding(10),
|
||||
RelativeSizeAxes = Axes.X,
|
||||
|
|
|
@ -16,8 +16,7 @@ public class SettingsCheckbox : SettingsItem<bool>
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public LocalisableString? WarningText
|
|||
{
|
||||
set
|
||||
{
|
||||
bool hasValue = !string.IsNullOrWhiteSpace(value.ToString());
|
||||
bool hasValue = value != default;
|
||||
|
||||
if (warningText == null)
|
||||
{
|
||||
|
@ -80,7 +80,7 @@ public LocalisableString? WarningText
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 @@ protected override void LoadComplete()
|
|||
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));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue