diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index ea3326d294b8..fff9336d3f7e 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -20,6 +20,7 @@ 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 +373,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 +383,7 @@ public void ResetAllOffsets() beatmap.UserSettings.Offset = 0; } - PostNotification?.Invoke(new ProgressCompletionNotification { Text = reset_complete_message }); + PostNotification?.Invoke(new ProgressCompletionNotification { Text = MaintenanceSettingsStrings.AllOffsetsReset }); }); } @@ -435,12 +435,10 @@ 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 = MaintenanceSettingsStrings.NoVideosFoundToDelete }); return; } @@ -448,7 +446,7 @@ public void DeleteVideos(List items, bool silent = false) { Progress = 0, Text = $"Preparing to delete all {HumanisedModelName} videos...", - CompletionText = no_videos_message, + CompletionText = MaintenanceSettingsStrings.NoVideosFoundToDelete, State = ProgressNotificationState.Active, }; 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/MaintenanceSettingsStrings.cs b/osu.Game/Localisation/MaintenanceSettingsStrings.cs index daf27c6ea2a2..17552fd19b90 100644 --- a/osu.Game/Localisation/MaintenanceSettingsStrings.cs +++ b/osu.Game/Localisation/MaintenanceSettingsStrings.cs @@ -129,6 +129,16 @@ public static class MaintenanceSettingsStrings /// public static LocalisableString StableDirectorySelectHeader => new TranslatableString(getKey(@"stable_directory_select_header"), @"Please select your osu!stable install location"); + /// + /// "All offsets have been reset!" + /// + public static LocalisableString AllOffsetsReset => new TranslatableString(getKey(@"all_offsets_reset"), @"All offsets have been reset!"); + + /// + /// "No videos found to delete!" + /// + public static LocalisableString NoVideosFoundToDelete => new TranslatableString(getKey(@"no_videos_found_to_delete"), @"No videos found to delete!"); + 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 59237111a306..2253e6effa19 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}" /// 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/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index dadb66ebf379..4bd77b363b3e 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -580,7 +580,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, }; }