mirror of
https://github.com/ppy/osu.git
synced 2025-03-31 08:57:19 +08:00
Add localisation
This commit is contained in:
parent
82a63228de
commit
5ebaab7e9a
34
osu.Game/Localisation/RoomStatusPillStrings.cs
Normal file
34
osu.Game/Localisation/RoomStatusPillStrings.cs
Normal file
@ -0,0 +1,34 @@
|
||||
// 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 RoomStatusPillStrings
|
||||
{
|
||||
private const string prefix = @"osu.Game.Resources.Localisation.RoomStatusPill";
|
||||
|
||||
/// <summary>
|
||||
/// "Ended"
|
||||
/// </summary>
|
||||
public static LocalisableString Ended => new TranslatableString(getKey(@"ended"), @"Ended");
|
||||
|
||||
/// <summary>
|
||||
/// "Playing"
|
||||
/// </summary>
|
||||
public static LocalisableString Playing => new TranslatableString(getKey(@"playing"), @"Playing");
|
||||
|
||||
/// <summary>
|
||||
/// "Open (Private)"
|
||||
/// </summary>
|
||||
public static LocalisableString OpenPrivate => new TranslatableString(getKey(@"open_private"), @"Open (Private)");
|
||||
|
||||
/// <summary>
|
||||
/// "Open"
|
||||
/// </summary>
|
||||
public static LocalisableString Open => new TranslatableString(getKey(@"open"), @"Open");
|
||||
|
||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||
}
|
||||
}
|
@ -8,6 +8,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Localisation;
|
||||
|
||||
namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
{
|
||||
@ -59,17 +60,17 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
Pill.Background.FadeColour(colours.ForRoomStatus(room), 100);
|
||||
|
||||
if (DateTimeOffset.Now >= room.EndDate)
|
||||
TextFlow.Text = "Ended";
|
||||
TextFlow.Text = RoomStatusPillStrings.Ended;
|
||||
else
|
||||
{
|
||||
switch (room.Status)
|
||||
{
|
||||
case RoomStatus.Playing:
|
||||
TextFlow.Text = "Playing";
|
||||
TextFlow.Text = RoomStatusPillStrings.Playing;
|
||||
break;
|
||||
|
||||
default:
|
||||
TextFlow.Text = room.HasPassword ? "Open (Private)" : "Open";
|
||||
TextFlow.Text = room.HasPassword ? RoomStatusPillStrings.OpenPrivate : RoomStatusPillStrings.Open;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user