diff --git a/osu.Game/Beatmaps/BeatmapImporter.cs b/osu.Game/Beatmaps/BeatmapImporter.cs index f80c4de4ea6e..9e4890cb6b30 100644 --- a/osu.Game/Beatmaps/BeatmapImporter.cs +++ b/osu.Game/Beatmaps/BeatmapImporter.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using osu.Framework.Extensions; using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Framework.Localisation; using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.Beatmaps.Formats; @@ -18,6 +19,7 @@ using osu.Game.Extensions; using osu.Game.IO; using osu.Game.IO.Archives; +using osu.Game.Localisation; using osu.Game.Overlays.Notifications; using osu.Game.Rulesets; using osu.Game.Rulesets.Objects.Types; @@ -455,5 +457,21 @@ private List createBeatmapDifficulties(BeatmapSetInfo beatmapSet, R return beatmaps; } + + protected override LocalisableString ImportAbortedText => NotificationsStrings.ImportBeatmapsAborted; + + protected override LocalisableString ImportStartingText => NotificationsStrings.ImportBeatmapsStarting; + + protected override LocalisableString ImportRunningText(int processedCount, int totalCount) => NotificationsStrings.ImportBeatmapsRunning(processedCount, totalCount); + + protected override LocalisableString ImportCompletedText(int totalCount) => NotificationsStrings.ImportBeatmapsCompleted(totalCount); + + protected override LocalisableString ImportIncompletedText(int processedCount, int totalCount) => NotificationsStrings.ImportBeatmapsIncompleted(processedCount, totalCount); + + protected override LocalisableString ImportFailedText => NotificationsStrings.ImportBeatmapsFailed; + + protected override LocalisableString ImportPausedText => NotificationsStrings.ImportBeatmapsPaused; + + protected override LocalisableString ImportResumingText => NotificationsStrings.ImportBeatmapsResuming; } } diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 6d1dbaafba2f..c80ee0367f61 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -14,12 +14,14 @@ using osu.Framework.Audio.Track; using osu.Framework.Extensions; using osu.Framework.IO.Stores; +using osu.Framework.Localisation; using osu.Framework.Platform; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.Formats; using osu.Game.Database; using osu.Game.Extensions; using osu.Game.IO.Archives; +using osu.Game.Localisation; using osu.Game.Models; using osu.Game.Online.API; using osu.Game.Online.API.Requests.Responses; @@ -372,7 +374,6 @@ public void DeleteAllVideos() public void ResetAllOffsets() { - const string reset_complete_message = "All offsets have been reset!"; Realm.Write(r => { var items = r.All(); @@ -383,7 +384,7 @@ public void ResetAllOffsets() beatmap.UserSettings.Offset = 0; } - PostNotification?.Invoke(new ProgressCompletionNotification { Text = reset_complete_message }); + PostNotification?.Invoke(new ProgressCompletionNotification { Text = NotificationsStrings.RestoreBeatmapOffsetsCompleted }); }); } @@ -435,20 +436,18 @@ public void DeleteDifficultyImmediately(BeatmapInfo beatmapInfo) /// public void DeleteVideos(List items, bool silent = false) { - const string no_videos_message = "No videos found to delete!"; - if (items.Count == 0) { if (!silent) - PostNotification?.Invoke(new ProgressCompletionNotification { Text = no_videos_message }); + PostNotification?.Invoke(new ProgressCompletionNotification { Text = NotificationsStrings.DeleteBeatmapVideosAborted }); return; } var notification = new ProgressNotification { Progress = 0, - Text = $"Preparing to delete all {HumanisedModelName} videos...", - CompletionText = no_videos_message, + Text = NotificationsStrings.DeleteBeatmapVideosStarting, + CompletionText = NotificationsStrings.DeleteBeatmapVideosAborted, State = ProgressNotificationState.Active, }; @@ -470,10 +469,10 @@ public void DeleteVideos(List items, bool silent = false) { DeleteFile(b, video); deleted++; - notification.CompletionText = $"Deleted {deleted} {HumanisedModelName} video(s)!"; + notification.CompletionText = NotificationsStrings.DeleteBeatmapVideosCompleted(deleted); } - notification.Text = $"Deleting videos from {HumanisedModelName}s ({deleted} deleted)"; + notification.Text = NotificationsStrings.DeleteBeatmapVideosRunning(deleted); notification.Progress = (float)++i / items.Count; } @@ -682,6 +681,20 @@ public Action>>? PresentImport #endregion public override string HumanisedModelName => "beatmap"; + + protected override LocalisableString DeleteModelsAbortedText => NotificationsStrings.DeleteBeatmapsAborted; + + protected override LocalisableString DeleteModelsStartingText => NotificationsStrings.DeleteBeatmapsStarting; + + protected override LocalisableString DeleteModelsRunningText(int processedCount, int totalCount) => NotificationsStrings.DeleteBeatmapsRunning(processedCount, totalCount); + + protected override LocalisableString DeleteModelsCompletedText => NotificationsStrings.DeleteBeatmapsCompleted; + + protected override LocalisableString RestoreModelsAbortedText => NotificationsStrings.RestoreBeatmapsAborted; + + protected override LocalisableString RestoreModelsRunningText(int processedCount, int totalCount) => NotificationsStrings.RestoreBeatmapsRunning(processedCount, totalCount); + + protected override LocalisableString RestoreModelsCompletedText => NotificationsStrings.RestoreBeatmapsCompleted; } /// diff --git a/osu.Game/Database/BackgroundDataStoreProcessor.cs b/osu.Game/Database/BackgroundDataStoreProcessor.cs index f8d1b9ae5145..c548c0177aea 100644 --- a/osu.Game/Database/BackgroundDataStoreProcessor.cs +++ b/osu.Game/Database/BackgroundDataStoreProcessor.cs @@ -12,11 +12,13 @@ using osu.Framework.Bindables; using osu.Framework.Extensions; using osu.Framework.Graphics; +using osu.Framework.Localisation; using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Configuration; using osu.Game.Extensions; +using osu.Game.Localisation; using osu.Game.Online.API; using osu.Game.Overlays; using osu.Game.Overlays.Notifications; @@ -166,7 +168,7 @@ private void populateMissingStarRatings() Logger.Log($"Found {beatmapIds.Count} beatmaps which require star rating reprocessing."); - var notification = showProgressNotification(beatmapIds.Count, "Reprocessing star rating for beatmaps", "beatmaps' star ratings have been updated"); + var notification = showProgressNotification(beatmapIds.Count, NotificationsStrings.ReprocessStarRatingRunning); int processedCount = 0; int failedCount = 0; @@ -186,7 +188,7 @@ Ruleset getRuleset(RulesetInfo rulesetInfo) if (notification?.State == ProgressNotificationState.Cancelled) break; - updateNotificationProgress(notification, processedCount, beatmapIds.Count); + updateNotificationProgress(notification, processedCount, beatmapIds.Count, NotificationsStrings.ReprocessStarRatingRunning); sleepIfRequired(); @@ -220,7 +222,14 @@ Ruleset getRuleset(RulesetInfo rulesetInfo) } } - completeNotification(notification, processedCount, beatmapIds.Count, failedCount); + completeNotification( + notification, + processedCount, + beatmapIds.Count, + failedCount, + NotificationsStrings.ReprocessStarRatingCompleted(processedCount), + NotificationsStrings.ReprocessStarRatingIncompleted(processedCount, beatmapIds.Count) + ); } private void processOnlineBeatmapSetsWithNoUpdate() @@ -249,7 +258,7 @@ private void processOnlineBeatmapSetsWithNoUpdate() Logger.Log($"Found {beatmapSetIds.Count} beatmap sets which require online updates."); - var notification = showProgressNotification(beatmapSetIds.Count, "Updating online data for beatmaps", "beatmaps' online data have been updated"); + var notification = showProgressNotification(beatmapSetIds.Count, NotificationsStrings.UpdateOnlineDataRunning); int processedCount = 0; int failedCount = 0; @@ -259,7 +268,7 @@ private void processOnlineBeatmapSetsWithNoUpdate() if (notification?.State == ProgressNotificationState.Cancelled) break; - updateNotificationProgress(notification, processedCount, beatmapSetIds.Count); + updateNotificationProgress(notification, processedCount, beatmapSetIds.Count, NotificationsStrings.UpdateOnlineDataRunning); sleepIfRequired(); @@ -283,7 +292,14 @@ private void processOnlineBeatmapSetsWithNoUpdate() }); } - completeNotification(notification, processedCount, beatmapSetIds.Count, failedCount); + completeNotification( + notification, + processedCount, + beatmapSetIds.Count, + failedCount, + NotificationsStrings.UpdateOnlineDataCompleted(processedCount), + NotificationsStrings.UpdateOnlineDataIncompleted(processedCount, beatmapSetIds.Count) + ); } private void processBeatmapsWithMissingObjectCounts() @@ -303,7 +319,7 @@ private void processBeatmapsWithMissingObjectCounts() Logger.Log($"Found {beatmapIds.Count} beatmaps which require statistics population."); - var notification = showProgressNotification(beatmapIds.Count, "Populating missing statistics for beatmaps", "beatmaps have been populated with missing statistics"); + var notification = showProgressNotification(beatmapIds.Count, NotificationsStrings.PopulateBeatmapsStatsRunning); int processedCount = 0; int failedCount = 0; @@ -313,7 +329,7 @@ private void processBeatmapsWithMissingObjectCounts() if (notification?.State == ProgressNotificationState.Cancelled) break; - updateNotificationProgress(notification, processedCount, beatmapIds.Count); + updateNotificationProgress(notification, processedCount, beatmapIds.Count, NotificationsStrings.PopulateBeatmapsStatsRunning); sleepIfRequired(); @@ -337,7 +353,14 @@ private void processBeatmapsWithMissingObjectCounts() }); } - completeNotification(notification, processedCount, beatmapIds.Count, failedCount); + completeNotification( + notification, + processedCount, + beatmapIds.Count, + failedCount, + NotificationsStrings.PopulateBeatmapsStatsCompleted(processedCount), + NotificationsStrings.PopulateBeatmapsStatsIncompleted(processedCount, beatmapIds.Count) + ); } private void processScoresWithMissingStatistics() @@ -364,7 +387,7 @@ private void processScoresWithMissingStatistics() Logger.Log($"Found {scoreIds.Count} scores which require statistics population."); - var notification = showProgressNotification(scoreIds.Count, "Populating missing statistics for scores", "scores have been populated with missing statistics"); + var notification = showProgressNotification(scoreIds.Count, NotificationsStrings.PopulateScoresStatsRunning); int processedCount = 0; int failedCount = 0; @@ -374,7 +397,7 @@ private void processScoresWithMissingStatistics() if (notification?.State == ProgressNotificationState.Cancelled) break; - updateNotificationProgress(notification, processedCount, scoreIds.Count); + updateNotificationProgress(notification, processedCount, scoreIds.Count, NotificationsStrings.PopulateScoresStatsRunning); sleepIfRequired(); @@ -408,7 +431,14 @@ private void processScoresWithMissingStatistics() } } - completeNotification(notification, processedCount, scoreIds.Count, failedCount); + completeNotification( + notification, + processedCount, + scoreIds.Count, + failedCount, + NotificationsStrings.PopulateScoresStatsCompleted(processedCount), + NotificationsStrings.PopulateScoresStatsIncompleted(processedCount, scoreIds.Count) + ); } private void convertLegacyTotalScoreToStandardised() @@ -432,7 +462,7 @@ private void convertLegacyTotalScoreToStandardised() if (scoreIds.Count == 0) return; - var notification = showProgressNotification(scoreIds.Count, "Upgrading scores to new scoring algorithm", "scores have been upgraded to the new scoring algorithm"); + var notification = showProgressNotification(scoreIds.Count, NotificationsStrings.UpgradeScoringAlgorithmRunning); int processedCount = 0; int failedCount = 0; @@ -442,7 +472,7 @@ private void convertLegacyTotalScoreToStandardised() if (notification?.State == ProgressNotificationState.Cancelled) break; - updateNotificationProgress(notification, processedCount, scoreIds.Count); + updateNotificationProgress(notification, processedCount, scoreIds.Count, NotificationsStrings.UpgradeScoringAlgorithmRunning); sleepIfRequired(); @@ -471,7 +501,14 @@ private void convertLegacyTotalScoreToStandardised() } } - completeNotification(notification, processedCount, scoreIds.Count, failedCount); + completeNotification( + notification, + processedCount, + scoreIds.Count, + failedCount, + NotificationsStrings.UpgradeScoringAlgorithmCompleted(processedCount), + NotificationsStrings.UpgradeScoringAlgorithmIncompleted(processedCount, scoreIds.Count) + ); } private void upgradeScoreRanks() @@ -492,7 +529,7 @@ private void upgradeScoreRanks() if (scoreIds.Count == 0) return; - var notification = showProgressNotification(scoreIds.Count, "Adjusting ranks of scores", "scores now have more correct ranks."); + var notification = showProgressNotification(scoreIds.Count, NotificationsStrings.AdjustScoresRanksRunning); int processedCount = 0; int failedCount = 0; @@ -502,7 +539,7 @@ private void upgradeScoreRanks() if (notification?.State == ProgressNotificationState.Cancelled) break; - updateNotificationProgress(notification, processedCount, scoreIds.Count); + updateNotificationProgress(notification, processedCount, scoreIds.Count, NotificationsStrings.AdjustScoresRanksRunning); sleepIfRequired(); @@ -531,7 +568,14 @@ private void upgradeScoreRanks() } } - completeNotification(notification, processedCount, scoreIds.Count, failedCount); + completeNotification( + notification, + processedCount, + scoreIds.Count, + failedCount, + NotificationsStrings.AdjustScoresRanksCompleted(processedCount), + NotificationsStrings.AdjustScoresRanksIncompleted(processedCount, scoreIds.Count) + ); } private void backpopulateMissingSubmissionAndRankDates() @@ -575,7 +619,7 @@ private void backpopulateMissingSubmissionAndRankDates() Logger.Log($"Found {beatmapSetIds.Count} beatmap sets with missing submission/rank date."); - var notification = showProgressNotification(beatmapSetIds.Count, "Populating missing submission and rank dates", "beatmap sets now have correct submission and rank dates."); + var notification = showProgressNotification(beatmapSetIds.Count, NotificationsStrings.PopulateMissingDatesRunning); int processedCount = 0; int failedCount = 0; @@ -585,7 +629,7 @@ private void backpopulateMissingSubmissionAndRankDates() if (notification?.State == ProgressNotificationState.Cancelled) break; - updateNotificationProgress(notification, processedCount, beatmapSetIds.Count); + updateNotificationProgress(notification, processedCount, beatmapSetIds.Count, NotificationsStrings.PopulateMissingDatesRunning); sleepIfRequired(); @@ -629,7 +673,14 @@ private void backpopulateMissingSubmissionAndRankDates() } } - completeNotification(notification, processedCount, beatmapSetIds.Count, failedCount); + completeNotification( + notification, + processedCount, + beatmapSetIds.Count, + failedCount, + NotificationsStrings.PopulateMissingDatesCompleted(processedCount), + NotificationsStrings.PopulateMissingDatesIncompleted(processedCount, beatmapSetIds.Count) + ); } private void backpopulateUserTags() @@ -675,7 +726,7 @@ private void backpopulateUserTags() Logger.Log($@"Found {beatmapIds.Count} beatmaps with missing user tags."); - var notification = showProgressNotification(beatmapIds.Count, @"Populating missing user tags", @"beatmaps have had their tags updated."); + var notification = showProgressNotification(beatmapIds.Count, NotificationsStrings.PopulateMissingTagsRunning); int processedCount = 0; int failedCount = 0; @@ -685,7 +736,7 @@ private void backpopulateUserTags() if (notification?.State == ProgressNotificationState.Cancelled) break; - updateNotificationProgress(notification, processedCount, beatmapIds.Count); + updateNotificationProgress(notification, processedCount, beatmapIds.Count, NotificationsStrings.PopulateMissingTagsRunning); sleepIfRequired(); @@ -732,46 +783,53 @@ private void backpopulateUserTags() } } - completeNotification(notification, processedCount, beatmapIds.Count, failedCount); + completeNotification( + notification, + processedCount, + beatmapIds.Count, + failedCount, + NotificationsStrings.PopulateMissingTagsCompleted(processedCount), + NotificationsStrings.PopulateMissingTagsIncompleted(processedCount, beatmapIds.Count) + ); config.SetValue(OsuSetting.LastOnlineTagsPopulation, metadataSourceFetchDate); } - private void updateNotificationProgress(ProgressNotification? notification, int processedCount, int totalCount) + private void updateNotificationProgress(ProgressNotification? notification, int processedCount, int totalCount, LocalisableString text) { if (notification == null) return; - notification.Text = notification.Text.ToString().Split('(').First().TrimEnd() + $" ({processedCount} of {totalCount})"; + notification.Text = LocalisableString.Interpolate($"{text} {NotificationsStrings.BackgroundDataStoreProcessorItemsStatus(processedCount, totalCount)}"); notification.Progress = (float)processedCount / totalCount; if (processedCount % 100 == 0) Logger.Log(notification.Text.ToString()); } - private void completeNotification(ProgressNotification? notification, int processedCount, int totalCount, int? failedCount = null) + private void completeNotification(ProgressNotification? notification, int processedCount, int totalCount, int failedCount, LocalisableString text, LocalisableString textIncompleted) { if (notification == null) return; if (processedCount == totalCount) { - notification.CompletionText = $"{processedCount} {notification.CompletionText}"; + notification.CompletionText = text; notification.Progress = 1; notification.State = ProgressNotificationState.Completed; } else { - notification.Text = $"{processedCount} of {totalCount} {notification.CompletionText}"; - - // We may have arrived here due to user cancellation or completion with failures. if (failedCount > 0) - notification.Text += $" Check logs for issues with {failedCount} failed items."; + // We may have arrived here due to user cancellation or completion with failures. + notification.Text = LocalisableString.Interpolate($"{textIncompleted}\n\n{NotificationsStrings.BackgroundDataStoreProcessorFailedItems(failedCount)}"); + else + notification.Text = textIncompleted; notification.State = ProgressNotificationState.Cancelled; } } - private ProgressNotification? showProgressNotification(int totalCount, string running, string completed) + private ProgressNotification? showProgressNotification(int totalCount, LocalisableString text) { if (notificationOverlay == null) return null; @@ -781,8 +839,7 @@ private void completeNotification(ProgressNotification? notification, int proces ProgressNotification notification = new ProgressNotification { - Text = running, - CompletionText = completed, + Text = text, State = ProgressNotificationState.Active }; diff --git a/osu.Game/Database/ModelManager.cs b/osu.Game/Database/ModelManager.cs index 2eaba596d654..2b04f8a463e1 100644 --- a/osu.Game/Database/ModelManager.cs +++ b/osu.Game/Database/ModelManager.cs @@ -7,6 +7,7 @@ using System.IO; using System.Linq; using osu.Framework.Extensions; +using osu.Framework.Localisation; using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Extensions; @@ -115,15 +116,15 @@ public void Delete(List items, bool silent = false) if (items.Count == 0) { if (!silent) - PostNotification?.Invoke(new ProgressCompletionNotification { Text = $"No {HumanisedModelName}s found to delete!" }); + PostNotification?.Invoke(new ProgressCompletionNotification { Text = DeleteModelsAbortedText }); return; } var notification = new ProgressNotification { Progress = 0, - Text = $"Preparing to delete all {HumanisedModelName}s...", - CompletionText = $"Deleted all {HumanisedModelName}s!", + Text = DeleteModelsStartingText, + CompletionText = DeleteModelsCompletedText, State = ProgressNotificationState.Active, }; @@ -138,7 +139,7 @@ public void Delete(List items, bool silent = false) // user requested abort return; - notification.Text = $"Deleting {HumanisedModelName}s ({++i} of {items.Count})"; + notification.Text = DeleteModelsRunningText(++i, items.Count); Delete(b); @@ -157,14 +158,14 @@ public void Undelete(List items, bool silent = false) if (!items.Any()) { if (!silent) - PostNotification?.Invoke(new ProgressCompletionNotification { Text = $"No {HumanisedModelName}s found to restore!" }); + PostNotification?.Invoke(new ProgressCompletionNotification { Text = RestoreModelsAbortedText }); return; } var notification = new ProgressNotification { - CompletionText = "Restored all deleted items!", Progress = 0, + CompletionText = RestoreModelsCompletedText, State = ProgressNotificationState.Active, }; @@ -179,7 +180,7 @@ public void Undelete(List items, bool silent = false) // user requested abort return; - notification.Text = $"Restoring ({++i} of {items.Count})"; + notification.Text = RestoreModelsRunningText(++i, items.Count); Undelete(item); @@ -229,5 +230,19 @@ public void Undelete(TModel item) public Action? PostNotification { get; set; } public virtual string HumanisedModelName => $"{typeof(TModel).Name.Replace(@"Info", "").ToLowerInvariant()}"; + + protected virtual LocalisableString DeleteModelsAbortedText => $"No {HumanisedModelName}s found to delete!"; + + protected virtual LocalisableString DeleteModelsStartingText => $"Preparing to delete all {HumanisedModelName}s..."; + + protected virtual LocalisableString DeleteModelsRunningText(int processedCount, int totalCount) => $"Deleting {HumanisedModelName}s ({processedCount} of {totalCount})"; + + protected virtual LocalisableString DeleteModelsCompletedText => $"Deleted all {HumanisedModelName}s!"; + + protected virtual LocalisableString RestoreModelsAbortedText => $"No {HumanisedModelName}s found to restore!"; + + protected virtual LocalisableString RestoreModelsRunningText(int processedCount, int totalCount) => $"Restoring deleted {HumanisedModelName}s ({processedCount} of {totalCount})"; + + protected virtual LocalisableString RestoreModelsCompletedText => $"Restored all deleted {HumanisedModelName}s!"; } } diff --git a/osu.Game/Database/RealmArchiveModelImporter.cs b/osu.Game/Database/RealmArchiveModelImporter.cs index 1836e4ba80ef..38e468f3ee8f 100644 --- a/osu.Game/Database/RealmArchiveModelImporter.cs +++ b/osu.Game/Database/RealmArchiveModelImporter.cs @@ -10,11 +10,13 @@ using Humanizer; using osu.Framework.Extensions; using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Framework.Localisation; using osu.Framework.Logging; using osu.Framework.Platform; using osu.Framework.Threading; using osu.Game.Extensions; using osu.Game.IO.Archives; +using osu.Game.Localisation; using osu.Game.Models; using osu.Game.Overlays.Notifications; using osu.Game.Utils; @@ -100,7 +102,7 @@ public async Task>> Import(ProgressNotification notific { if (tasks.Length == 0) { - notification.CompletionText = $"No {HumanisedModelName}s were found to import!"; + notification.CompletionText = ImportAbortedText; notification.State = ProgressNotificationState.Completed; return Enumerable.Empty>(); } @@ -113,7 +115,7 @@ public async Task>> Import(ProgressNotification notific parameters.Batch |= tasks.Length >= minimum_items_considered_batch_import; - notification.Text = $"{HumanisedModelName.Humanize(LetterCasing.Title)} import is initialising..."; + notification.Text = ImportStartingText; notification.State = ProgressNotificationState.Active; await pauseIfNecessaryAsync(parameters, notification, notification.CancellationToken).ConfigureAwait(false); @@ -136,7 +138,7 @@ await Parallel.ForEachAsync(tasks, notification.CancellationToken, async (task, imported.Add(model); current++; - notification.Text = $"Imported {current} of {tasks.Length} {HumanisedModelName}s"; + notification.Text = ImportRunningText(current, tasks.Length); notification.Progress = (float)current / tasks.Length; } } @@ -165,28 +167,34 @@ await Parallel.ForEachAsync(tasks, notification.CancellationToken, async (task, } else { - notification.Text = $"{HumanisedModelName.Humanize(LetterCasing.Title)} import failed! Check logs for more information."; + notification.Text = ImportFailedText; notification.State = ProgressNotificationState.Cancelled; } } else { + LocalisableString importedText; + if (tasks.Length > imported.Count) - notification.CompletionText = $"Imported {imported.Count} of {tasks.Length} {HumanisedModelName}s."; + importedText = ImportIncompletedText(imported.Count, tasks.Length); else if (imported.Count > 1) - notification.CompletionText = $"Imported {imported.Count} {HumanisedModelName}s!"; + importedText = ImportCompletedText(imported.Count); else - notification.CompletionText = $"Imported {imported.First().GetDisplayString()}!"; + importedText = CommonStrings.Imported(imported.First().GetDisplayString()); if (imported.Count > 0 && PresentImport != null) { - notification.CompletionText += " Click to view."; + notification.CompletionText = LocalisableString.Interpolate($"{importedText} {CommonStrings.ClickToView}"); notification.CompletionClickAction = () => { PresentImport?.Invoke(imported); return true; }; } + else + { + notification.CompletionText = importedText; + } notification.State = ProgressNotificationState.Completed; } @@ -625,7 +633,7 @@ private async Task pauseIfNecessaryAsync(ImportParameters importParameters, Prog // A paused state could obviously be entered mid-import (during the `Task.WhenAll` below), // but in order to keep things simple let's focus on the most common scenario. - notification.Text = $"{HumanisedModelName.Humanize(LetterCasing.Title)} import is paused due to gameplay..."; + notification.Text = ImportPausedText; notification.State = ProgressNotificationState.Queued; while (PauseImports) @@ -637,7 +645,7 @@ private async Task pauseIfNecessaryAsync(ImportParameters importParameters, Prog cancellationToken.ThrowIfCancellationRequested(); Logger.Log($@"{GetType().Name} is being resumed."); - notification.Text = $"{HumanisedModelName.Humanize(LetterCasing.Title)} import is resuming..."; + notification.Text = ImportResumingText; notification.State = ProgressNotificationState.Active; } @@ -654,5 +662,21 @@ private IEnumerable getFilenames(IEnumerable files) } public virtual string HumanisedModelName => $"{typeof(TModel).Name.Replace(@"Info", "").ToLowerInvariant()}"; + + protected virtual LocalisableString ImportAbortedText => $"No {HumanisedModelName}s were found to import!"; + + protected virtual LocalisableString ImportStartingText => $"{HumanisedModelName.Humanize(LetterCasing.Title)} import is initialising..."; + + protected virtual LocalisableString ImportRunningText(int processedCount, int totalCount) => $"Importing {HumanisedModelName}s ({processedCount} of {totalCount})"; + + protected virtual LocalisableString ImportCompletedText(int totalCount) => $"Imported {totalCount} {HumanisedModelName}s!"; + + protected virtual LocalisableString ImportIncompletedText(int processedCount, int totalCount) => $"Imported {processedCount} of {totalCount} {HumanisedModelName}s!"; + + protected virtual LocalisableString ImportFailedText => $"{HumanisedModelName.Humanize(LetterCasing.Title)} import failed! Check logs for more information."; + + protected virtual LocalisableString ImportPausedText => $"{HumanisedModelName.Humanize(LetterCasing.Title)} import is paused due to gameplay..."; + + protected virtual LocalisableString ImportResumingText => $"{HumanisedModelName.Humanize(LetterCasing.Title)} import is resuming..."; } } diff --git a/osu.Game/Localisation/CommonStrings.cs b/osu.Game/Localisation/CommonStrings.cs index d72257f43804..b987b1d9ba58 100644 --- a/osu.Game/Localisation/CommonStrings.cs +++ b/osu.Game/Localisation/CommonStrings.cs @@ -204,6 +204,16 @@ public static class CommonStrings /// public static LocalisableString DeleteWithConfirmation => new TranslatableString(getKey(@"delete_with_confrmation"), @"Delete..."); + /// + /// "Imported {0}!" + /// + public static LocalisableString Imported(string name) => new TranslatableString(getKey(@"imported"), @"Imported {0}!", name); + + /// + /// "Click to view." + /// + public static LocalisableString ClickToView => new TranslatableString(getKey(@"click_to_view"), @"Click to view."); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Localisation/EditorStrings.cs b/osu.Game/Localisation/EditorStrings.cs index d06aa4012c5f..d77f05118316 100644 --- a/osu.Game/Localisation/EditorStrings.cs +++ b/osu.Game/Localisation/EditorStrings.cs @@ -229,6 +229,11 @@ public static class EditorStrings /// public static LocalisableString CheckEntireBeatmapSet => new TranslatableString(getKey(@"check_entire_beatmap_set"), @"Entire beatmap set"); + /// + /// "Saving is not supported for this ruleset yet, sorry!" + /// + public static LocalisableString RulesetNotSupportSaving => new TranslatableString(getKey(@"ruleset_not_support_saving"), @"Saving is not supported for this ruleset yet, sorry!"); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Localisation/MultiplayerMatchStrings.cs b/osu.Game/Localisation/MultiplayerMatchStrings.cs index 8c9e76d722ee..7cf6caf2d340 100644 --- a/osu.Game/Localisation/MultiplayerMatchStrings.cs +++ b/osu.Game/Localisation/MultiplayerMatchStrings.cs @@ -39,6 +39,16 @@ public static class MultiplayerMatchStrings /// public static LocalisableString FreestyleButtonTooltip => new TranslatableString(getKey(@"freestyle_button_tooltip"), @"Each player can choose their preferred difficulty, ruleset and mods."); + /// + /// "Searching for opponents..." + /// + public static LocalisableString SearchingForOpponents => new TranslatableString(getKey(@"searching_for_opponents"), @"Searching for opponents..."); + + /// + /// "Your match is ready! Click to join." + /// + public static LocalisableString MatchIsReady => new TranslatableString(getKey(@"match_is_ready"), @"Your match is ready! Click to join."); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Localisation/NotificationsStrings.cs b/osu.Game/Localisation/NotificationsStrings.cs index a8dac2d25c94..4914cfedb09d 100644 --- a/osu.Game/Localisation/NotificationsStrings.cs +++ b/osu.Game/Localisation/NotificationsStrings.cs @@ -135,6 +135,11 @@ public static class NotificationsStrings /// public static LocalisableString Mention => new TranslatableString(getKey(@"mention"), @"Mention"); + /// + /// "{0} in {1}" + /// + public static LocalisableString MentionDetails(string user, string channelName) => new TranslatableString(getKey(@"mention_details"), @"{0} in {1}", user, channelName); + /// /// "Online: {0}" /// @@ -262,6 +267,386 @@ public static class NotificationsStrings /// public static LocalisableString CollectionBeatmapsAdded(string name, int beatmapsCount) => new TranslatableString(getKey(@"collection_beatmaps_added"), @"Added {0} beatmaps to collection ""{1}"".", beatmapsCount, name); + /// + /// "Reprocessing star rating for beatmaps" + /// + public static LocalisableString ReprocessStarRatingRunning => new TranslatableString(getKey(@"reprocess_star_rating_running"), @"Reprocessing star rating for beatmaps"); + + /// + /// "{0} beatmaps' star ratings have been updated." + /// + public static LocalisableString ReprocessStarRatingCompleted(int processedCount) => new TranslatableString(getKey(@"reprocess_star_rating_completed"), @"{0} beatmaps' star ratings have been updated.", processedCount); + + /// + /// "{0} of {1} beatmaps' star ratings have been updated." + /// + public static LocalisableString ReprocessStarRatingIncompleted(int processedCount, int totalCount) => new TranslatableString(getKey(@"reprocess_star_rating_incompleted"), @"{0} of {1} beatmaps' star ratings have been updated.", processedCount, totalCount); + + /// + /// "Updating online data for beatmaps" + /// + public static LocalisableString UpdateOnlineDataRunning => new TranslatableString(getKey(@"update_online_data_running"), @"Updating online data for beatmaps"); + + /// + /// "{0} beatmaps' online data have been updated." + /// + public static LocalisableString UpdateOnlineDataCompleted(int processedCount) => new TranslatableString(getKey(@"update_online_data_completed"), @"{0} beatmaps' online data have been updated.", processedCount); + + /// + /// "{0} of {1} beatmaps' online data have been updated." + /// + public static LocalisableString UpdateOnlineDataIncompleted(int processedCount, int totalCount) => new TranslatableString(getKey(@"update_online_data_incompleted"), @"{0} of {1} beatmaps' online data have been updated.", processedCount, totalCount); + + /// + /// "Populating missing statistics for beatmaps" + /// + public static LocalisableString PopulateBeatmapsStatsRunning => new TranslatableString(getKey(@"populate_beatmaps_stats_running"), @"Populating missing statistics for beatmaps"); + + /// + /// "{0} beatmaps have been populated with missing statistics." + /// + public static LocalisableString PopulateBeatmapsStatsCompleted(int processedCount) => new TranslatableString(getKey(@"populate_beatmaps_stats_completed"), @"{0} beatmaps have been populated with missing statistics.", processedCount); + + /// + /// "{0} of {1} beatmaps have been populated with missing statistics." + /// + public static LocalisableString PopulateBeatmapsStatsIncompleted(int processedCount, int totalCount) => new TranslatableString(getKey(@"populate_beatmaps_stats_incompleted"), @"{0} of {1} beatmaps have been populated with missing statistics.", processedCount, totalCount); + + /// + /// "Populating missing statistics for scores" + /// + public static LocalisableString PopulateScoresStatsRunning => new TranslatableString(getKey(@"populate_scores_stats_running"), @"Populating missing statistics for scores"); + + /// + /// "{0} scores have been populated with missing statistics." + /// + public static LocalisableString PopulateScoresStatsCompleted(int processedCount) => new TranslatableString(getKey(@"populate_scores_stats_completed"), @"{0} scores have been populated with missing statistics.", processedCount); + + /// + /// "{0} of {1} scores have been populated with missing statistics." + /// + public static LocalisableString PopulateScoresStatsIncompleted(int processedCount, int totalCount) => new TranslatableString(getKey(@"populate_scores_stats_incompleted"), @"{0} of {1} scores have been populated with missing statistics.", processedCount, totalCount); + + /// + /// "Upgrading scores to new scoring algorithm" + /// + public static LocalisableString UpgradeScoringAlgorithmRunning => new TranslatableString(getKey(@"upgrade_scoring_algorithm_running"), @"Upgrading scores to new scoring algorithm"); + + /// + /// "{0} scores have been upgraded to the new scoring algorithm." + /// + public static LocalisableString UpgradeScoringAlgorithmCompleted(int processedCount) => new TranslatableString(getKey(@"upgrade_scoring_algorithm_completed"), @"{0} scores have been upgraded to the new scoring algorithm.", processedCount); + + /// + /// "{0} of {1} scores have been upgraded to the new scoring algorithm." + /// + public static LocalisableString UpgradeScoringAlgorithmIncompleted(int processedCount, int totalCount) => new TranslatableString(getKey(@"upgrade_scoring_algorithm_incompleted"), @"{0} of {1} scores have been upgraded to the new scoring algorithm.", processedCount, totalCount); + + /// + /// "Adjusting ranks of scores" + /// + public static LocalisableString AdjustScoresRanksRunning => new TranslatableString(getKey(@"adjust_scores_ranks_running"), @"Adjusting ranks of scores"); + + /// + /// "{0} scores now have more correct ranks." + /// + public static LocalisableString AdjustScoresRanksCompleted(int processedCount) => new TranslatableString(getKey(@"adjust_scores_ranks_completed"), @"{0} scores now have more correct ranks.", processedCount); + + /// + /// "{0} of {1} scores now have more correct ranks." + /// + public static LocalisableString AdjustScoresRanksIncompleted(int processedCount, int totalCount) => new TranslatableString(getKey(@"adjust_scores_ranks_incompleted"), @"{0} of {1} scores now have more correct ranks.", processedCount, totalCount); + + /// + /// "Populating missing submission and rank dates" + /// + public static LocalisableString PopulateMissingDatesRunning => new TranslatableString(getKey(@"populate_missing_dates_running"), @"Populating missing submission and rank dates"); + + /// + /// "{0} beatmap sets now have correct submission and rank dates." + /// + public static LocalisableString PopulateMissingDatesCompleted(int processedCount) => new TranslatableString(getKey(@"populate_missing_dates_completed"), @"{0} beatmap sets now have correct submission and rank dates.", processedCount); + + /// + /// "{0} of {1} beatmap sets now have correct submission and rank dates." + /// + public static LocalisableString PopulateMissingDatesIncompleted(int processedCount, int totalCount) => new TranslatableString(getKey(@"populate_missing_dates_incompleted"), @"{0} of {1} beatmap sets now have correct submission and rank dates.", processedCount, totalCount); + + /// + /// "Populating missing user tags" + /// + public static LocalisableString PopulateMissingTagsRunning => new TranslatableString(getKey(@"populate_missing_tags_running"), @"Populating missing user tags"); + + /// + /// "{0} beatmaps have had their tags updated." + /// + public static LocalisableString PopulateMissingTagsCompleted(int processedCount) => new TranslatableString(getKey(@"populate_missing_tags_completed"), @"{0} beatmaps have had their tags updated.", processedCount); + + /// + /// "{0} of {1} beatmaps have had their tags updated." + /// + public static LocalisableString PopulateMissingTagsIncompleted(int processedCount, int totalCount) => new TranslatableString(getKey(@"populate_missing_tags_incompleted"), @"{0} of {1} beatmaps have had their tags updated.", processedCount, totalCount); + + /// + /// "({0} of {1})" + /// + public static LocalisableString BackgroundDataStoreProcessorItemsStatus(int processedItems, int totalItems) => new TranslatableString(getKey(@"data_store_processor_items_status"), @"({0} of {1})", processedItems, totalItems); + + /// + /// "Check logs for issues with {0} failed items." + /// + public static LocalisableString BackgroundDataStoreProcessorFailedItems(int failedCount) => new TranslatableString(getKey(@"data_store_processor_failed_items"), @"Check logs for issues with {0} failed items.", failedCount); + + /// + /// "All offsets have been reset!" + /// + public static LocalisableString RestoreBeatmapOffsetsCompleted => new TranslatableString(getKey(@"restore_beatmap_offsets_completed"), @"All offsets have been reset!"); + + /// + /// "No videos found to delete!" + /// + public static LocalisableString DeleteBeatmapVideosAborted => new TranslatableString(getKey(@"delete_beatmap_videos_aborted"), @"No videos found to delete!"); + + /// + /// "Preparing to delete all beatmap videos..." + /// + public static LocalisableString DeleteBeatmapVideosStarting => new TranslatableString(getKey(@"delete_beatmap_videos_starting"), @"Preparing to delete all beatmap videos..."); + + /// + /// "Deleting videos from beatmaps ({0} deleted)" + /// + public static LocalisableString DeleteBeatmapVideosRunning(int deletedCount) => new TranslatableString(getKey(@"delete_beatmap_videos_running"), @"Deleting videos from beatmaps ({0} deleted)", deletedCount); + + /// + /// "Deleted {0} beatmap video(s)!" + /// + public static LocalisableString DeleteBeatmapVideosCompleted(int deletedCount) => new TranslatableString(getKey(@"delete_beatmap_videos_completed"), @"Deleted {0} beatmap video(s)!", deletedCount); + + /// + /// "No beatmaps found to delete!" + /// + public static LocalisableString DeleteBeatmapsAborted => new TranslatableString(getKey(@"delete_beatmaps_aborted"), @"No beatmaps found to delete!"); + + /// + /// "Preparing to delete all beatmaps..." + /// + public static LocalisableString DeleteBeatmapsStarting => new TranslatableString(getKey(@"delete_beatmaps_starting"), @"Preparing to delete all beatmaps..."); + + /// + /// "Deleting beatmaps ({0} of {1})" + /// + public static LocalisableString DeleteBeatmapsRunning(int processedCount, int totalCount) => new TranslatableString(getKey(@"delete_beatmaps_running"), @"Deleting beatmaps ({0} of {1})", processedCount, totalCount); + + /// + /// "Deleted all beatmaps!" + /// + public static LocalisableString DeleteBeatmapsCompleted => new TranslatableString(getKey(@"delete_beatmaps_completed"), @"Deleted all beatmaps!"); + + /// + /// "No beatmaps found to restore!" + /// + public static LocalisableString RestoreBeatmapsAborted => new TranslatableString(getKey(@"restore_beatmaps_aborted"), @"No beatmaps found to restore!"); + + /// + /// "Restoring deleted beatmaps ({0} of {1})" + /// + public static LocalisableString RestoreBeatmapsRunning(int processedCount, int totalCount) => new TranslatableString(getKey(@"restore_beatmaps_running"), @"Restoring deleted beatmaps ({0} of {1})", processedCount, totalCount); + + /// + /// "Restored all deleted beatmaps!" + /// + public static LocalisableString RestoreBeatmapsCompleted => new TranslatableString(getKey(@"restore_beatmaps_completed"), @"Restored all deleted beatmaps!"); + + /// + /// "No scores found to delete!" + /// + public static LocalisableString DeleteScoresAborted => new TranslatableString(getKey(@"delete_scores_aborted"), @"No scores found to delete!"); + + /// + /// "Preparing to delete all scores..." + /// + public static LocalisableString DeleteScoresStarting => new TranslatableString(getKey(@"delete_scores_starting"), @"Preparing to delete all scores..."); + + /// + /// "Deleting scores ({0} of {1})" + /// + public static LocalisableString DeleteScoresRunning(int processedCount, int totalCount) => new TranslatableString(getKey(@"delete_scores_running"), @"Deleting scores ({0} of {1})", processedCount, totalCount); + + /// + /// "Deleted all scores!" + /// + public static LocalisableString DeleteScoresCompleted => new TranslatableString(getKey(@"delete_scores_completed"), @"Deleted all scores!"); + + /// + /// "No scores found to restore!" + /// + public static LocalisableString RestoreScoresAborted => new TranslatableString(getKey(@"restore_scores_aborted"), @"No scores found to restore!"); + + /// + /// "Restoring deleted scores ({0} of {1})" + /// + public static LocalisableString RestoreScoresRunning(int processedCount, int totalCount) => new TranslatableString(getKey(@"restore_scores_running"), @"Restoring deleted scores ({0} of {1})", processedCount, totalCount); + + /// + /// "Restored all deleted scores!" + /// + public static LocalisableString RestoreScoresCompleted => new TranslatableString(getKey(@"restore_scores_completed"), @"Restored all deleted scores!"); + + /// + /// "No skins found to delete!" + /// + public static LocalisableString DeleteSkinsAborted => new TranslatableString(getKey(@"delete_skins_aborted"), @"No skins found to delete!"); + + /// + /// "Preparing to delete all skins..." + /// + public static LocalisableString DeleteSkinsStarting => new TranslatableString(getKey(@"delete_skins_starting"), @"Preparing to delete all skins..."); + + /// + /// "Deleting skins ({0} of {1})" + /// + public static LocalisableString DeleteSkinsRunning(int processedCount, int totalCount) => new TranslatableString(getKey(@"delete_skins_running"), @"Deleting skins ({0} of {1})", processedCount, totalCount); + + /// + /// "Deleted all skins!" + /// + public static LocalisableString DeleteSkinsCompleted => new TranslatableString(getKey(@"delete_skins_completed"), @"Deleted all skins!"); + + /// + /// "No skins found to restore!" + /// + public static LocalisableString RestoreSkinsAborted => new TranslatableString(getKey(@"restore_skins_aborted"), @"No skins found to restore!"); + + /// + /// "Restoring deleted skins ({0} of {1})" + /// + public static LocalisableString RestoreSkinsRunning(int processedCount, int totalCount) => new TranslatableString(getKey(@"restore_skins_running"), @"Restoring deleted skins ({0} of {1})", processedCount, totalCount); + + /// + /// "Restored all deleted skins!" + /// + public static LocalisableString RestoreSkinsCompleted => new TranslatableString(getKey(@"restore_skins_completed"), @"Restored all deleted skins!"); + + /// + /// "No beatmaps were found to import!" + /// + public static LocalisableString ImportBeatmapsAborted => new TranslatableString(getKey(@"import_beatmaps_aborted"), @"No beatmaps were found to import!"); + + /// + /// "Beatmap import is initialising..." + /// + public static LocalisableString ImportBeatmapsStarting => new TranslatableString(getKey(@"import_beatmaps_starting"), @"Beatmap import is initialising..."); + + /// + /// "Importing beatmaps ({0} of {1})" + /// + public static LocalisableString ImportBeatmapsRunning(int processedCount, int totalCount) => new TranslatableString(getKey(@"import_beatmaps_running"), @"Importing beatmaps ({0} of {1})", processedCount, totalCount); + + /// + /// "Imported {0} beatmaps!" + /// + public static LocalisableString ImportBeatmapsCompleted(int totalCount) => new TranslatableString(getKey(@"import_beatmaps_completed"), @"Imported {0} beatmaps!", totalCount); + + /// + /// "Imported {0} of {1} beatmaps!" + /// + public static LocalisableString ImportBeatmapsIncompleted(int processedCount, int totalCount) => new TranslatableString(getKey(@"import_beatmaps_incompleted"), @"Imported {0} of {1} beatmaps!", processedCount, totalCount); + + /// + /// "Beatmap import failed! Check logs for more information." + /// + public static LocalisableString ImportBeatmapsFailed => new TranslatableString(getKey(@"import_beatmaps_failed"), @"Beatmap import failed! Check logs for more information."); + + /// + /// "Beatmap import is paused due to gameplay..." + /// + public static LocalisableString ImportBeatmapsPaused => new TranslatableString(getKey(@"import_beatmaps_paused"), @"Beatmap import is paused due to gameplay..."); + + /// + /// "Beatmap import is resuming..." + /// + public static LocalisableString ImportBeatmapsResuming => new TranslatableString(getKey(@"import_beatmaps_resuming"), @"Beatmap import is resuming..."); + + /// + /// "No scores were found to import!" + /// + public static LocalisableString ImportScoresAborted => new TranslatableString(getKey(@"import_scores_aborted"), @"No scores were found to import!"); + + /// + /// "Score import is initialising..." + /// + public static LocalisableString ImportScoresStarting => new TranslatableString(getKey(@"import_scores_starting"), @"Score import is initialising..."); + + /// + /// "Importing scores ({0} of {1})" + /// + public static LocalisableString ImportScoresRunning(int processedCount, int totalCount) => new TranslatableString(getKey(@"import_scores_running"), @"Importing scores ({0} of {1})", processedCount, totalCount); + + /// + /// "Imported {0} scores!" + /// + public static LocalisableString ImportScoresCompleted(int totalCount) => new TranslatableString(getKey(@"import_scores_completed"), @"Imported {0} scores!", totalCount); + + /// + /// "Imported {0} of {1} scores!" + /// + public static LocalisableString ImportScoresIncompleted(int processedCount, int totalCount) => new TranslatableString(getKey(@"import_scores_incompleted"), @"Imported {0} of {1} scores!", processedCount, totalCount); + + /// + /// "Score import failed! Check logs for more information." + /// + public static LocalisableString ImportScoresFailed => new TranslatableString(getKey(@"import_scores_failed"), @"Score import failed! Check logs for more information."); + + /// + /// "Score import is paused due to gameplay..." + /// + public static LocalisableString ImportScoresPaused => new TranslatableString(getKey(@"import_scores_paused"), @"Score import is paused due to gameplay..."); + + /// + /// "Score import is resuming..." + /// + public static LocalisableString ImportScoresResuming => new TranslatableString(getKey(@"import_scores_resuming"), @"Score import is resuming..."); + + /// + /// "No skins were found to import!" + /// + public static LocalisableString ImportSkinsAborted => new TranslatableString(getKey(@"import_skins_aborted"), @"No skins were found to import!"); + + /// + /// "Skin import is initialising..." + /// + public static LocalisableString ImportSkinsStarting => new TranslatableString(getKey(@"import_skins_starting"), @"Skin import is initialising..."); + + /// + /// "Importing skins ({0} of {1})" + /// + public static LocalisableString ImportSkinsRunning(int processedCount, int totalCount) => new TranslatableString(getKey(@"import_skins_running"), @"Importing skins ({0} of {1})", processedCount, totalCount); + + /// + /// "Imported {0} skins!" + /// + public static LocalisableString ImportSkinsCompleted(int totalCount) => new TranslatableString(getKey(@"import_skins_completed"), @"Imported {0} skins!", totalCount); + + /// + /// "Imported {0} of {1} skins!" + /// + public static LocalisableString ImportSkinsIncompleted(int processedCount, int totalCount) => new TranslatableString(getKey(@"import_skins_incompleted"), @"Imported {0} of {1} skins!", processedCount, totalCount); + + /// + /// "Skin import failed! Check logs for more information." + /// + public static LocalisableString ImportSkinsFailed => new TranslatableString(getKey(@"import_skins_failed"), @"Skin import failed! Check logs for more information."); + + /// + /// "Skin import is paused due to gameplay..." + /// + public static LocalisableString ImportSkinsPaused => new TranslatableString(getKey(@"import_skins_paused"), @"Skin import is paused due to gameplay..."); + + /// + /// "Skin import is resuming..." + /// + public static LocalisableString ImportSkinsResuming => new TranslatableString(getKey(@"import_skins_resuming"), @"Skin import is resuming..."); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Online/Chat/MessageNotifier.cs b/osu.Game/Online/Chat/MessageNotifier.cs index 4e17a5e28a6f..0d3072b9e321 100644 --- a/osu.Game/Online/Chat/MessageNotifier.cs +++ b/osu.Game/Online/Chat/MessageNotifier.cs @@ -218,7 +218,7 @@ private void load(ChatOverlay chatOverlay, INotificationOverlay notificationOver { TextFlow.AddText(Localisation.NotificationsStrings.Mention.ToUpper(), s => s.Font = OsuFont.Style.Caption2.With(weight: FontWeight.Bold)); TextFlow.NewLine(); - TextFlow.AddText($"{message.Sender.Username} in {channel.Name}", s => + TextFlow.AddText(Localisation.NotificationsStrings.MentionDetails(message.Sender.Username, channel.Name), s => { s.Font = OsuFont.Style.Caption2.With(weight: FontWeight.SemiBold); s.Colour = colourProvider.Content2; diff --git a/osu.Game/Scoring/ScoreImporter.cs b/osu.Game/Scoring/ScoreImporter.cs index 55b172526f5c..7e14c89e7bc9 100644 --- a/osu.Game/Scoring/ScoreImporter.cs +++ b/osu.Game/Scoring/ScoreImporter.cs @@ -7,11 +7,13 @@ using System.Linq; using System.Threading; using Newtonsoft.Json; +using osu.Framework.Localisation; using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Database; using osu.Game.IO.Archives; +using osu.Game.Localisation; using osu.Game.Rulesets; using osu.Game.Scoring.Legacy; using osu.Game.Online.API; @@ -212,5 +214,21 @@ private void populateUserDetails(ScoreInfo model) return null; } + + protected override LocalisableString ImportAbortedText => NotificationsStrings.ImportScoresAborted; + + protected override LocalisableString ImportStartingText => NotificationsStrings.ImportScoresStarting; + + protected override LocalisableString ImportRunningText(int processedCount, int totalCount) => NotificationsStrings.ImportScoresRunning(processedCount, totalCount); + + protected override LocalisableString ImportCompletedText(int totalCount) => NotificationsStrings.ImportScoresCompleted(totalCount); + + protected override LocalisableString ImportIncompletedText(int processedCount, int totalCount) => NotificationsStrings.ImportScoresIncompleted(processedCount, totalCount); + + protected override LocalisableString ImportFailedText => NotificationsStrings.ImportScoresFailed; + + protected override LocalisableString ImportPausedText => NotificationsStrings.ImportScoresPaused; + + protected override LocalisableString ImportResumingText => NotificationsStrings.ImportScoresResuming; } } diff --git a/osu.Game/Scoring/ScoreManager.cs b/osu.Game/Scoring/ScoreManager.cs index 317787318229..fc67784a527e 100644 --- a/osu.Game/Scoring/ScoreManager.cs +++ b/osu.Game/Scoring/ScoreManager.cs @@ -9,12 +9,14 @@ using System.Threading; using System.Threading.Tasks; using osu.Framework.Bindables; +using osu.Framework.Localisation; using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Configuration; using osu.Game.Database; using osu.Game.IO.Archives; +using osu.Game.Localisation; using osu.Game.Online.API; using osu.Game.Overlays.Notifications; using osu.Game.Rulesets; @@ -243,5 +245,19 @@ public Action>>? PresentImport } #endregion + + protected override LocalisableString DeleteModelsAbortedText => NotificationsStrings.DeleteScoresAborted; + + protected override LocalisableString DeleteModelsStartingText => NotificationsStrings.DeleteScoresStarting; + + protected override LocalisableString DeleteModelsRunningText(int processedCount, int totalCount) => NotificationsStrings.DeleteScoresRunning(processedCount, totalCount); + + protected override LocalisableString DeleteModelsCompletedText => NotificationsStrings.DeleteScoresCompleted; + + protected override LocalisableString RestoreModelsAbortedText => NotificationsStrings.RestoreScoresAborted; + + protected override LocalisableString RestoreModelsRunningText(int processedCount, int totalCount) => NotificationsStrings.RestoreScoresRunning(processedCount, totalCount); + + protected override LocalisableString RestoreModelsCompletedText => NotificationsStrings.RestoreScoresCompleted; } } diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 164d02d869d9..488f66322bce 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -582,7 +582,7 @@ internal bool Save() { if (!canSave) { - notifications?.Post(new SimpleErrorNotification { Text = "Saving is not supported for this ruleset yet, sorry!" }); + notifications?.Post(new SimpleErrorNotification { Text = EditorStrings.RulesetNotSupportSaving }); return false; } diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/QueueController.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/QueueController.cs index 02e944df9f93..82ae16a3aa5c 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/QueueController.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/QueueController.cs @@ -12,6 +12,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Screens; using osu.Game.Graphics; +using osu.Game.Localisation; using osu.Game.Online.Matchmaking; using osu.Game.Online.Multiplayer; using osu.Game.Online.Rooms; @@ -203,7 +204,7 @@ public BackgroundQueueNotification(QueueController controller, MatchmakingPoolTy [BackgroundDependencyLoader] private void load(AudioManager audio) { - Text = "Searching for opponents..."; + Text = MultiplayerMatchStrings.SearchingForOpponents; Activated = () => { @@ -255,7 +256,7 @@ protected override Notification CreateCompletionNotification() return foundNotification = new MatchFoundNotification { Activated = CompletionClickAction, - Text = "Your match is ready! Click to join.", + Text = MultiplayerMatchStrings.MatchIsReady, }; } diff --git a/osu.Game/Skinning/SkinImporter.cs b/osu.Game/Skinning/SkinImporter.cs index 6290e3439a2f..02d1ba154bb6 100644 --- a/osu.Game/Skinning/SkinImporter.cs +++ b/osu.Game/Skinning/SkinImporter.cs @@ -9,12 +9,14 @@ using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json; +using osu.Framework.Localisation; using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Database; using osu.Game.Extensions; using osu.Game.IO; using osu.Game.IO.Archives; +using osu.Game.Localisation; using osu.Game.Overlays.Notifications; using Realms; @@ -280,5 +282,21 @@ public bool Save(Skin skin) return hadChanges; } + + protected override LocalisableString ImportAbortedText => NotificationsStrings.ImportSkinsAborted; + + protected override LocalisableString ImportStartingText => NotificationsStrings.ImportSkinsStarting; + + protected override LocalisableString ImportRunningText(int processedCount, int totalCount) => NotificationsStrings.ImportSkinsRunning(processedCount, totalCount); + + protected override LocalisableString ImportCompletedText(int totalCount) => NotificationsStrings.ImportSkinsCompleted(totalCount); + + protected override LocalisableString ImportIncompletedText(int processedCount, int totalCount) => NotificationsStrings.ImportSkinsIncompleted(processedCount, totalCount); + + protected override LocalisableString ImportFailedText => NotificationsStrings.ImportSkinsFailed; + + protected override LocalisableString ImportPausedText => NotificationsStrings.ImportSkinsPaused; + + protected override LocalisableString ImportResumingText => NotificationsStrings.ImportSkinsResuming; } } diff --git a/osu.Game/Skinning/SkinManager.cs b/osu.Game/Skinning/SkinManager.cs index e62b2a150c83..1188e0fffeb5 100644 --- a/osu.Game/Skinning/SkinManager.cs +++ b/osu.Game/Skinning/SkinManager.cs @@ -18,12 +18,14 @@ using osu.Framework.Graphics.Rendering; using osu.Framework.Graphics.Textures; using osu.Framework.IO.Stores; +using osu.Framework.Localisation; using osu.Framework.Platform; using osu.Framework.Threading; using osu.Framework.Utils; using osu.Game.Audio; using osu.Game.Database; using osu.Game.IO; +using osu.Game.Localisation; using osu.Game.Overlays.Notifications; using osu.Game.Utils; @@ -452,5 +454,19 @@ public void SetSkinFromConfiguration(string guidString) CurrentSkinInfo.Value = skinInfo ?? trianglesSkin.SkinInfo; } + + protected override LocalisableString DeleteModelsAbortedText => NotificationsStrings.DeleteSkinsAborted; + + protected override LocalisableString DeleteModelsStartingText => NotificationsStrings.DeleteSkinsCompleted; + + protected override LocalisableString DeleteModelsRunningText(int processedCount, int totalCount) => NotificationsStrings.DeleteSkinsRunning(processedCount, totalCount); + + protected override LocalisableString DeleteModelsCompletedText => NotificationsStrings.DeleteSkinsCompleted; + + protected override LocalisableString RestoreModelsAbortedText => NotificationsStrings.RestoreSkinsAborted; + + protected override LocalisableString RestoreModelsRunningText(int processedCount, int totalCount) => NotificationsStrings.RestoreSkinsRunning(processedCount, totalCount); + + protected override LocalisableString RestoreModelsCompletedText => NotificationsStrings.RestoreSkinsCompleted; } }