mirror of https://github.com/ppy/osu
Allow localisation of the invite notification
This commit is contained in:
parent
a1a9bb75b7
commit
d2aa601912
|
@ -93,6 +93,11 @@ public static class NotificationsStrings
|
|||
/// </summary>
|
||||
public static LocalisableString YourNameWasMentioned(string username) => new TranslatableString(getKey(@"your_name_was_mentioned"), @"Your name was mentioned in chat by '{0}'. Click to find out why!", username);
|
||||
|
||||
/// <summary>
|
||||
/// "{0} invited you to the multiplayer match "{1}"! Click to join."
|
||||
/// </summary>
|
||||
public static LocalisableString InvitedYouToTheMultiplayer(string username, string roomName) => new TranslatableString(getKey(@"invited_you_to_the_multiplayer"), @"{0} invited you to the multiplayer match ""{1}""! Click to join.", username, roomName);
|
||||
|
||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Utils;
|
||||
using osu.Game.Localisation;
|
||||
|
||||
namespace osu.Game.Online.Multiplayer
|
||||
{
|
||||
|
@ -452,7 +453,7 @@ async Task IMultiplayerClient.Invited(int invitedBy, long roomID, string passwor
|
|||
if (apiUser == null || apiRoom == null) return;
|
||||
|
||||
PostNotification?.Invoke(
|
||||
new UserAvatarNotification(apiUser, $"{apiUser.Username} invited you to a multiplayer match:\"{apiRoom.Name}\"!")
|
||||
new UserAvatarNotification(apiUser, NotificationsStrings.InvitedYouToTheMultiplayer(apiUser.Username, apiRoom.Name.Value))
|
||||
{
|
||||
Activated = () =>
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue