1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-03 03:20:16 +08:00

Localise friend presence notifications

This commit is contained in:
Denis Titovets
2026-01-01 21:26:48 +03:00
Unverified
parent 5cba990940
commit 212973bd63
2 changed files with 15 additions and 4 deletions
@@ -135,6 +135,16 @@ Click to see what's new!", version);
/// </summary>
public static LocalisableString Mention => new TranslatableString(getKey(@"mention"), @"Mention");
/// <summary>
/// "Online: {0}"
/// </summary>
public static LocalisableString FriendOnline(string info) => new TranslatableString(getKey(@"friend_online"), @"Online: {0}", info);
/// <summary>
/// "Offline: {0}"
/// </summary>
public static LocalisableString FriendOffline(string info) => new TranslatableString(getKey(@"friend_offline"), @"Offline: {0}", info);
private static string getKey(string key) => $@"{prefix}:{key}";
}
}
+5 -4
View File
@@ -11,6 +11,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Localisation;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Chat;
@@ -197,7 +198,7 @@ namespace osu.Game.Online
{
Transient = true;
IsImportant = false;
Text = $"Online: {User.Username}";
Text = NotificationsStrings.FriendOnline(User.Username);
}
[BackgroundDependencyLoader]
@@ -219,7 +220,7 @@ namespace osu.Game.Online
{
public MultipleFriendsOnlineNotification(ICollection<APIUser> users)
{
Text = $"Online: {string.Join(@", ", users.Select(u => u.Username))}";
Text = NotificationsStrings.FriendOnline(string.Join(@", ", users.Select(u => u.Username)));
}
[BackgroundDependencyLoader]
@@ -239,7 +240,7 @@ namespace osu.Game.Online
{
Transient = true;
IsImportant = false;
Text = $"Offline: {User.Username}";
Text = NotificationsStrings.FriendOffline(User.Username);
}
[BackgroundDependencyLoader]
@@ -256,7 +257,7 @@ namespace osu.Game.Online
{
public MultipleFriendsOfflineNotification(ICollection<APIUser> users)
{
Text = $"Offline: {string.Join(@", ", users.Select(u => u.Username))}";
Text = NotificationsStrings.FriendOffline(string.Join(@", ", users.Select(u => u.Username)));
}
[BackgroundDependencyLoader]