Share localised strings with expanded display message

This commit is contained in:
Dean Herbert 2022-08-09 15:57:16 +09:00
parent 3f8cedff3a
commit 5d8bd1de28
3 changed files with 4 additions and 3 deletions

View File

@ -12,7 +12,7 @@ public static class ToolbarStrings
/// <summary> /// <summary>
/// "Connection interrupted, will try to reconnect..." /// "Connection interrupted, will try to reconnect..."
/// </summary> /// </summary>
public static LocalisableString ConnectionInterruptedWillTryTo => new TranslatableString(getKey(@"connection_interrupted_will_try_to"), @"Connection interrupted, will try to reconnect..."); public static LocalisableString AttemptingToReconnect => new TranslatableString(getKey(@"attempting_to_reconnect"), @"Connection interrupted, will try to reconnect...");
/// <summary> /// <summary>
/// "Connecting..." /// "Connecting..."

View File

@ -13,6 +13,7 @@
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Users; using osu.Game.Users;
using osuTK; using osuTK;
@ -109,7 +110,7 @@ private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule((
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
TextAnchor = Anchor.TopCentre, TextAnchor = Anchor.TopCentre,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Text = state.NewValue == APIState.Failing ? "Connection is failing, will attempt to reconnect... " : "Attempting to connect... ", Text = state.NewValue == APIState.Failing ? ToolbarStrings.AttemptingToReconnect : ToolbarStrings.Connecting,
Margin = new MarginPadding { Top = 10, Bottom = 10 }, Margin = new MarginPadding { Top = 10, Bottom = 10 },
}, },
}; };

View File

@ -107,7 +107,7 @@ private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule((
break; break;
case APIState.Failing: case APIState.Failing:
TooltipText = ToolbarStrings.ConnectionInterruptedWillTryTo; TooltipText = ToolbarStrings.AttemptingToReconnect;
spinner.Show(); spinner.Show();
break; break;