From 212973bd632a03a836deeb16ad4e8881315901f4 Mon Sep 17 00:00:00 2001 From: Denis Titovets Date: Thu, 1 Jan 2026 21:26:48 +0300 Subject: [PATCH] Localise friend presence notifications --- osu.Game/Localisation/NotificationsStrings.cs | 10 ++++++++++ osu.Game/Online/FriendPresenceNotifier.cs | 9 +++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/osu.Game/Localisation/NotificationsStrings.cs b/osu.Game/Localisation/NotificationsStrings.cs index 66250d1629..ae9267990d 100644 --- a/osu.Game/Localisation/NotificationsStrings.cs +++ b/osu.Game/Localisation/NotificationsStrings.cs @@ -135,6 +135,16 @@ Click to see what's new!", version); /// public static LocalisableString Mention => new TranslatableString(getKey(@"mention"), @"Mention"); + /// + /// "Online: {0}" + /// + public static LocalisableString FriendOnline(string info) => new TranslatableString(getKey(@"friend_online"), @"Online: {0}", info); + + /// + /// "Offline: {0}" + /// + public static LocalisableString FriendOffline(string info) => new TranslatableString(getKey(@"friend_offline"), @"Offline: {0}", info); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Online/FriendPresenceNotifier.cs b/osu.Game/Online/FriendPresenceNotifier.cs index 53c8ff7b5a..8329f3b46b 100644 --- a/osu.Game/Online/FriendPresenceNotifier.cs +++ b/osu.Game/Online/FriendPresenceNotifier.cs @@ -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 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 users) { - Text = $"Offline: {string.Join(@", ", users.Select(u => u.Username))}"; + Text = NotificationsStrings.FriendOffline(string.Join(@", ", users.Select(u => u.Username))); } [BackgroundDependencyLoader]