1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 00:23:01 +08:00

Add localisation for notification overlay

This commit is contained in:
ansel 2023-01-13 22:54:38 +03:00
parent b3d4da8fc9
commit c62d416680
3 changed files with 21 additions and 6 deletions

View File

@ -19,6 +19,21 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString HeaderDescription => new TranslatableString(getKey(@"header_description"), @"waiting for 'ya");
private static string getKey(string key) => $"{prefix}:{key}";
/// <summary>
/// "Running Tasks"
/// </summary>
public static LocalisableString RunningTasks => new TranslatableString(getKey(@"running_tasks"), @"Running Tasks");
/// <summary>
/// "Clear All"
/// </summary>
public static LocalisableString ClearAll => new TranslatableString(getKey(@"clear_all"), @"Clear All");
/// <summary>
/// "Cancel All"
/// </summary>
public static LocalisableString CancelAll => new TranslatableString(getKey(@"cancel_all"), @"Cancel All");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@ -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),
}
}
}

View File

@ -33,15 +33,15 @@ namespace osu.Game.Overlays.Notifications
public IEnumerable<Type> AcceptedNotificationTypes { get; }
private readonly string clearButtonText;
private readonly LocalisableString clearButtonText;
private readonly LocalisableString titleText;
public NotificationSection(LocalisableString title, IEnumerable<Type> acceptedNotificationTypes, string clearButtonText)
public NotificationSection(LocalisableString title, IEnumerable<Type> acceptedNotificationTypes, LocalisableString clearButtonText)
{
AcceptedNotificationTypes = acceptedNotificationTypes.ToArray();
this.clearButtonText = clearButtonText.ToUpperInvariant();
this.clearButtonText = clearButtonText.ToUpper();
titleText = title;
}