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:
parent
361d70f68a
commit
5f62c225bf
@ -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'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'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}";
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user