mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:28:00 +08:00
Add localisation for context menu strings
This commit is contained in:
parent
2c2f347e25
commit
b9dfb8b602
@ -13,6 +13,7 @@ using osu.Game.Graphics.UserInterface;
|
|||||||
using osu.Game.Online;
|
using osu.Game.Online;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Beatmaps.Drawables.Cards
|
namespace osu.Game.Beatmaps.Drawables.Cards
|
||||||
{
|
{
|
||||||
@ -101,7 +102,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
|||||||
|
|
||||||
public MenuItem[] ContextMenuItems => new MenuItem[]
|
public MenuItem[] ContextMenuItems => new MenuItem[]
|
||||||
{
|
{
|
||||||
new OsuMenuItem("View beatmap", MenuItemType.Highlighted, Action),
|
new OsuMenuItem(ContextMenuStrings.ViewBeatmap, MenuItemType.Highlighted, Action),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
24
osu.Game/Localisation/ContextMenuStrings.cs
Normal file
24
osu.Game/Localisation/ContextMenuStrings.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// 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 ContextMenuStrings
|
||||||
|
{
|
||||||
|
private const string prefix = @"osu.Game.Resources.Localisation.ContextMenu";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "View profile"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString ViewProfile => new TranslatableString(getKey(@"view_profile"), @"View profile");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "View beatmap"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString ViewBeatmap => new TranslatableString(getKey(@"view_beatmap"), @"View beatmap");
|
||||||
|
|
||||||
|
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||||
|
}
|
||||||
|
}
|
@ -17,6 +17,7 @@ using osu.Game.Graphics;
|
|||||||
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.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Online.Chat;
|
using osu.Game.Online.Chat;
|
||||||
@ -149,7 +150,7 @@ namespace osu.Game.Overlays.Chat
|
|||||||
|
|
||||||
List<MenuItem> items = new List<MenuItem>
|
List<MenuItem> items = new List<MenuItem>
|
||||||
{
|
{
|
||||||
new OsuMenuItem("View profile", MenuItemType.Highlighted, openUserProfile)
|
new OsuMenuItem(ContextMenuStrings.ViewProfile, MenuItemType.Highlighted, openUserProfile)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!user.Equals(api.LocalUser.Value))
|
if (!user.Equals(api.LocalUser.Value))
|
||||||
|
@ -20,6 +20,7 @@ using osu.Game.Online.API;
|
|||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Online.Chat;
|
using osu.Game.Online.Chat;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
using osu.Game.Resources.Localisation.Web;
|
||||||
|
using osu.Game.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Users
|
namespace osu.Game.Users
|
||||||
{
|
{
|
||||||
@ -108,7 +109,7 @@ namespace osu.Game.Users
|
|||||||
{
|
{
|
||||||
List<MenuItem> items = new List<MenuItem>
|
List<MenuItem> items = new List<MenuItem>
|
||||||
{
|
{
|
||||||
new OsuMenuItem("View profile", MenuItemType.Highlighted, ViewProfile)
|
new OsuMenuItem(ContextMenuStrings.ViewProfile, MenuItemType.Highlighted, ViewProfile)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!User.Equals(api.LocalUser.Value))
|
if (!User.Equals(api.LocalUser.Value))
|
||||||
|
Loading…
Reference in New Issue
Block a user