1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-13 20:33:35 +08:00

Add localisation support for some more notifications (#37237)

- part of https://github.com/ppy/osu/pull/36994

changes can be reviewed commit by commit
This commit is contained in:
Denis Titovets
2026-04-24 06:39:55 +03:00
committed by GitHub
Unverified
parent 88f0be8b22
commit 0fa7824a23
8 changed files with 39 additions and 10 deletions
+4 -6
View File
@@ -20,6 +20,7 @@ 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 +373,6 @@ namespace osu.Game.Beatmaps
public void ResetAllOffsets()
{
const string reset_complete_message = "All offsets have been reset!";
Realm.Write(r =>
{
var items = r.All<BeatmapInfo>();
@@ -383,7 +383,7 @@ namespace osu.Game.Beatmaps
beatmap.UserSettings.Offset = 0;
}
PostNotification?.Invoke(new ProgressCompletionNotification { Text = reset_complete_message });
PostNotification?.Invoke(new ProgressCompletionNotification { Text = MaintenanceSettingsStrings.AllOffsetsReset });
});
}
@@ -435,12 +435,10 @@ namespace osu.Game.Beatmaps
/// </summary>
public void DeleteVideos(List<BeatmapSetInfo> 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 @@ namespace osu.Game.Beatmaps
{
Progress = 0,
Text = $"Preparing to delete all {HumanisedModelName} videos...",
CompletionText = no_videos_message,
CompletionText = MaintenanceSettingsStrings.NoVideosFoundToDelete,
State = ProgressNotificationState.Active,
};
+5
View File
@@ -229,6 +229,11 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString CheckEntireBeatmapSet => new TranslatableString(getKey(@"check_entire_beatmap_set"), @"Entire beatmap set");
/// <summary>
/// "Saving is not supported for this ruleset yet, sorry!"
/// </summary>
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}";
}
}
@@ -129,6 +129,16 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString StableDirectorySelectHeader => new TranslatableString(getKey(@"stable_directory_select_header"), @"Please select your osu!stable install location");
/// <summary>
/// "All offsets have been reset!"
/// </summary>
public static LocalisableString AllOffsetsReset => new TranslatableString(getKey(@"all_offsets_reset"), @"All offsets have been reset!");
/// <summary>
/// "No videos found to delete!"
/// </summary>
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}";
}
}
@@ -39,6 +39,16 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString FreestyleButtonTooltip => new TranslatableString(getKey(@"freestyle_button_tooltip"), @"Each player can choose their preferred difficulty, ruleset and mods.");
/// <summary>
/// "Searching for opponents..."
/// </summary>
public static LocalisableString SearchingForOpponents => new TranslatableString(getKey(@"searching_for_opponents"), @"Searching for opponents...");
/// <summary>
/// "Your match is ready! Click to join."
/// </summary>
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}";
}
}
@@ -135,6 +135,11 @@ Click to see what's new!", version);
/// </summary>
public static LocalisableString Mention => new TranslatableString(getKey(@"mention"), @"Mention");
/// <summary>
/// "{0} in {1}"
/// </summary>
public static LocalisableString MentionDetails(string user, string channelName) => new TranslatableString(getKey(@"mention_details"), @"{0} in {1}", user, channelName);
/// <summary>
/// "Online: {0}"
/// </summary>
+1 -1
View File
@@ -218,7 +218,7 @@ namespace osu.Game.Online.Chat
{
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;
+1 -1
View File
@@ -580,7 +580,7 @@ namespace osu.Game.Screens.Edit
{
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;
}
@@ -12,6 +12,7 @@ using osu.Framework.Graphics.Colour;
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;
@@ -201,7 +202,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue
[BackgroundDependencyLoader]
private void load(AudioManager audio)
{
Text = "Searching for opponents...";
Text = MultiplayerMatchStrings.SearchingForOpponents;
Activated = () =>
{
@@ -253,7 +254,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue
return foundNotification = new MatchFoundNotification
{
Activated = CompletionClickAction,
Text = "Your match is ready! Click to join.",
Text = MultiplayerMatchStrings.MatchIsReady,
};
}