mirror of
https://github.com/ppy/osu.git
synced 2025-01-31 23:02:54 +08:00
Remove simple localisable .ToString()
calls
This commit is contained in:
parent
11de924704
commit
ed00cd9fc5
@ -101,7 +101,7 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
t.Colour = colour.PinkLighter;
|
t.Colour = colour.PinkLighter;
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
Text = ChangelogStrings.SupportText2.ToString(),
|
Text = ChangelogStrings.SupportText2,
|
||||||
Margin = new MarginPadding { Top = 10 },
|
Margin = new MarginPadding { Top = 10 },
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
|
@ -83,7 +83,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
cp.Font = OsuFont.Default.With(size: 24);
|
cp.Font = OsuFont.Default.With(size: 24);
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
Text = HeaderText.ToString(),
|
Text = HeaderText,
|
||||||
TextAnchor = Anchor.TopCentre,
|
TextAnchor = Anchor.TopCentre,
|
||||||
Margin = new MarginPadding(10),
|
Margin = new MarginPadding(10),
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
|
@ -16,8 +16,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
public override LocalisableString LabelText
|
public override LocalisableString LabelText
|
||||||
{
|
{
|
||||||
get => labelText;
|
get => labelText;
|
||||||
// checkbox doesn't properly support localisation yet.
|
set => ((OsuCheckbox)Control).LabelText = labelText = value;
|
||||||
set => ((OsuCheckbox)Control).LabelText = (labelText = value).ToString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
bool hasValue = !string.IsNullOrWhiteSpace(value.ToString());
|
bool hasValue = value != default;
|
||||||
|
|
||||||
if (warningText == null)
|
if (warningText == null)
|
||||||
{
|
{
|
||||||
@ -80,7 +80,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
}
|
}
|
||||||
|
|
||||||
warningText.Alpha = hasValue ? 1 : 0;
|
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 System.Collections.Specialized;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Extensions.LocalisationExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -46,7 +47,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
|||||||
private void updateCount(object sender, NotifyCollectionChangedEventArgs e)
|
private void updateCount(object sender, NotifyCollectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
count.Clear();
|
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(" ");
|
||||||
count.AddText("Beatmap".ToQuantity(Playlist.Count, ShowQuantityAs.None));
|
count.AddText("Beatmap".ToQuantity(Playlist.Count, ShowQuantityAs.None));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user