From c62d416680e3b1a4a019fd7d7b1d09f3fba9cc4f Mon Sep 17 00:00:00 2001
From: ansel <79257300125@ya.ru>
Date: Fri, 13 Jan 2023 22:54:38 +0300
Subject: [PATCH] Add localisation for notification overlay
---
osu.Game/Localisation/NotificationsStrings.cs | 17 ++++++++++++++++-
osu.Game/Overlays/NotificationOverlay.cs | 4 ++--
.../Notifications/NotificationSection.cs | 6 +++---
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/osu.Game/Localisation/NotificationsStrings.cs b/osu.Game/Localisation/NotificationsStrings.cs
index 382e0d81f4..c7df185543 100644
--- a/osu.Game/Localisation/NotificationsStrings.cs
+++ b/osu.Game/Localisation/NotificationsStrings.cs
@@ -19,6 +19,21 @@ namespace osu.Game.Localisation
///
public static LocalisableString HeaderDescription => new TranslatableString(getKey(@"header_description"), @"waiting for 'ya");
- private static string getKey(string key) => $"{prefix}:{key}";
+ ///
+ /// "Running Tasks"
+ ///
+ public static LocalisableString RunningTasks => new TranslatableString(getKey(@"running_tasks"), @"Running Tasks");
+
+ ///
+ /// "Clear All"
+ ///
+ public static LocalisableString ClearAll => new TranslatableString(getKey(@"clear_all"), @"Clear All");
+
+ ///
+ /// "Cancel All"
+ ///
+ public static LocalisableString CancelAll => new TranslatableString(getKey(@"cancel_all"), @"Cancel All");
+
+ private static string getKey(string key) => $@"{prefix}:{key}";
}
}
diff --git a/osu.Game/Overlays/NotificationOverlay.cs b/osu.Game/Overlays/NotificationOverlay.cs
index 3f3c6551c6..71a4c58afd 100644
--- a/osu.Game/Overlays/NotificationOverlay.cs
+++ b/osu.Game/Overlays/NotificationOverlay.cs
@@ -92,8 +92,8 @@ namespace osu.Game.Overlays
RelativeSizeAxes = Axes.X,
Children = new[]
{
- new NotificationSection(AccountsStrings.NotificationsTitle, new[] { typeof(SimpleNotification) }, "Clear All"),
- new NotificationSection(@"Running Tasks", new[] { typeof(ProgressNotification) }, @"Cancel All"),
+ new NotificationSection(AccountsStrings.NotificationsTitle, new[] { typeof(SimpleNotification) }, NotificationsStrings.ClearAll),
+ new NotificationSection(NotificationsStrings.RunningTasks, new[] { typeof(ProgressNotification) }, NotificationsStrings.CancelAll),
}
}
}
diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs
index d55a2abd2a..de4c72e473 100644
--- a/osu.Game/Overlays/Notifications/NotificationSection.cs
+++ b/osu.Game/Overlays/Notifications/NotificationSection.cs
@@ -33,15 +33,15 @@ namespace osu.Game.Overlays.Notifications
public IEnumerable AcceptedNotificationTypes { get; }
- private readonly string clearButtonText;
+ private readonly LocalisableString clearButtonText;
private readonly LocalisableString titleText;
- public NotificationSection(LocalisableString title, IEnumerable acceptedNotificationTypes, string clearButtonText)
+ public NotificationSection(LocalisableString title, IEnumerable acceptedNotificationTypes, LocalisableString clearButtonText)
{
AcceptedNotificationTypes = acceptedNotificationTypes.ToArray();
- this.clearButtonText = clearButtonText.ToUpperInvariant();
+ this.clearButtonText = clearButtonText.ToUpper();
titleText = title;
}