From 00560cbfbab084b1de0c40f0ca40edcdc82266dc Mon Sep 17 00:00:00 2001 From: Denis Titovets Date: Sun, 4 Jan 2026 20:54:50 +0300 Subject: [PATCH] Localise notifications in `LegacyCollectionImporter` --- osu.Game/Database/LegacyCollectionImporter.cs | 9 +++++---- osu.Game/Localisation/NotificationsStrings.cs | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/osu.Game/Database/LegacyCollectionImporter.cs b/osu.Game/Database/LegacyCollectionImporter.cs index 6d3e3fb76a..b8a515b96f 100644 --- a/osu.Game/Database/LegacyCollectionImporter.cs +++ b/osu.Game/Database/LegacyCollectionImporter.cs @@ -10,6 +10,7 @@ using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.Collections; using osu.Game.IO.Legacy; +using osu.Game.Localisation; using osu.Game.Overlays.Notifications; namespace osu.Game.Database @@ -63,7 +64,7 @@ namespace osu.Game.Database var notification = new ProgressNotification { State = ProgressNotificationState.Active, - Text = "Collections import is initialising..." + Text = NotificationsStrings.CollectionsImportInitialising, }; PostNotification?.Invoke(notification); @@ -71,7 +72,7 @@ namespace osu.Game.Database var importedCollections = readCollections(stream, notification); await importCollections(importedCollections).ConfigureAwait(false); - notification.CompletionText = $"Imported {importedCollections.Count} collections"; + notification.CompletionText = NotificationsStrings.CollectionsImportProgress(importedCollections.Count); notification.State = ProgressNotificationState.Completed; } @@ -115,7 +116,7 @@ namespace osu.Game.Database { if (notification != null) { - notification.Text = "Reading collections..."; + notification.Text = NotificationsStrings.ReadingCollections; notification.Progress = 0; } @@ -150,7 +151,7 @@ namespace osu.Game.Database if (notification != null) { - notification.Text = $"Imported {i + 1} of {collectionCount} collections"; + notification.Text = NotificationsStrings.CollectionsImportProgressTotal(i + 1, collectionCount); notification.Progress = (float)(i + 1) / collectionCount; } diff --git a/osu.Game/Localisation/NotificationsStrings.cs b/osu.Game/Localisation/NotificationsStrings.cs index ae9267990d..0a97806b72 100644 --- a/osu.Game/Localisation/NotificationsStrings.cs +++ b/osu.Game/Localisation/NotificationsStrings.cs @@ -145,6 +145,26 @@ Click to see what's new!", version); /// public static LocalisableString FriendOffline(string info) => new TranslatableString(getKey(@"friend_offline"), @"Offline: {0}", info); + /// + /// "Collections import is initialising..." + /// + public static LocalisableString CollectionsImportInitialising => new TranslatableString(getKey(@"collections_import_initialising"), @"Collections import is initialising..."); + + /// + /// "Reading collections..." + /// + public static LocalisableString ReadingCollections => new TranslatableString(getKey(@"reading_collections"), @"Reading collections..."); + + /// + /// "Imported {0} collections" + /// + public static LocalisableString CollectionsImportProgress(int count) => new TranslatableString(getKey(@"collections_import_progress"), @"Imported {0} collections", count); + + /// + /// "Imported {0} of {1} collections" + /// + public static LocalisableString CollectionsImportProgressTotal(int count, int totalCount) => new TranslatableString(getKey(@"collections_import_progress_total"), @"Imported {0} of {1} collections", count, totalCount); + private static string getKey(string key) => $@"{prefix}:{key}"; } }