1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-21 05:09:57 +08:00

Merge pull request #35273 from diquoks/localisation/play

Localise `Break` & `PlayerSettings` on `Play` screen
This commit is contained in:
Bartłomiej Dach
2025-10-14 12:57:45 +02:00
committed by GitHub
Unverified
12 changed files with 109 additions and 18 deletions
@@ -4,6 +4,7 @@
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Configuration;
using osu.Game.Localisation;
using osu.Game.Rulesets.Osu.Configuration;
using osu.Game.Screens.Play.PlayerSettings;
@@ -13,19 +14,19 @@ namespace osu.Game.Rulesets.Osu.UI
{
private readonly OsuRulesetConfigManager config;
[SettingSource("Show click markers", SettingControlType = typeof(PlayerCheckbox))]
[SettingSource(typeof(PlayerSettingsOverlayStrings), nameof(PlayerSettingsOverlayStrings.ShowClickMarkers), SettingControlType = typeof(PlayerCheckbox))]
public BindableBool ShowClickMarkers { get; } = new BindableBool();
[SettingSource("Show frame markers", SettingControlType = typeof(PlayerCheckbox))]
[SettingSource(typeof(PlayerSettingsOverlayStrings), nameof(PlayerSettingsOverlayStrings.ShowFrameMarkers), SettingControlType = typeof(PlayerCheckbox))]
public BindableBool ShowAimMarkers { get; } = new BindableBool();
[SettingSource("Show cursor path", SettingControlType = typeof(PlayerCheckbox))]
[SettingSource(typeof(PlayerSettingsOverlayStrings), nameof(PlayerSettingsOverlayStrings.ShowCursorPath), SettingControlType = typeof(PlayerCheckbox))]
public BindableBool ShowCursorPath { get; } = new BindableBool();
[SettingSource("Hide gameplay cursor", SettingControlType = typeof(PlayerCheckbox))]
[SettingSource(typeof(PlayerSettingsOverlayStrings), nameof(PlayerSettingsOverlayStrings.HideGameplayCursor), SettingControlType = typeof(PlayerCheckbox))]
public BindableBool HideSkinCursor { get; } = new BindableBool();
[SettingSource("Display length", SettingControlType = typeof(PlayerSliderBar<int>))]
[SettingSource(typeof(PlayerSettingsOverlayStrings), nameof(PlayerSettingsOverlayStrings.DisplayLength), SettingControlType = typeof(PlayerSliderBar<int>))]
public BindableInt DisplayLength { get; } = new BindableInt
{
MinValue = 200,
@@ -35,7 +36,7 @@ namespace osu.Game.Rulesets.Osu.UI
};
public ReplayAnalysisSettings(OsuRulesetConfigManager config)
: base("Analysis Settings")
: base(PlayerSettingsOverlayStrings.AnalysisSettingsTitle)
{
this.config = config;
}
+24
View File
@@ -0,0 +1,24 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Localisation;
namespace osu.Game.Localisation
{
public class BreakInfoStrings
{
private const string prefix = @"osu.Game.Resources.Localisation.BreakInfo";
/// <summary>
/// "Current Progress"
/// </summary>
public static LocalisableString CurrentProgressTitle => new TranslatableString(getKey(@"current_progress_title"), @"Current Progress");
/// <summary>
/// "Grade"
/// </summary>
public static LocalisableString ShowInfoGrade => new TranslatableString(getKey(@"show_info_grade"), @"Grade");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}
+5
View File
@@ -194,6 +194,11 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString Details => new TranslatableString(getKey(@"details"), @"Details...");
/// <summary>
/// "Mapper"
/// </summary>
public static LocalisableString Mapper => new TranslatableString(getKey(@"mapper"), @"Mapper");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}
@@ -29,6 +29,61 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString SeekForwardSeconds(double arg0) => new TranslatableString(getKey(@"seek_forward_seconds"), @"Seek forward {0} seconds", arg0);
/// <summary>
/// "Playback speed"
/// </summary>
public static LocalisableString PlaybackSpeed => new TranslatableString(getKey(@"playback_speed"), @"Playback speed");
/// <summary>
/// "Show click markers"
/// </summary>
public static LocalisableString ShowClickMarkers => new TranslatableString(getKey(@"show_click_markers"), @"Show click markers");
/// <summary>
/// "Show frame markers"
/// </summary>
public static LocalisableString ShowFrameMarkers => new TranslatableString(getKey(@"show_frame_markers"), @"Show frame markers");
/// <summary>
/// "Show cursor path"
/// </summary>
public static LocalisableString ShowCursorPath => new TranslatableString(getKey(@"show_cursor_path"), @"Show cursor path");
/// <summary>
/// "Hide gameplay cursor"
/// </summary>
public static LocalisableString HideGameplayCursor => new TranslatableString(getKey(@"hide_gameplay_cursor"), @"Hide gameplay cursor");
/// <summary>
/// "Display length"
/// </summary>
public static LocalisableString DisplayLength => new TranslatableString(getKey(@"display_length"), @"Display length");
/// <summary>
/// "Playback"
/// </summary>
public static LocalisableString PlaybackTitle => new TranslatableString(getKey(@"playback_title"), @"Playback");
/// <summary>
/// "Visual Settings"
/// </summary>
public static LocalisableString VisualSettingsTitle => new TranslatableString(getKey(@"visual_settings_title"), @"Visual Settings");
/// <summary>
/// "Audio Settings"
/// </summary>
public static LocalisableString AudioSettingsTitle => new TranslatableString(getKey(@"audio_settings_title"), @"Audio Settings");
/// <summary>
/// "Input Settings"
/// </summary>
public static LocalisableString InputSettingsTitle => new TranslatableString(getKey(@"input_settings_title"), @"Input Settings");
/// <summary>
/// "Analysis Settings"
/// </summary>
public static LocalisableString AnalysisSettingsTitle => new TranslatableString(getKey(@"analysis_settings_title"), @"Analysis Settings");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}
+5 -3
View File
@@ -3,12 +3,14 @@
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Framework.Utils;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
@@ -21,7 +23,7 @@ namespace osu.Game.Overlays
{
public partial class SettingsToolboxGroup : Container, IExpandable
{
private readonly string title;
private readonly LocalisableString title;
public const int CONTAINER_WIDTH = 270;
private const float transition_duration = 250;
@@ -60,7 +62,7 @@ namespace osu.Game.Overlays
/// Create a new instance.
/// </summary>
/// <param name="title">The title to be displayed in the header of this group.</param>
public SettingsToolboxGroup(string title)
public SettingsToolboxGroup(LocalisableString title)
{
this.title = title;
@@ -102,7 +104,7 @@ namespace osu.Game.Overlays
{
Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft,
Text = title.ToUpperInvariant(),
Text = title.ToUpper(),
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 17),
Padding = new MarginPadding { Left = 10, Right = 30 },
},
@@ -19,6 +19,7 @@ using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Play.HUD;
using osuTK;
using CommonStrings = osu.Game.Localisation.CommonStrings;
namespace osu.Game.Screens.Play
{
@@ -165,7 +166,7 @@ namespace osu.Game.Screens.Play
},
new Drawable[]
{
new MetadataLineLabel("Mapper"),
new MetadataLineLabel(CommonStrings.Mapper),
new MetadataLineInfo(metadata.Author.Username)
}
}
+4 -2
View File
@@ -1,10 +1,12 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Localisation;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Scoring;
using osuTK;
@@ -32,7 +34,7 @@ namespace osu.Game.Screens.Play.Break
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Text = "current progress".ToUpperInvariant(),
Text = BreakInfoStrings.CurrentProgressTitle.ToUpper(),
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 15),
},
new FillFlowContainer
@@ -46,7 +48,7 @@ namespace osu.Game.Screens.Play.Break
AccuracyDisplay = new PercentageBreakInfoLine(BeatmapsetsStrings.ShowScoreboardHeadersAccuracy),
// See https://github.com/ppy/osu/discussions/15185
// RankDisplay = new BreakInfoLine<int>("Rank"),
GradeDisplay = new BreakInfoLine<ScoreRank>("Grade"),
GradeDisplay = new BreakInfoLine<ScoreRank>(BreakInfoStrings.ShowInfoGrade),
},
}
},
@@ -19,7 +19,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
private readonly PlayerCheckbox beatmapHitsoundsToggle;
public AudioSettings()
: base("Audio Settings")
: base(PlayerSettingsOverlayStrings.AudioSettingsTitle)
{
Children = new Drawable[]
{
@@ -12,7 +12,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
public partial class InputSettings : PlayerSettingsGroup
{
public InputSettings()
: base("Input Settings")
: base(PlayerSettingsOverlayStrings.InputSettingsTitle)
{
}
@@ -41,7 +41,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
private IconButton pausePlay = null!;
public PlaybackSettings()
: base("playback")
: base(PlayerSettingsOverlayStrings.PlaybackTitle)
{
}
@@ -138,7 +138,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
{
rateSlider = new PlayerSliderBar<double>
{
LabelText = "Playback speed",
LabelText = PlayerSettingsOverlayStrings.PlaybackSpeed,
Current = UserPlaybackRate,
},
multiplierText = new OsuSpriteText
@@ -2,13 +2,14 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Game.Overlays;
namespace osu.Game.Screens.Play.PlayerSettings
{
public partial class PlayerSettingsGroup : SettingsToolboxGroup
{
public PlayerSettingsGroup(string title)
public PlayerSettingsGroup(LocalisableString title)
: base(title)
{
}
@@ -18,7 +18,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
private readonly PlayerCheckbox beatmapColorsToggle;
public VisualSettings()
: base("Visual Settings")
: base(PlayerSettingsOverlayStrings.VisualSettingsTitle)
{
Children = new Drawable[]
{