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>
/// "Connection interrupted, will try to reconnect..."
/// </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>
/// "Connecting..."

View File

@ -13,6 +13,7 @@
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
using osu.Game.Online.API;
using osu.Game.Users;
using osuTK;
@ -109,7 +110,7 @@ private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule((
Origin = Anchor.TopCentre,
TextAnchor = Anchor.TopCentre,
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 },
},
};

View File

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