From e2dd4d86b4a79232aa0c1c8e8c520dc4be7ec94d Mon Sep 17 00:00:00 2001 From: Denis Titovets Date: Thu, 22 Jan 2026 12:18:02 +0300 Subject: [PATCH] Add localisation support for `PlaylistsSongSelectV2` (#36410) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit | master | pr | |-|-| | osu_2026-01-20_18-16-38 — копия | osu_2026-01-20_18-12-45 — копия | | osu_2026-01-20_18-16-38 | osu_2026-01-20_18-12-45 | --- .../Localisation/ModSelectOverlayStrings.cs | 5 ++++ osu.Game/Localisation/OnlinePlayStrings.cs | 25 +++++++++++++++++++ .../OnlinePlay/FooterButtonFreeModsV2.cs | 4 +-- .../OnlinePlay/FooterButtonFreestyleV2.cs | 3 ++- .../Playlists/AddToPlaylistFooterButton.cs | 3 ++- .../PlaylistsSongSelectV2.PlaylistTray.cs | 5 ++-- 6 files changed, 39 insertions(+), 6 deletions(-) diff --git a/osu.Game/Localisation/ModSelectOverlayStrings.cs b/osu.Game/Localisation/ModSelectOverlayStrings.cs index 10037d30c3..5572000c99 100644 --- a/osu.Game/Localisation/ModSelectOverlayStrings.cs +++ b/osu.Game/Localisation/ModSelectOverlayStrings.cs @@ -19,6 +19,11 @@ namespace osu.Game.Localisation /// public static LocalisableString Mods(int count) => new TranslatableString(getKey(@"mods"), @"{0} mods", count); + /// + /// "all mods" + /// + public static LocalisableString AllMods => new TranslatableString(getKey(@"all_mods"), @"all mods"); + /// /// "Mods provide different ways to enjoy gameplay. Some have an effect on the score you can achieve during ranked play. Others are just for fun." /// diff --git a/osu.Game/Localisation/OnlinePlayStrings.cs b/osu.Game/Localisation/OnlinePlayStrings.cs index 1918519d36..32ef5d66fc 100644 --- a/osu.Game/Localisation/OnlinePlayStrings.cs +++ b/osu.Game/Localisation/OnlinePlayStrings.cs @@ -24,6 +24,31 @@ namespace osu.Game.Localisation /// public static LocalisableString InviteFailedUserOptOut => new TranslatableString(getKey(@"cant_invite_this_user_as1"), @"Can't invite this user as they have opted out of non-friend communications."); + /// + /// "Add to playlist" + /// + public static LocalisableString FooterButtonPlaylistAdd => new TranslatableString(getKey(@"footer_button_playlist_add"), @"Add to playlist"); + + /// + /// "Freemods" + /// + public static LocalisableString FooterButtonFreemods => new TranslatableString(getKey(@"footer_button_freemods"), @"Freemods"); + + /// + /// "Freestyle" + /// + public static LocalisableString FooterButtonFreestyle => new TranslatableString(getKey(@"footer_button_freestyle"), @"Freestyle"); + + /// + /// "{0} item(s)" + /// + public static LocalisableString PlaylistTrayItems(int count) => new TranslatableString(getKey(@"playlist_tray_items"), @"{0} item(s)", count); + + /// + /// "Manage items on previous screen" + /// + public static LocalisableString PlaylistTrayDescription => new TranslatableString(getKey(@"playlist_tray_description"), @"Manage items on previous screen"); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Screens/OnlinePlay/FooterButtonFreeModsV2.cs b/osu.Game/Screens/OnlinePlay/FooterButtonFreeModsV2.cs index 84c9334b45..f2ed75aed7 100644 --- a/osu.Game/Screens/OnlinePlay/FooterButtonFreeModsV2.cs +++ b/osu.Game/Screens/OnlinePlay/FooterButtonFreeModsV2.cs @@ -54,7 +54,7 @@ namespace osu.Game.Screens.OnlinePlay [BackgroundDependencyLoader] private void load() { - Text = "Freemods"; + Text = OnlinePlayStrings.FooterButtonFreemods; Icon = FontAwesome.Solid.ExchangeAlt; AccentColour = colours.Lime1; @@ -181,7 +181,7 @@ namespace osu.Game.Screens.OnlinePlay private void updateText() { if (Freestyle.Value) - text.Text = "ALL MODS"; + text.Text = ModSelectOverlayStrings.AllMods.ToUpper(); else text.Text = ModSelectOverlayStrings.Mods(Mods.Value.Count).ToUpper(); } diff --git a/osu.Game/Screens/OnlinePlay/FooterButtonFreestyleV2.cs b/osu.Game/Screens/OnlinePlay/FooterButtonFreestyleV2.cs index 5178073632..e7e33855ac 100644 --- a/osu.Game/Screens/OnlinePlay/FooterButtonFreestyleV2.cs +++ b/osu.Game/Screens/OnlinePlay/FooterButtonFreestyleV2.cs @@ -7,6 +7,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; +using osu.Game.Localisation; using osu.Game.Screens.Footer; namespace osu.Game.Screens.OnlinePlay @@ -32,7 +33,7 @@ namespace osu.Game.Screens.OnlinePlay [BackgroundDependencyLoader] private void load() { - Text = "Freestyle"; + Text = OnlinePlayStrings.FooterButtonFreestyle; Icon = FontAwesome.Solid.ExchangeAlt; AccentColour = colours.Lime1; } diff --git a/osu.Game/Screens/OnlinePlay/Playlists/AddToPlaylistFooterButton.cs b/osu.Game/Screens/OnlinePlay/Playlists/AddToPlaylistFooterButton.cs index 1815bd9dcb..1d8dcf37ab 100644 --- a/osu.Game/Screens/OnlinePlay/Playlists/AddToPlaylistFooterButton.cs +++ b/osu.Game/Screens/OnlinePlay/Playlists/AddToPlaylistFooterButton.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Transforms; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; +using osu.Game.Localisation; namespace osu.Game.Screens.OnlinePlay.Playlists { @@ -31,7 +32,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists Origin = Anchor.Centre, X = -10, Font = OsuFont.TorusAlternate.With(size: 17), - Text = "Add to playlist", + Text = OnlinePlayStrings.FooterButtonPlaylistAdd, UseFullGlyphHeight = false, }, new OsuSpriteText diff --git a/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsSongSelectV2.PlaylistTray.cs b/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsSongSelectV2.PlaylistTray.cs index f634daf481..10c6ee6ef9 100644 --- a/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsSongSelectV2.PlaylistTray.cs +++ b/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsSongSelectV2.PlaylistTray.cs @@ -12,6 +12,7 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; +using osu.Game.Localisation; using osu.Game.Online.Rooms; using osu.Game.Overlays; using osuTK; @@ -92,7 +93,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists { Y = 20, Font = OsuFont.Style.Caption2, - Text = "Manage items on previous screen" + Text = OnlinePlayStrings.PlaylistTrayDescription }, } }, @@ -166,7 +167,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists scroll.ScrollToStart(animated: false); ScheduleAfterChildren(() => scroll.ScrollToEnd()); - Scheduler.AddDelayed(() => text.Text = $"{room.Playlist.Count} item(s)", 100); + Scheduler.AddDelayed(() => text.Text = OnlinePlayStrings.PlaylistTrayItems(room.Playlist.Count), 100); } this.FadeIn(200)