1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Localise chat related notifications

This commit is contained in:
Bastian Pedersen 2023-06-28 21:11:56 +02:00
parent 1d4380cfd0
commit ea87000539
2 changed files with 13 additions and 2 deletions

View File

@ -88,6 +88,16 @@ Please try changing your audio device to a working setting.");
/// </summary> /// </summary>
public static LocalisableString LinkTypeNotSupported => new TranslatableString(getKey(@"unsupported_link_type"), @"This link type is not yet supported!"); public static LocalisableString LinkTypeNotSupported => new TranslatableString(getKey(@"unsupported_link_type"), @"This link type is not yet supported!");
/// <summary>
/// "You received a private message from '{0}'. Click to read it!"
/// </summary>
public static LocalisableString PrivateMessageReceived(string username) => new TranslatableString(getKey(@"private_message_received"), @"You received a private message from '{0}'. Click to read it!", username);
/// <summary>
/// "Your name was mentioned in chat by '{0}'. Click to find out why!"
/// </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);
private static string getKey(string key) => $@"{prefix}:{key}"; private static string getKey(string key) => $@"{prefix}:{key}";
} }
} }

View File

@ -15,6 +15,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics; using osu.Game.Graphics;
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.Overlays; using osu.Game.Overlays;
@ -154,7 +155,7 @@ namespace osu.Game.Online.Chat
: base(message, channel) : base(message, channel)
{ {
Icon = FontAwesome.Solid.Envelope; Icon = FontAwesome.Solid.Envelope;
Text = $"You received a private message from '{message.Sender.Username}'. Click to read it!"; Text = NotificationsStrings.PrivateMessageReceived(message.Sender.Username);
} }
} }
@ -164,7 +165,7 @@ namespace osu.Game.Online.Chat
: base(message, channel) : base(message, channel)
{ {
Icon = FontAwesome.Solid.At; Icon = FontAwesome.Solid.At;
Text = $"Your name was mentioned in chat by '{message.Sender.Username}'. Click to find out why!"; Text = NotificationsStrings.YourNameWasMentioned(message.Sender.Username);
} }
} }