Add localisation support for PlaylistsSongSelectV2 (#36410)

| master | pr |
|-|-|
| <img width="691" height="84" alt="osu_2026-01-20_18-16-38 — копия"
src="https://github.com/user-attachments/assets/24e24131-525b-4603-b6f7-dbdd6e8be188"
/> | <img width="694" height="76" alt="osu_2026-01-20_18-12-45 — копия"
src="https://github.com/user-attachments/assets/d880b9c8-8a69-494e-863f-170f904a71b2"
/> |
| <img width="581" height="191" alt="osu_2026-01-20_18-16-38"
src="https://github.com/user-attachments/assets/01256367-3275-40c3-9da2-0073e4e33a1d"
/> | <img width="570" height="184" alt="osu_2026-01-20_18-12-45"
src="https://github.com/user-attachments/assets/a9b2ce0a-b571-4f94-bf0e-7869bd32e6ae"
/> |
This commit is contained in:
Denis Titovets
2026-01-22 12:18:02 +03:00
committed by GitHub
parent f0e7817dda
commit e2dd4d86b4
6 changed files with 39 additions and 6 deletions

View File

@@ -19,6 +19,11 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString Mods(int count) => new TranslatableString(getKey(@"mods"), @"{0} mods", count);
/// <summary>
/// "all mods"
/// </summary>
public static LocalisableString AllMods => new TranslatableString(getKey(@"all_mods"), @"all mods");
/// <summary>
/// "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."
/// </summary>

View File

@@ -24,6 +24,31 @@ namespace osu.Game.Localisation
/// </summary>
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.");
/// <summary>
/// "Add to playlist"
/// </summary>
public static LocalisableString FooterButtonPlaylistAdd => new TranslatableString(getKey(@"footer_button_playlist_add"), @"Add to playlist");
/// <summary>
/// "Freemods"
/// </summary>
public static LocalisableString FooterButtonFreemods => new TranslatableString(getKey(@"footer_button_freemods"), @"Freemods");
/// <summary>
/// "Freestyle"
/// </summary>
public static LocalisableString FooterButtonFreestyle => new TranslatableString(getKey(@"footer_button_freestyle"), @"Freestyle");
/// <summary>
/// "{0} item(s)"
/// </summary>
public static LocalisableString PlaylistTrayItems(int count) => new TranslatableString(getKey(@"playlist_tray_items"), @"{0} item(s)", count);
/// <summary>
/// "Manage items on previous screen"
/// </summary>
public static LocalisableString PlaylistTrayDescription => new TranslatableString(getKey(@"playlist_tray_description"), @"Manage items on previous screen");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@@ -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();
}

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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)