1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-28 02:25:29 +08:00

Use existing localisation for "view profile"

This commit is contained in:
Magnus-Cosmos
2023-09-02 22:51:08 -04:00
Unverified
parent d674856e29
commit 40dbf098d2
2 changed files with 4 additions and 4 deletions
@@ -15,6 +15,7 @@ using osu.Framework.Localisation;
using osu.Framework.Platform;
using osu.Game.Online;
using osu.Game.Users;
using osu.Game.Localisation;
namespace osu.Game.Graphics.Containers
{
@@ -74,7 +75,7 @@ namespace osu.Game.Graphics.Containers
}
public void AddUserLink(IUser user, Action<SpriteText> creationParameters = null)
=> createLink(CreateChunkFor(user.Username, true, CreateSpriteText, creationParameters), new LinkDetails(LinkAction.OpenUserProfile, user), "view profile");
=> createLink(CreateChunkFor(user.Username, true, CreateSpriteText, creationParameters), new LinkDetails(LinkAction.OpenUserProfile, user), ContextMenuStrings.ViewProfile);
private void createLink(ITextPart textPart, LinkDetails link, LocalisableString tooltipText, Action action = null)
{
+2 -3
View File
@@ -6,14 +6,13 @@ using osu.Framework.Allocation;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Game.Graphics.Containers;
using osu.Game.Localisation;
using osu.Game.Online.API.Requests.Responses;
namespace osu.Game.Users.Drawables
{
public partial class ClickableAvatar : OsuClickableContainer
{
private const string default_tooltip_text = "view profile";
public override LocalisableString TooltipText
{
get
@@ -21,7 +20,7 @@ namespace osu.Game.Users.Drawables
if (!Enabled.Value)
return string.Empty;
return ShowUsernameTooltip ? (user?.Username ?? string.Empty) : default_tooltip_text;
return ShowUsernameTooltip ? (user?.Username ?? string.Empty) : ContextMenuStrings.ViewProfile;
}
set => throw new NotSupportedException();
}