diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index e8f80dec57..da511d8212 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input.Events; +using osu.Framework.Localisation; using osu.Game.Graphics.Containers; namespace osu.Game.Graphics.UserInterface @@ -19,7 +20,7 @@ namespace osu.Game.Graphics.UserInterface /// protected virtual bool PlaySoundsOnUserChange => true; - public string LabelText + public LocalisableString LabelText { set { diff --git a/osu.Game/Graphics/UserInterfaceV2/LabelledDrawable.cs b/osu.Game/Graphics/UserInterfaceV2/LabelledDrawable.cs index d5f76733cf..95884f1515 100644 --- a/osu.Game/Graphics/UserInterfaceV2/LabelledDrawable.cs +++ b/osu.Game/Graphics/UserInterfaceV2/LabelledDrawable.cs @@ -8,6 +8,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.Localisation; using osu.Game.Graphics.Containers; using osu.Game.Overlays; using osuTK; @@ -156,18 +157,18 @@ namespace osu.Game.Graphics.UserInterfaceV2 descriptionText.Colour = osuColour.Yellow; } - public string Label + public LocalisableString Label { set => labelText.Text = value; } - public string Description + public LocalisableString Description { set { descriptionText.Text = value; - if (!string.IsNullOrEmpty(value)) + if (value == default) descriptionText.Show(); else descriptionText.Hide(); diff --git a/osu.Game/Online/Placeholders/ClickablePlaceholder.cs b/osu.Game/Online/Placeholders/ClickablePlaceholder.cs index 936ad79c64..054a4a3c39 100644 --- a/osu.Game/Online/Placeholders/ClickablePlaceholder.cs +++ b/osu.Game/Online/Placeholders/ClickablePlaceholder.cs @@ -3,6 +3,7 @@ using System; using osu.Framework.Graphics.Sprites; +using osu.Framework.Localisation; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; @@ -12,7 +13,7 @@ namespace osu.Game.Online.Placeholders { public Action Action; - public ClickablePlaceholder(string actionMessage, IconUsage icon) + public ClickablePlaceholder(LocalisableString actionMessage, IconUsage icon) { OsuTextFlowContainer textFlow; diff --git a/osu.Game/Online/Placeholders/MessagePlaceholder.cs b/osu.Game/Online/Placeholders/MessagePlaceholder.cs index 7342765ca4..1676ba6cf2 100644 --- a/osu.Game/Online/Placeholders/MessagePlaceholder.cs +++ b/osu.Game/Online/Placeholders/MessagePlaceholder.cs @@ -3,14 +3,15 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; +using osu.Framework.Localisation; namespace osu.Game.Online.Placeholders { public class MessagePlaceholder : Placeholder { - private readonly string message; + private readonly LocalisableString message; - public MessagePlaceholder(string message) + public MessagePlaceholder(LocalisableString message) { AddIcon(FontAwesome.Solid.ExclamationCircle, cp => { diff --git a/osu.Game/Overlays/Dialog/PopupDialog.cs b/osu.Game/Overlays/Dialog/PopupDialog.cs index 78ef2ec795..0f953f92bb 100644 --- a/osu.Game/Overlays/Dialog/PopupDialog.cs +++ b/osu.Game/Overlays/Dialog/PopupDialog.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Input.Events; +using osu.Framework.Localisation; using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Containers; using osuTK; @@ -42,9 +43,9 @@ namespace osu.Game.Overlays.Dialog set => icon.Icon = value; } - private string headerText; + private LocalisableString headerText; - public string HeaderText + public LocalisableString HeaderText { get => headerText; set @@ -57,9 +58,9 @@ namespace osu.Game.Overlays.Dialog } } - private string bodyText; + private LocalisableString bodyText; - public string BodyText + public LocalisableString BodyText { get => bodyText; set diff --git a/osu.Game/Overlays/Notifications/ProgressNotification.cs b/osu.Game/Overlays/Notifications/ProgressNotification.cs index b27e15dd2c..c44b88ad29 100644 --- a/osu.Game/Overlays/Notifications/ProgressNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressNotification.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; +using osu.Framework.Localisation; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; @@ -22,7 +23,7 @@ namespace osu.Game.Overlays.Notifications { private const float loading_spinner_size = 22; - public string Text + public LocalisableString Text { set => Schedule(() => textDrawable.Text = value); } diff --git a/osu.Game/Overlays/Notifications/SimpleNotification.cs b/osu.Game/Overlays/Notifications/SimpleNotification.cs index 3a3136b1ea..17ec12a4ca 100644 --- a/osu.Game/Overlays/Notifications/SimpleNotification.cs +++ b/osu.Game/Overlays/Notifications/SimpleNotification.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; +using osu.Framework.Localisation; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osuTK; @@ -15,9 +16,9 @@ namespace osu.Game.Overlays.Notifications { public class SimpleNotification : Notification { - private string text = string.Empty; + private LocalisableString text; - public string Text + public LocalisableString Text { get => text; set diff --git a/osu.Game/Screens/Edit/Timing/SliderWithTextBoxInput.cs b/osu.Game/Screens/Edit/Timing/SliderWithTextBoxInput.cs index 10a5771520..6c004a7c8b 100644 --- a/osu.Game/Screens/Edit/Timing/SliderWithTextBoxInput.cs +++ b/osu.Game/Screens/Edit/Timing/SliderWithTextBoxInput.cs @@ -6,6 +6,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.UserInterface; +using osu.Framework.Localisation; using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Overlays.Settings; @@ -16,7 +17,7 @@ namespace osu.Game.Screens.Edit.Timing { private readonly SettingsSlider slider; - public SliderWithTextBoxInput(string labelText) + public SliderWithTextBoxInput(LocalisableString labelText) { LabelledTextBox textbox;