From 8a21c6814cf13a879ace7ee4bf1970d9ca64bae1 Mon Sep 17 00:00:00 2001 From: Denis Titovets Date: Sun, 11 Jan 2026 16:53:44 +0300 Subject: [PATCH] Localise notification in `OsuGame` --- osu.Game/Localisation/NotificationsStrings.cs | 5 +++++ osu.Game/OsuGame.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game/Localisation/NotificationsStrings.cs b/osu.Game/Localisation/NotificationsStrings.cs index 75f1a39a69..c4df6e4fcc 100644 --- a/osu.Game/Localisation/NotificationsStrings.cs +++ b/osu.Game/Localisation/NotificationsStrings.cs @@ -190,6 +190,11 @@ Click to see what's new!", version); /// public static LocalisableString CollectionsImportProgressTotal(int count, int totalCount) => new TranslatableString(getKey(@"collections_import_progress_total"), @"Imported {0} of {1} collections", count, totalCount); + /// + /// "This error has been automatically reported to the devs." + /// + public static LocalisableString ErrorAutomaticallyReported => new TranslatableString(getKey(@"error_automatically_reported"), @"This error has been automatically reported to the devs."); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 4ea9fae183..0649846b97 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -1383,7 +1383,7 @@ namespace osu.Game Schedule(() => Notifications.Post(new SimpleErrorNotification { Icon = entry.Level == LogLevel.Important ? FontAwesome.Solid.ExclamationCircle : FontAwesome.Solid.Bomb, - Text = entry.Message.Truncate(256) + (entry.Exception != null && IsDeployedBuild ? "\n\nThis error has been automatically reported to the devs." : string.Empty), + Text = LocalisableString.Interpolate($"{entry.Message.Truncate(256)}{(entry.Exception != null && IsDeployedBuild ? LocalisableString.Interpolate($"\n\n{NotificationsStrings.ErrorAutomaticallyReported}") : string.Empty)}"), })); } else if (generalLogRecentCount == short_term_display_limit)