mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 06:32:55 +08:00
Merge pull request #24039 from bastianpedersen/localise-multiplayer-countdown-buttons
Localise multiplayer countdown buttons
This commit is contained in:
commit
6ec8ccda11
29
osu.Game/Localisation/MultiplayerMatchStrings.cs
Normal file
29
osu.Game/Localisation/MultiplayerMatchStrings.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
|
||||||
|
namespace osu.Game.Localisation
|
||||||
|
{
|
||||||
|
public static class MultiplayerMatchStrings
|
||||||
|
{
|
||||||
|
private const string prefix = @"osu.Game.Resources.Localisation.MultiplayerMatchStrings";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Stop countdown"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString StopCountdown => new TranslatableString(getKey(@"stop_countdown"), @"Stop countdown");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Countdown settings"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString CountdownSettings => new TranslatableString(getKey(@"countdown_settings"), @"Countdown settings");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Start match in {0}"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString StartMatchWithCountdown(string humanReadableTime) => new TranslatableString(getKey(@"start_match_width_countdown"), @"Start match in {0}", humanReadableTime);
|
||||||
|
|
||||||
|
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||||
|
}
|
||||||
|
}
|
@ -17,6 +17,7 @@ using osu.Framework.Graphics.UserInterface;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Graphics.UserInterfaceV2;
|
using osu.Game.Graphics.UserInterfaceV2;
|
||||||
|
using osu.Game.Localisation;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
|||||||
|
|
||||||
base.Action = this.ShowPopover;
|
base.Action = this.ShowPopover;
|
||||||
|
|
||||||
TooltipText = "Countdown settings";
|
TooltipText = MultiplayerMatchStrings.CountdownSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -112,7 +113,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
|||||||
flow.Add(new RoundedButton
|
flow.Add(new RoundedButton
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Text = $"Start match in {duration.Humanize()}",
|
Text = MultiplayerMatchStrings.StartMatchWithCountdown(duration.Humanize()),
|
||||||
BackgroundColour = colours.Green,
|
BackgroundColour = colours.Green,
|
||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
@ -127,7 +128,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
|||||||
flow.Add(new RoundedButton
|
flow.Add(new RoundedButton
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Text = "Stop countdown",
|
Text = MultiplayerMatchStrings.StopCountdown,
|
||||||
BackgroundColour = colours.Red,
|
BackgroundColour = colours.Red,
|
||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user