From 28a18f768c16fe8a94d2581975b98ed3382a9006 Mon Sep 17 00:00:00 2001 From: Denis Titovets Date: Thu, 5 Mar 2026 07:40:31 +0300 Subject: [PATCH] Use web localisation on `LeaderboardScopeSelector` to match `osu-web` (#36814) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - regressed in https://github.com/ppy/osu/commit/1f052bb195bfc5a2681b1b324bf34764641a1c40 - also see https://github.com/ppy/osu/pull/34074#discussion_r2211853662 did it by analogy with https://github.com/ppy/osu/blob/a0ecbd7c8704d6beee3e5c54c2ccb5f735872fb0/osu.Game/Overlays/BeatmapSet/Scores/NoScoresPlaceholder.cs#L27-L49 | master | pr | `osu-web` | |-|-|-| | osu_2026-03-04_18-26-44 | ![osu_2026-03-04_18-36-12](https://github.com/user-attachments/assets/1498c4a9-7188-4e97-a6bd-3553b9befa5e) | Снимок экрана 2026-03-04 182558 | --------- Co-authored-by: Dean Herbert --- .../BeatmapSet/LeaderboardScopeSelector.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/osu.Game/Overlays/BeatmapSet/LeaderboardScopeSelector.cs b/osu.Game/Overlays/BeatmapSet/LeaderboardScopeSelector.cs index ed00f4b0e2..55dfa52143 100644 --- a/osu.Game/Overlays/BeatmapSet/LeaderboardScopeSelector.cs +++ b/osu.Game/Overlays/BeatmapSet/LeaderboardScopeSelector.cs @@ -1,12 +1,15 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Game.Graphics.UserInterface; using osu.Framework.Allocation; using osuTK.Graphics; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input.Events; using osu.Framework.Graphics; +using osu.Framework.Localisation; +using osu.Game.Resources.Localisation.Web; using osu.Game.Screens.Play.Leaderboards; namespace osu.Game.Overlays.BeatmapSet @@ -39,6 +42,27 @@ namespace osu.Game.Overlays.BeatmapSet { } + protected override LocalisableString CreateText() + { + switch (Value) + { + case BeatmapLeaderboardScope.Global: + return BeatmapsetsStrings.ShowScoreboardGlobal; + + case BeatmapLeaderboardScope.Country: + return BeatmapsetsStrings.ShowScoreboardCountry; + + case BeatmapLeaderboardScope.Friend: + return BeatmapsetsStrings.ShowScoreboardFriend; + + case BeatmapLeaderboardScope.Team: + return BeatmapsetsStrings.ShowScoreboardTeam; + + default: + throw new ArgumentOutOfRangeException(); + } + } + protected override bool OnHover(HoverEvent e) { Text.FadeColour(AccentColour);