1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 07:43:00 +08:00

Ad localisation (and adjust messaging) of invite failures

This commit is contained in:
Dean Herbert 2023-10-12 18:07:03 +09:00
parent 361d70f68a
commit 5f62c225bf
No known key found for this signature in database
4 changed files with 15 additions and 10 deletions

View File

@ -14,6 +14,16 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString SupporterOnlyDurationNotice => new TranslatableString(getKey(@"supporter_only_duration_notice"), @"Playlist durations longer than 2 weeks require an active osu!supporter tag.");
/// <summary>
/// "Can&#39;t invite this user as you have blocked them or they have blocked you."
/// </summary>
public static LocalisableString InviteFailedUserBlocked => new TranslatableString(getKey(@"cant_invite_this_user_as"), @"Can't invite this user as you have blocked them or they have blocked you.");
/// <summary>
/// "Can&#39;t invite this user as they have opted out of non-friend communications."
/// </summary>
public static LocalisableString InviteFailedUserOptOut => new TranslatableString(getKey(@"cant_invite_this_user_as1"), @"Can't invite this user as they have opted out of non-friend communications.");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@ -13,6 +13,7 @@ using osu.Framework.Bindables;
using osu.Game.Online.API;
using osu.Game.Online.Rooms;
using osu.Game.Overlays.Notifications;
using osu.Game.Localisation;
namespace osu.Game.Online.Multiplayer
{
@ -124,17 +125,11 @@ namespace osu.Game.Online.Multiplayer
switch (exception.GetHubExceptionMessage())
{
case UserBlockedException.MESSAGE:
PostNotification?.Invoke(new SimpleErrorNotification
{
Text = "User cannot be invited by someone they have blocked or are blocked by."
});
PostNotification?.Invoke(new SimpleErrorNotification { Text = OnlinePlayStrings.InviteFailedUserBlocked });
break;
case UserBlocksPMsException.MESSAGE:
PostNotification?.Invoke(new SimpleErrorNotification
{
Text = "User cannot be invited because they cannot receive private messages from people not on their friends list."
});
PostNotification?.Invoke(new SimpleErrorNotification { Text = OnlinePlayStrings.InviteFailedUserOptOut });
break;
}
}

View File

@ -10,7 +10,7 @@ namespace osu.Game.Online.Multiplayer
[Serializable]
public class UserBlockedException : HubException
{
public const string MESSAGE = "User cannot be invited by someone they have blocked or are blocked by.";
public const string MESSAGE = @"Cannot perform action due to user being blocked.";
public UserBlockedException()
: base(MESSAGE)

View File

@ -10,7 +10,7 @@ namespace osu.Game.Online.Multiplayer
[Serializable]
public class UserBlocksPMsException : HubException
{
public const string MESSAGE = "User cannot be invited because they have disabled private messages.";
public const string MESSAGE = "Cannot perform action because user has disabled non-friend communications.";
public UserBlocksPMsException()
: base(MESSAGE)