From 8645e705fd73e2dde122c4905fb0a78d06f6a336 Mon Sep 17 00:00:00 2001 From: tsrk Date: Wed, 1 Feb 2023 23:44:00 +0000 Subject: [PATCH 1/7] feat: add localisation for Skin editor components --- .../BarHitErrorMeterStrings.cs | 89 +++++++++++++++++++ .../BeatmapAttributeTextStrings.cs | 34 +++++++ .../ColourHitErrorMeterStrings.cs | 54 +++++++++++ .../FontAdjustableSkinComponentStrings.cs | 24 +++++ .../GameplayAccuracyCounterStrings.cs | 39 ++++++++ .../JudgementCounterDisplayStrings.cs | 50 +++++++++++ .../SkinnableSpriteStrings.cs | 24 +++++ .../SongProgressStrings.cs | 24 +++++ .../TextElementStrings.cs | 24 +++++ osu.Game/Localisation/SkinEditorStrings.cs | 5 ++ .../Screens/Play/HUD/ArgonSongProgress.cs | 3 +- .../Screens/Play/HUD/DefaultSongProgress.cs | 3 +- .../Play/HUD/GameplayAccuracyCounter.cs | 11 +-- .../HUD/HitErrorMeters/BarHitErrorMeter.cs | 22 +++-- .../HUD/HitErrorMeters/ColourHitErrorMeter.cs | 11 ++- .../JudgementCounterDisplay.cs | 15 +++- .../Components/BeatmapAttributeText.cs | 5 +- osu.Game/Skinning/Components/TextElement.cs | 3 +- osu.Game/Skinning/Editor/SkinEditor.cs | 4 +- .../Skinning/FontAdjustableSkinComponent.cs | 3 +- osu.Game/Skinning/SkinnableSprite.cs | 3 +- 21 files changed, 424 insertions(+), 26 deletions(-) create mode 100644 osu.Game/Localisation/SkinEditorComponents/BarHitErrorMeterStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/BeatmapAttributeTextStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/ColourHitErrorMeterStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/FontAdjustableSkinComponentStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/GameplayAccuracyCounterStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/JudgementCounterDisplayStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/SkinnableSpriteStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/TextElementStrings.cs diff --git a/osu.Game/Localisation/SkinEditorComponents/BarHitErrorMeterStrings.cs b/osu.Game/Localisation/SkinEditorComponents/BarHitErrorMeterStrings.cs new file mode 100644 index 0000000000..ea372a5207 --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/BarHitErrorMeterStrings.cs @@ -0,0 +1,89 @@ +// Copyright (c) ppy Pty Ltd . 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.SkinEditorComponents +{ + public static class BarHitErrorMeterStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.BarHitErrorMeter"; + + /// + /// "Judgement line thickness" + /// + public static LocalisableString JudgementLineThickness => new TranslatableString(getKey(@"judgement_line_thickness"), "Judgement line thickness"); + + /// + /// "How thick the individual lines should be." + /// + public static LocalisableString JudgementLineThicknessDescription => new TranslatableString(getKey(@"judgement_line_thickness_description"), "How thick the individual lines should be."); + + /// + /// "Show colour bars" + /// + public static LocalisableString ColourBarVisibility => new TranslatableString(getKey(@"colour_bar_visibility"), "Show colour bars"); + + /// + /// "Show moving average arrow" + /// + public static LocalisableString ShowMovingAverage => new TranslatableString(getKey(@"show_moving_average"), "Show moving average arrow"); + + /// + /// "Whether an arrow should move beneath the bar showing the average error." + /// + public static LocalisableString ShowMovingAverageDescription => new TranslatableString(getKey(@"show_moving_average_description"), "Whether an arrow should move beneath the bar showing the average error."); + + /// + /// "Centre marker style" + /// + public static LocalisableString CentreMarkerStyle => new TranslatableString(getKey(@"centre_marker_style"), "Centre marker style"); + + /// + /// "How to signify the centre of the display" + /// + public static LocalisableString CentreMarkerStyleDescription => new TranslatableString(getKey(@"centre_marker_style_description"), "How to signify the centre of the display"); + + /// + /// "None" + /// + public static LocalisableString CentreMarkerStylesNone => new TranslatableString(getKey(@"centre_marker_styles_none"), "None"); + + /// + /// "Circle" + /// + public static LocalisableString CentreMarkerStylesCircle => new TranslatableString(getKey(@"centre_marker_styles_circle"), "Circle"); + + /// + /// "Line" + /// + public static LocalisableString CentreMarkerStylesLine => new TranslatableString(getKey(@"centre_marker_styles_line"), "Line"); + + /// + /// "Label style" + /// + public static LocalisableString LabelStyle => new TranslatableString(getKey(@"label_style"), "Label style"); + + /// + /// "How to show early/late extremities" + /// + public static LocalisableString LabelStyleDescription => new TranslatableString(getKey(@"label_style_description"), "How to show early/late extremities"); + + /// + /// "None" + /// + public static LocalisableString LabelStylesNone => new TranslatableString(getKey(@"label_styles_none"), "None"); + + /// + /// "Icons" + /// + public static LocalisableString LabelStylesIcons => new TranslatableString(getKey(@"label_styles_icons"), "Icons"); + + /// + /// "Text" + /// + public static LocalisableString LabelStylesText => new TranslatableString(getKey(@"label_styles_text"), "Text"); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorComponents/BeatmapAttributeTextStrings.cs b/osu.Game/Localisation/SkinEditorComponents/BeatmapAttributeTextStrings.cs new file mode 100644 index 0000000000..faafa7e304 --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/BeatmapAttributeTextStrings.cs @@ -0,0 +1,34 @@ +// Copyright (c) ppy Pty Ltd . 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.SkinEditorComponents +{ + public static class BeatmapAttributeTextStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.BeatmapAttributeText"; + + /// + /// "Attribute" + /// + public static LocalisableString Attribute => new TranslatableString(getKey(@"attribute"), "Attribute"); + + /// + /// "The attribute to be displayed." + /// + public static LocalisableString AttributeDescription => new TranslatableString(getKey(@"attribute_description"), "The attribute to be displayed."); + + /// + /// "Template" + /// + public static LocalisableString Template => new TranslatableString(getKey(@"template"), "Template"); + + /// + /// "Supports {{Label}} and {{Value}}, but also including arbitrary attributes like {{StarRating}} (see attribute list for supported values)." + /// + public static LocalisableString TemplateDescription => new TranslatableString(getKey(@"template_description"), @"Supports {{Label}} and {{Value}}, but also including arbitrary attributes like {{StarRating}} (see attribute list for supported values)."); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorComponents/ColourHitErrorMeterStrings.cs b/osu.Game/Localisation/SkinEditorComponents/ColourHitErrorMeterStrings.cs new file mode 100644 index 0000000000..fec5781c3d --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/ColourHitErrorMeterStrings.cs @@ -0,0 +1,54 @@ +// Copyright (c) ppy Pty Ltd . 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.SkinEditorComponents +{ + public static class ColourHitErrorMeterStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.ColourHitError"; + + /// + /// "Judgement count" + /// + public static LocalisableString JudgementCount => new TranslatableString(getKey(@"judgement_count"), "Judgement count"); + + /// + /// "The number of displayed judgements" + /// + public static LocalisableString JudgementCountDescription => new TranslatableString(getKey(@"judgement_count_description"), "The number of displayed judgements"); + + /// + /// "Judgement spacing" + /// + public static LocalisableString JudgementSpacing => new TranslatableString(getKey(@"judgement_spacing"), "Judgement spacing"); + + /// + /// "The space between each displayed judgement" + /// + public static LocalisableString JudgementSpacingDescription => new TranslatableString(getKey(@"judgement_spacing_description"), "The space between each displayed judgement"); + + /// + /// "Judgement shape" + /// + public static LocalisableString JudgementShape => new TranslatableString(getKey(@"judgement_shape"), "Judgement shape"); + + /// + /// "The shape of each displayed judgement" + /// + public static LocalisableString JudgementShapeDescription => new TranslatableString(getKey(@"judgement_shape_description"), "The shape of each displayed judgement"); + + /// + /// "Circle" + /// + public static LocalisableString ShapeStyleCircle => new TranslatableString(getKey(@"shape_style_cricle"), "Circle"); + + /// + /// "Square" + /// + public static LocalisableString ShapeStyleSquare => new TranslatableString(getKey(@"shape_style_square"), "Square"); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorComponents/FontAdjustableSkinComponentStrings.cs b/osu.Game/Localisation/SkinEditorComponents/FontAdjustableSkinComponentStrings.cs new file mode 100644 index 0000000000..9b92854faa --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/FontAdjustableSkinComponentStrings.cs @@ -0,0 +1,24 @@ +// Copyright (c) ppy Pty Ltd . 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.SkinEditorComponents +{ + public static class FontAdjustableSkinComponentStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.FontAdjustableSkinComponent"; + + /// + /// "Font" + /// + public static LocalisableString Font => new TranslatableString(getKey(@"font"), "Font"); + + /// + /// "The font to use." + /// + public static LocalisableString FontDescription => new TranslatableString(getKey(@"font_description"), "The font to use."); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorComponents/GameplayAccuracyCounterStrings.cs b/osu.Game/Localisation/SkinEditorComponents/GameplayAccuracyCounterStrings.cs new file mode 100644 index 0000000000..33a742a95e --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/GameplayAccuracyCounterStrings.cs @@ -0,0 +1,39 @@ +// Copyright (c) ppy Pty Ltd . 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.SkinEditorComponents +{ + public static class GameplayAccuracyCounterStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.GameplayAccuracyCounter"; + + /// + /// "Accuracy display mode" + /// + public static LocalisableString AccuracyDisplay => new TranslatableString(getKey(@"accuracy_display"), "Accuracy display mode"); + + /// + /// "Which accuracy mode should be displayed." + /// + public static LocalisableString AccuracyDisplayDescription => new TranslatableString(getKey(@"accuracy_display_description"), "Which accuracy mode should be displayed."); + + /// + /// "Standard" + /// + public static LocalisableString AccuracyDisplayModeStandard => new TranslatableString(getKey(@"accuracy_display_mode_standard"), "Standard"); + + /// + /// "Maximum achievable" + /// + public static LocalisableString AccuracyDisplayModeMax => new TranslatableString(getKey(@"accuracy_display_mode_max"), "Maximum achievable"); + + /// + /// "Minimum achievable" + /// + public static LocalisableString AccuracyDisplayModeMin => new TranslatableString(getKey(@"accuracy_display_mode_min"), "Minimum achievable"); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorComponents/JudgementCounterDisplayStrings.cs b/osu.Game/Localisation/SkinEditorComponents/JudgementCounterDisplayStrings.cs new file mode 100644 index 0000000000..75f0241e56 --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/JudgementCounterDisplayStrings.cs @@ -0,0 +1,50 @@ +// Copyright (c) ppy Pty Ltd . 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.SkinEditorComponents +{ + public static class JudgementCounterDisplayStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.JudgementCounterDisplay"; + + /// + /// "Display mode" + /// + public static LocalisableString JudgementDisplayMode => new TranslatableString(getKey(@"judgement_display_mode"), "Display mode"); + + /// + /// "Counter direction" + /// + public static LocalisableString FlowDirection => new TranslatableString(getKey(@"flow_direction"), "Counter direction"); + + /// + /// "Show judgement names" + /// + public static LocalisableString ShowJudgementNames => new TranslatableString(getKey(@"show_judgement_names"), "Show judgement names"); + + /// + /// "Show max judgement" + /// + public static LocalisableString ShowMaxJudgement => new TranslatableString(getKey(@"show_max_judgement"), "Show max judgement"); + + /// + /// "Simple" + /// + public static LocalisableString JudgementDisplayModeSimple => new TranslatableString(getKey(@"judgement_display_mode_simple"), "Simple"); + + /// + /// "Normal" + /// + public static LocalisableString JudgementDisplayModeNormal => new TranslatableString(getKey(@"judgement_display_mode_normal"), "Normal"); + + /// + /// "All" + /// + public static LocalisableString JudgementDisplayModeAll => new TranslatableString(getKey(@"judgement_display_mode_all"), "All"); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} + diff --git a/osu.Game/Localisation/SkinEditorComponents/SkinnableSpriteStrings.cs b/osu.Game/Localisation/SkinEditorComponents/SkinnableSpriteStrings.cs new file mode 100644 index 0000000000..f67acb493c --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/SkinnableSpriteStrings.cs @@ -0,0 +1,24 @@ +// Copyright (c) ppy Pty Ltd . 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.SkinEditorComponents +{ + public static class SkinnableSpriteStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.SkinnableSprite"; + + /// + /// "Sprite name" + /// + public static LocalisableString SpriteName => new TranslatableString(getKey(@"sprite_name"), "Sprite name"); + + /// + /// "The filename of the sprite" + /// + public static LocalisableString SpriteNameDescription => new TranslatableString(getKey(@"sprite_name_description"), "The filename of the sprite"); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs b/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs new file mode 100644 index 0000000000..9719cdef52 --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs @@ -0,0 +1,24 @@ +// Copyright (c) ppy Pty Ltd . 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.SkinEditorComponents +{ + public static class SongProgressStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.SongProgressStrings"; + + /// + /// "Show difficulty graph" + /// + public static LocalisableString ShowGraph => new TranslatableString(getKey(@"show_graph"), "Show difficulty graph"); + + /// + /// "Whether a graph displaying difficulty throughout the beatmap should be shown" + /// + public static LocalisableString ShowGraphDescription => new TranslatableString(getKey(@"show_graph_description"), "Whether a graph displaying difficulty throughout the beatmap should be shown"); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorComponents/TextElementStrings.cs b/osu.Game/Localisation/SkinEditorComponents/TextElementStrings.cs new file mode 100644 index 0000000000..e969da60bf --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/TextElementStrings.cs @@ -0,0 +1,24 @@ +// Copyright (c) ppy Pty Ltd . 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.SkinEditorComponents +{ + public static class TextElementStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.TextElement"; + + /// + /// "Text" + /// + public static LocalisableString TextElementText => new TranslatableString(getKey(@"text_element_text"), "Text"); + + /// + /// "The text to be displayed." + /// + public static LocalisableString TextElementTextDescription => new TranslatableString(getKey(@"text_element_text_description"), "The text to be displayed."); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorStrings.cs b/osu.Game/Localisation/SkinEditorStrings.cs index b2e5f3aeb6..d9744cf6c8 100644 --- a/osu.Game/Localisation/SkinEditorStrings.cs +++ b/osu.Game/Localisation/SkinEditorStrings.cs @@ -39,6 +39,11 @@ namespace osu.Game.Localisation /// public static LocalisableString Settings(string arg0) => new TranslatableString(getKey(@"settings"), @"Settings ({0})", arg0); + /// + /// "Curently editing" + /// + public static LocalisableString CurrentlyEditing => new TranslatableString(getKey(@"currently_editing"), "Curently editing"); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs b/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs index bfee6d295e..075e5af163 100644 --- a/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs +++ b/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Configuration; using osu.Game.Graphics; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Rulesets.Objects; namespace osu.Game.Screens.Play.HUD @@ -21,7 +22,7 @@ namespace osu.Game.Screens.Play.HUD private const float bar_height = 10; - [SettingSource("Show difficulty graph", "Whether a graph displaying difficulty throughout the beatmap should be shown")] + [SettingSource(typeof(SongProgressStrings), nameof(SongProgressStrings.ShowGraph), nameof(SongProgressStrings.ShowGraphDescription))] public Bindable ShowGraph { get; } = new BindableBool(true); [Resolved] diff --git a/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs b/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs index 91a34fe374..1c051c24ae 100644 --- a/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs +++ b/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs @@ -7,6 +7,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Rulesets.Objects; using osuTK; @@ -26,7 +27,7 @@ namespace osu.Game.Screens.Play.HUD private readonly DefaultSongProgressGraph graph; private readonly SongProgressInfo info; - [SettingSource("Show difficulty graph", "Whether a graph displaying difficulty throughout the beatmap should be shown")] + [SettingSource(typeof(SongProgressStrings), nameof(SongProgressStrings.ShowGraph), nameof(SongProgressStrings.ShowGraphDescription))] public Bindable ShowGraph { get; } = new BindableBool(true); [Resolved] diff --git a/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs b/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs index ca7fef8f73..d044b3d98a 100644 --- a/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs +++ b/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs @@ -1,18 +1,19 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System.ComponentModel; using osu.Framework.Allocation; using osu.Framework.Bindables; +using osu.Framework.Localisation; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Play.HUD { public abstract partial class GameplayAccuracyCounter : PercentageCounter { - [SettingSource("Accuracy display mode", "Which accuracy mode should be displayed.")] + [SettingSource(typeof(GameplayAccuracyCounterStrings), nameof(GameplayAccuracyCounterStrings.AccuracyDisplay), nameof(GameplayAccuracyCounterStrings.AccuracyDisplayDescription))] public Bindable AccuracyDisplay { get; } = new Bindable(); [Resolved] @@ -51,13 +52,13 @@ namespace osu.Game.Screens.Play.HUD public enum AccuracyDisplayMode { - [Description("Standard")] + [LocalisableDescription(typeof(GameplayAccuracyCounterStrings), nameof(GameplayAccuracyCounterStrings.AccuracyDisplayModeStandard))] Standard, - [Description("Maximum achievable")] + [LocalisableDescription(typeof(GameplayAccuracyCounterStrings), nameof(GameplayAccuracyCounterStrings.AccuracyDisplayModeMax))] MaximumAchievable, - [Description("Minimum achievable")] + [LocalisableDescription(typeof(GameplayAccuracyCounterStrings), nameof(GameplayAccuracyCounterStrings.AccuracyDisplayModeMin))] MinimumAchievable } } diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs index 0337f66bd9..5d0efe7b77 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs @@ -12,10 +12,12 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Pooling; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; +using osu.Framework.Localisation; using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osuTK; @@ -25,7 +27,7 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters [Cached] public partial class BarHitErrorMeter : HitErrorMeter { - [SettingSource("Judgement line thickness", "How thick the individual lines should be.")] + [SettingSource(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.JudgementLineThickness), nameof(BarHitErrorMeterStrings.JudgementLineThicknessDescription))] public BindableNumber JudgementLineThickness { get; } = new BindableNumber(4) { MinValue = 1, @@ -33,16 +35,16 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters Precision = 0.1f, }; - [SettingSource("Show colour bars")] + [SettingSource(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.ColourBarVisibility))] public Bindable ColourBarVisibility { get; } = new Bindable(true); - [SettingSource("Show moving average arrow", "Whether an arrow should move beneath the bar showing the average error.")] + [SettingSource(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.ShowMovingAverage), nameof(BarHitErrorMeterStrings.ShowMovingAverageDescription))] public Bindable ShowMovingAverage { get; } = new BindableBool(true); - [SettingSource("Centre marker style", "How to signify the centre of the display")] + [SettingSource(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.CentreMarkerStyle), nameof(BarHitErrorMeterStrings.CentreMarkerStyleDescription))] public Bindable CentreMarkerStyle { get; } = new Bindable(CentreMarkerStyles.Circle); - [SettingSource("Label style", "How to show early/late extremities")] + [SettingSource(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.LabelStyle), nameof(BarHitErrorMeterStrings.LabelStyleDescription))] public Bindable LabelStyle { get; } = new Bindable(LabelStyles.Icons); private const int judgement_line_width = 14; @@ -487,15 +489,25 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters public enum CentreMarkerStyles { + [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.CentreMarkerStylesNone))] None, + + [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.CentreMarkerStylesCircle))] Circle, + + [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.CentreMarkerStylesLine))] Line } public enum LabelStyles { + [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.LabelStylesNone))] None, + + [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.LabelStylesIcons))] Icons, + + [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.LabelStylesIcons))] Text } } diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs index ec5dc5f52f..28e2006c2f 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs @@ -9,7 +9,9 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Pooling; using osu.Framework.Graphics.Shapes; +using osu.Framework.Localisation; using osu.Game.Configuration; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osuTK; @@ -23,21 +25,21 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters private const int animation_duration = 200; private const int drawable_judgement_size = 8; - [SettingSource("Judgement count", "The number of displayed judgements")] + [SettingSource(typeof(ColourHitErrorMeterStrings), nameof(ColourHitErrorMeterStrings.JudgementCount), nameof(ColourHitErrorMeterStrings.JudgementCountDescription))] public BindableNumber JudgementCount { get; } = new BindableNumber(20) { MinValue = 1, MaxValue = 50, }; - [SettingSource("Judgement spacing", "The space between each displayed judgement")] + [SettingSource(typeof(ColourHitErrorMeterStrings), nameof(ColourHitErrorMeterStrings.JudgementSpacing), nameof(ColourHitErrorMeterStrings.JudgementSpacingDescription))] public BindableNumber JudgementSpacing { get; } = new BindableNumber(2) { MinValue = 0, MaxValue = 10, }; - [SettingSource("Judgement shape", "The shape of each displayed judgement")] + [SettingSource(typeof(ColourHitErrorMeterStrings), nameof(ColourHitErrorMeterStrings.JudgementShape), nameof(ColourHitErrorMeterStrings.JudgementShapeDescription))] public Bindable JudgementShape { get; } = new Bindable(); private readonly JudgementFlow judgementsFlow; @@ -192,7 +194,10 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters public enum ShapeStyle { + [LocalisableDescription(typeof(ColourHitErrorMeterStrings), nameof(ColourHitErrorMeterStrings.ShapeStyleCircle))] Circle, + + [LocalisableDescription(typeof(ColourHitErrorMeterStrings), nameof(ColourHitErrorMeterStrings.ShapeStyleSquare))] Square } } diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs index 82f24c736e..d047b8e5fb 100644 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs +++ b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs @@ -6,7 +6,9 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Localisation; using osu.Game.Configuration; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Rulesets.Scoring; using osu.Game.Skinning; using osuTK; @@ -19,16 +21,16 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter public bool UsesFixedAnchor { get; set; } - [SettingSource("Display mode")] + [SettingSource(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.JudgementDisplayMode))] public Bindable Mode { get; set; } = new Bindable(); - [SettingSource("Counter direction")] + [SettingSource(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.FlowDirection))] public Bindable FlowDirection { get; set; } = new Bindable(); - [SettingSource("Show judgement names")] + [SettingSource(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.ShowJudgementNames))] public BindableBool ShowJudgementNames { get; set; } = new BindableBool(true); - [SettingSource("Show max judgement")] + [SettingSource(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.ShowMaxJudgement))] public BindableBool ShowMaxJudgement { get; set; } = new BindableBool(true); [Resolved] @@ -130,8 +132,13 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter public enum DisplayMode { + [LocalisableDescription(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.JudgementDisplayModeSimple))] Simple, + + [LocalisableDescription(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.JudgementDisplayModeNormal))] Normal, + + [LocalisableDescription(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.JudgementDisplayModeAll))] All } } diff --git a/osu.Game/Skinning/Components/BeatmapAttributeText.cs b/osu.Game/Skinning/Components/BeatmapAttributeText.cs index 68bb1e7ddc..d2e724f760 100644 --- a/osu.Game/Skinning/Components/BeatmapAttributeText.cs +++ b/osu.Game/Skinning/Components/BeatmapAttributeText.cs @@ -18,6 +18,7 @@ using osu.Game.Configuration; using osu.Game.Extensions; using osu.Game.Graphics.Sprites; using osu.Game.Localisation; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Resources.Localisation.Web; namespace osu.Game.Skinning.Components @@ -25,10 +26,10 @@ namespace osu.Game.Skinning.Components [UsedImplicitly] public partial class BeatmapAttributeText : FontAdjustableSkinComponent { - [SettingSource("Attribute", "The attribute to be displayed.")] + [SettingSource(typeof(BeatmapAttributeTextStrings), nameof(BeatmapAttributeTextStrings.Attribute), nameof(BeatmapAttributeTextStrings.AttributeDescription))] public Bindable Attribute { get; } = new Bindable(BeatmapAttribute.StarRating); - [SettingSource("Template", "Supports {Label} and {Value}, but also including arbitrary attributes like {StarRating} (see attribute list for supported values).")] + [SettingSource(typeof(BeatmapAttributeTextStrings), nameof(BeatmapAttributeTextStrings.Template), nameof(BeatmapAttributeTextStrings.TemplateDescription))] public Bindable Template { get; set; } = new Bindable("{Label}: {Value}"); [Resolved] diff --git a/osu.Game/Skinning/Components/TextElement.cs b/osu.Game/Skinning/Components/TextElement.cs index d87fb125bb..9adc065b88 100644 --- a/osu.Game/Skinning/Components/TextElement.cs +++ b/osu.Game/Skinning/Components/TextElement.cs @@ -8,13 +8,14 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Localisation.SkinEditorComponents; namespace osu.Game.Skinning.Components { [UsedImplicitly] public partial class TextElement : FontAdjustableSkinComponent { - [SettingSource("Text", "The text to be displayed.")] + [SettingSource(typeof(TextElementStrings), nameof(TextElementStrings.TextElementText), nameof(TextElementStrings.TextElementTextDescription))] public Bindable Text { get; } = new Bindable("Circles!"); private readonly OsuSpriteText text; diff --git a/osu.Game/Skinning/Editor/SkinEditor.cs b/osu.Game/Skinning/Editor/SkinEditor.cs index 98b4e960dd..74391e5269 100644 --- a/osu.Game/Skinning/Editor/SkinEditor.cs +++ b/osu.Game/Skinning/Editor/SkinEditor.cs @@ -254,13 +254,13 @@ namespace osu.Game.Skinning.Editor headerText.AddParagraph(SkinEditorStrings.SkinEditor, cp => cp.Font = OsuFont.Default.With(size: 16)); headerText.NewParagraph(); - headerText.AddText("Currently editing ", cp => + headerText.AddText(SkinEditorStrings.CurrentlyEditing, cp => { cp.Font = OsuFont.Default.With(size: 12); cp.Colour = colours.Yellow; }); - headerText.AddText($"{currentSkin.Value.SkinInfo}", cp => + headerText.AddText($" {currentSkin.Value.SkinInfo}", cp => { cp.Font = OsuFont.Default.With(size: 12, weight: FontWeight.Bold); cp.Colour = colours.Yellow; diff --git a/osu.Game/Skinning/FontAdjustableSkinComponent.cs b/osu.Game/Skinning/FontAdjustableSkinComponent.cs index ee73417bfe..51d4aa9fee 100644 --- a/osu.Game/Skinning/FontAdjustableSkinComponent.cs +++ b/osu.Game/Skinning/FontAdjustableSkinComponent.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; using osu.Game.Graphics; +using osu.Game.Localisation.SkinEditorComponents; namespace osu.Game.Skinning { @@ -16,7 +17,7 @@ namespace osu.Game.Skinning { public bool UsesFixedAnchor { get; set; } - [SettingSource("Font", "The font to use.")] + [SettingSource(typeof(FontAdjustableSkinComponentStrings), nameof(FontAdjustableSkinComponentStrings.Font), nameof(FontAdjustableSkinComponentStrings.FontDescription))] public Bindable Font { get; } = new Bindable(Typeface.Torus); /// diff --git a/osu.Game/Skinning/SkinnableSprite.cs b/osu.Game/Skinning/SkinnableSprite.cs index a66f3e0549..a5ed2a4b64 100644 --- a/osu.Game/Skinning/SkinnableSprite.cs +++ b/osu.Game/Skinning/SkinnableSprite.cs @@ -12,6 +12,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Overlays.Settings; using osuTK; @@ -27,7 +28,7 @@ namespace osu.Game.Skinning [Resolved] private TextureStore textures { get; set; } = null!; - [SettingSource("Sprite name", "The filename of the sprite", SettingControlType = typeof(SpriteSelectorControl))] + [SettingSource(typeof(SkinnableSpriteStrings), nameof(SkinnableSpriteStrings.SpriteName), nameof(SkinnableSpriteStrings.SpriteNameDescription), SettingControlType = typeof(SpriteSelectorControl))] public Bindable SpriteName { get; } = new Bindable(string.Empty); [Resolved] From ddfa95e6ef280939d8a19d146e8c8a07727ef8b9 Mon Sep 17 00:00:00 2001 From: tsrk Date: Thu, 2 Feb 2023 00:01:48 +0000 Subject: [PATCH 2/7] refactor: fix typos --- .../Localisation/SkinEditorComponents/SongProgressStrings.cs | 2 +- osu.Game/Localisation/SkinEditorStrings.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs b/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs index 9719cdef52..0e4d7ea34d 100644 --- a/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs +++ b/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs @@ -7,7 +7,7 @@ namespace osu.Game.Localisation.SkinEditorComponents { public static class SongProgressStrings { - private const string prefix = @"osu.Game.Resources.Localisation.SongProgressStrings"; + private const string prefix = @"osu.Game.Resources.Localisation.SongProgress"; /// /// "Show difficulty graph" diff --git a/osu.Game/Localisation/SkinEditorStrings.cs b/osu.Game/Localisation/SkinEditorStrings.cs index d9744cf6c8..5cf2e5b5c5 100644 --- a/osu.Game/Localisation/SkinEditorStrings.cs +++ b/osu.Game/Localisation/SkinEditorStrings.cs @@ -40,9 +40,9 @@ namespace osu.Game.Localisation public static LocalisableString Settings(string arg0) => new TranslatableString(getKey(@"settings"), @"Settings ({0})", arg0); /// - /// "Curently editing" + /// "Currently editing" /// - public static LocalisableString CurrentlyEditing => new TranslatableString(getKey(@"currently_editing"), "Curently editing"); + public static LocalisableString CurrentlyEditing => new TranslatableString(getKey(@"currently_editing"), "Currently editing"); private static string getKey(string key) => $@"{prefix}:{key}"; } From 0fb6a637091235afc715db3c1a3e67544acc00ad Mon Sep 17 00:00:00 2001 From: tsrk Date: Thu, 2 Feb 2023 00:46:14 +0000 Subject: [PATCH 3/7] refactor: change namespacing to allow osu-localisation-analyzer to process all strings --- .../{SkinEditorComponents => }/BarHitErrorMeterStrings.cs | 2 +- .../{SkinEditorComponents => }/BeatmapAttributeTextStrings.cs | 2 +- .../{SkinEditorComponents => }/ColourHitErrorMeterStrings.cs | 2 +- .../FontAdjustableSkinComponentStrings.cs | 2 +- .../GameplayAccuracyCounterStrings.cs | 2 +- .../JudgementCounterDisplayStrings.cs | 2 +- .../{SkinEditorComponents => }/SkinnableSpriteStrings.cs | 2 +- .../{SkinEditorComponents => }/SongProgressStrings.cs | 2 +- .../{SkinEditorComponents => }/TextElementStrings.cs | 2 +- osu.Game/Screens/Play/HUD/ArgonSongProgress.cs | 2 +- osu.Game/Screens/Play/HUD/DefaultSongProgress.cs | 2 +- osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs | 2 +- osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs | 2 +- osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs | 2 +- .../Play/HUD/JudgementCounter/JudgementCounterDisplay.cs | 2 +- osu.Game/Skinning/Components/BeatmapAttributeText.cs | 1 - osu.Game/Skinning/Components/TextElement.cs | 2 +- osu.Game/Skinning/FontAdjustableSkinComponent.cs | 2 +- osu.Game/Skinning/SkinnableSprite.cs | 2 +- 19 files changed, 18 insertions(+), 19 deletions(-) rename osu.Game/Localisation/{SkinEditorComponents => }/BarHitErrorMeterStrings.cs (98%) rename osu.Game/Localisation/{SkinEditorComponents => }/BeatmapAttributeTextStrings.cs (96%) rename osu.Game/Localisation/{SkinEditorComponents => }/ColourHitErrorMeterStrings.cs (97%) rename osu.Game/Localisation/{SkinEditorComponents => }/FontAdjustableSkinComponentStrings.cs (93%) rename osu.Game/Localisation/{SkinEditorComponents => }/GameplayAccuracyCounterStrings.cs (96%) rename osu.Game/Localisation/{SkinEditorComponents => }/JudgementCounterDisplayStrings.cs (97%) rename osu.Game/Localisation/{SkinEditorComponents => }/SkinnableSpriteStrings.cs (94%) rename osu.Game/Localisation/{SkinEditorComponents => }/SongProgressStrings.cs (94%) rename osu.Game/Localisation/{SkinEditorComponents => }/TextElementStrings.cs (94%) diff --git a/osu.Game/Localisation/SkinEditorComponents/BarHitErrorMeterStrings.cs b/osu.Game/Localisation/BarHitErrorMeterStrings.cs similarity index 98% rename from osu.Game/Localisation/SkinEditorComponents/BarHitErrorMeterStrings.cs rename to osu.Game/Localisation/BarHitErrorMeterStrings.cs index ea372a5207..171c3e223e 100644 --- a/osu.Game/Localisation/SkinEditorComponents/BarHitErrorMeterStrings.cs +++ b/osu.Game/Localisation/BarHitErrorMeterStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class BarHitErrorMeterStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/BeatmapAttributeTextStrings.cs b/osu.Game/Localisation/BeatmapAttributeTextStrings.cs similarity index 96% rename from osu.Game/Localisation/SkinEditorComponents/BeatmapAttributeTextStrings.cs rename to osu.Game/Localisation/BeatmapAttributeTextStrings.cs index faafa7e304..1ceb482cf4 100644 --- a/osu.Game/Localisation/SkinEditorComponents/BeatmapAttributeTextStrings.cs +++ b/osu.Game/Localisation/BeatmapAttributeTextStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class BeatmapAttributeTextStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/ColourHitErrorMeterStrings.cs b/osu.Game/Localisation/ColourHitErrorMeterStrings.cs similarity index 97% rename from osu.Game/Localisation/SkinEditorComponents/ColourHitErrorMeterStrings.cs rename to osu.Game/Localisation/ColourHitErrorMeterStrings.cs index fec5781c3d..13682c9c85 100644 --- a/osu.Game/Localisation/SkinEditorComponents/ColourHitErrorMeterStrings.cs +++ b/osu.Game/Localisation/ColourHitErrorMeterStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class ColourHitErrorMeterStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/FontAdjustableSkinComponentStrings.cs b/osu.Game/Localisation/FontAdjustableSkinComponentStrings.cs similarity index 93% rename from osu.Game/Localisation/SkinEditorComponents/FontAdjustableSkinComponentStrings.cs rename to osu.Game/Localisation/FontAdjustableSkinComponentStrings.cs index 9b92854faa..76f9f2f8b9 100644 --- a/osu.Game/Localisation/SkinEditorComponents/FontAdjustableSkinComponentStrings.cs +++ b/osu.Game/Localisation/FontAdjustableSkinComponentStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class FontAdjustableSkinComponentStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/GameplayAccuracyCounterStrings.cs b/osu.Game/Localisation/GameplayAccuracyCounterStrings.cs similarity index 96% rename from osu.Game/Localisation/SkinEditorComponents/GameplayAccuracyCounterStrings.cs rename to osu.Game/Localisation/GameplayAccuracyCounterStrings.cs index 33a742a95e..c9e936d8af 100644 --- a/osu.Game/Localisation/SkinEditorComponents/GameplayAccuracyCounterStrings.cs +++ b/osu.Game/Localisation/GameplayAccuracyCounterStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class GameplayAccuracyCounterStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/JudgementCounterDisplayStrings.cs b/osu.Game/Localisation/JudgementCounterDisplayStrings.cs similarity index 97% rename from osu.Game/Localisation/SkinEditorComponents/JudgementCounterDisplayStrings.cs rename to osu.Game/Localisation/JudgementCounterDisplayStrings.cs index 75f0241e56..fbc22e96fd 100644 --- a/osu.Game/Localisation/SkinEditorComponents/JudgementCounterDisplayStrings.cs +++ b/osu.Game/Localisation/JudgementCounterDisplayStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class JudgementCounterDisplayStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/SkinnableSpriteStrings.cs b/osu.Game/Localisation/SkinnableSpriteStrings.cs similarity index 94% rename from osu.Game/Localisation/SkinEditorComponents/SkinnableSpriteStrings.cs rename to osu.Game/Localisation/SkinnableSpriteStrings.cs index f67acb493c..6192f5e43d 100644 --- a/osu.Game/Localisation/SkinEditorComponents/SkinnableSpriteStrings.cs +++ b/osu.Game/Localisation/SkinnableSpriteStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class SkinnableSpriteStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs b/osu.Game/Localisation/SongProgressStrings.cs similarity index 94% rename from osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs rename to osu.Game/Localisation/SongProgressStrings.cs index 0e4d7ea34d..033560ebb0 100644 --- a/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs +++ b/osu.Game/Localisation/SongProgressStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class SongProgressStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/TextElementStrings.cs b/osu.Game/Localisation/TextElementStrings.cs similarity index 94% rename from osu.Game/Localisation/SkinEditorComponents/TextElementStrings.cs rename to osu.Game/Localisation/TextElementStrings.cs index e969da60bf..6257b80d72 100644 --- a/osu.Game/Localisation/SkinEditorComponents/TextElementStrings.cs +++ b/osu.Game/Localisation/TextElementStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class TextElementStrings { diff --git a/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs b/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs index 075e5af163..6c5ba52f27 100644 --- a/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs +++ b/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Configuration; using osu.Game.Graphics; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; using osu.Game.Rulesets.Objects; namespace osu.Game.Screens.Play.HUD diff --git a/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs b/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs index 1c051c24ae..fccefd49a4 100644 --- a/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs +++ b/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs @@ -7,7 +7,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; using osu.Game.Rulesets.Objects; using osuTK; diff --git a/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs b/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs index d044b3d98a..3a7c97632d 100644 --- a/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs +++ b/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs @@ -6,7 +6,7 @@ using osu.Framework.Bindables; using osu.Framework.Localisation; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Play.HUD diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs index 5d0efe7b77..3507987fe4 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs @@ -17,7 +17,7 @@ using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osuTK; diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs index 28e2006c2f..ac49e9ca5e 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs @@ -11,7 +11,7 @@ using osu.Framework.Graphics.Pooling; using osu.Framework.Graphics.Shapes; using osu.Framework.Localisation; using osu.Game.Configuration; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osuTK; diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs index d047b8e5fb..31b0b9ebc5 100644 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs +++ b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Localisation; using osu.Game.Configuration; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; using osu.Game.Rulesets.Scoring; using osu.Game.Skinning; using osuTK; diff --git a/osu.Game/Skinning/Components/BeatmapAttributeText.cs b/osu.Game/Skinning/Components/BeatmapAttributeText.cs index d2e724f760..e8b2d547a9 100644 --- a/osu.Game/Skinning/Components/BeatmapAttributeText.cs +++ b/osu.Game/Skinning/Components/BeatmapAttributeText.cs @@ -18,7 +18,6 @@ using osu.Game.Configuration; using osu.Game.Extensions; using osu.Game.Graphics.Sprites; using osu.Game.Localisation; -using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Resources.Localisation.Web; namespace osu.Game.Skinning.Components diff --git a/osu.Game/Skinning/Components/TextElement.cs b/osu.Game/Skinning/Components/TextElement.cs index 9adc065b88..c160f3f9d0 100644 --- a/osu.Game/Skinning/Components/TextElement.cs +++ b/osu.Game/Skinning/Components/TextElement.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; namespace osu.Game.Skinning.Components { diff --git a/osu.Game/Skinning/FontAdjustableSkinComponent.cs b/osu.Game/Skinning/FontAdjustableSkinComponent.cs index 51d4aa9fee..9c28621d48 100644 --- a/osu.Game/Skinning/FontAdjustableSkinComponent.cs +++ b/osu.Game/Skinning/FontAdjustableSkinComponent.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; using osu.Game.Graphics; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; namespace osu.Game.Skinning { diff --git a/osu.Game/Skinning/SkinnableSprite.cs b/osu.Game/Skinning/SkinnableSprite.cs index a5ed2a4b64..3deb264bc8 100644 --- a/osu.Game/Skinning/SkinnableSprite.cs +++ b/osu.Game/Skinning/SkinnableSprite.cs @@ -12,7 +12,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; using osu.Game.Overlays.Settings; using osuTK; From 843d9914c49c8c98c93fb7e5e0716e443ac972ab Mon Sep 17 00:00:00 2001 From: tsrk Date: Thu, 2 Feb 2023 08:18:56 +0000 Subject: [PATCH 4/7] quality: remove new line --- osu.Game/Localisation/JudgementCounterDisplayStrings.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Localisation/JudgementCounterDisplayStrings.cs b/osu.Game/Localisation/JudgementCounterDisplayStrings.cs index fbc22e96fd..aeba06b2e7 100644 --- a/osu.Game/Localisation/JudgementCounterDisplayStrings.cs +++ b/osu.Game/Localisation/JudgementCounterDisplayStrings.cs @@ -47,4 +47,3 @@ namespace osu.Game.Localisation private static string getKey(string key) => $"{prefix}:{key}"; } } - From 50559643bbb4f104fda7e7a577afbf26b755bdb3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Feb 2023 15:27:11 +0900 Subject: [PATCH 5/7] Fix incorrectly applied enum localisation --- osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs index 3507987fe4..f380165a66 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs @@ -507,7 +507,7 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.LabelStylesIcons))] Icons, - [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.LabelStylesIcons))] + [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.LabelStylesText))] Text } } From cf8cfe0d2c7678f316faddc77eaff5d787bce6c6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Feb 2023 15:34:57 +0900 Subject: [PATCH 6/7] Move skin component localisations to namespaces --- osu.Game/Localisation/{ => HUD}/BarHitErrorMeterStrings.cs | 4 ++-- osu.Game/Localisation/{ => HUD}/ColourHitErrorMeterStrings.cs | 4 ++-- .../Localisation/{ => HUD}/GameplayAccuracyCounterStrings.cs | 4 ++-- .../Localisation/{ => HUD}/JudgementCounterDisplayStrings.cs | 4 ++-- osu.Game/Localisation/{ => HUD}/SongProgressStrings.cs | 4 ++-- .../{ => SkinComponents}/BeatmapAttributeTextStrings.cs | 4 ++-- .../FontAdjustableSkinComponentStrings.cs | 4 ++-- .../{ => SkinComponents}/SkinnableSpriteStrings.cs | 4 ++-- .../Localisation/{ => SkinComponents}/TextElementStrings.cs | 4 ++-- osu.Game/Screens/Play/HUD/ArgonSongProgress.cs | 2 +- osu.Game/Screens/Play/HUD/DefaultSongProgress.cs | 2 +- osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs | 2 +- osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs | 2 +- .../Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs | 2 +- .../Play/HUD/JudgementCounter/JudgementCounterDisplay.cs | 2 +- osu.Game/Skinning/Components/BeatmapAttributeText.cs | 1 + osu.Game/Skinning/Components/TextElement.cs | 2 +- osu.Game/Skinning/FontAdjustableSkinComponent.cs | 2 +- osu.Game/Skinning/SkinnableSprite.cs | 2 +- 19 files changed, 28 insertions(+), 27 deletions(-) rename osu.Game/Localisation/{ => HUD}/BarHitErrorMeterStrings.cs (98%) rename osu.Game/Localisation/{ => HUD}/ColourHitErrorMeterStrings.cs (97%) rename osu.Game/Localisation/{ => HUD}/GameplayAccuracyCounterStrings.cs (95%) rename osu.Game/Localisation/{ => HUD}/JudgementCounterDisplayStrings.cs (96%) rename osu.Game/Localisation/{ => HUD}/SongProgressStrings.cs (93%) rename osu.Game/Localisation/{ => SkinComponents}/BeatmapAttributeTextStrings.cs (93%) rename osu.Game/Localisation/{ => SkinComponents}/FontAdjustableSkinComponentStrings.cs (88%) rename osu.Game/Localisation/{ => SkinComponents}/SkinnableSpriteStrings.cs (90%) rename osu.Game/Localisation/{ => SkinComponents}/TextElementStrings.cs (90%) diff --git a/osu.Game/Localisation/BarHitErrorMeterStrings.cs b/osu.Game/Localisation/HUD/BarHitErrorMeterStrings.cs similarity index 98% rename from osu.Game/Localisation/BarHitErrorMeterStrings.cs rename to osu.Game/Localisation/HUD/BarHitErrorMeterStrings.cs index 171c3e223e..2f77a287a0 100644 --- a/osu.Game/Localisation/BarHitErrorMeterStrings.cs +++ b/osu.Game/Localisation/HUD/BarHitErrorMeterStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.HUD { public static class BarHitErrorMeterStrings { - private const string prefix = @"osu.Game.Resources.Localisation.BarHitErrorMeter"; + private const string prefix = @"osu.Game.Resources.Localisation.HUD.BarHitErrorMeter"; /// /// "Judgement line thickness" diff --git a/osu.Game/Localisation/ColourHitErrorMeterStrings.cs b/osu.Game/Localisation/HUD/ColourHitErrorMeterStrings.cs similarity index 97% rename from osu.Game/Localisation/ColourHitErrorMeterStrings.cs rename to osu.Game/Localisation/HUD/ColourHitErrorMeterStrings.cs index 13682c9c85..8fdcb34a49 100644 --- a/osu.Game/Localisation/ColourHitErrorMeterStrings.cs +++ b/osu.Game/Localisation/HUD/ColourHitErrorMeterStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.HUD { public static class ColourHitErrorMeterStrings { - private const string prefix = @"osu.Game.Resources.Localisation.ColourHitError"; + private const string prefix = @"osu.Game.Resources.Localisation.HUD.ColourHitError"; /// /// "Judgement count" diff --git a/osu.Game/Localisation/GameplayAccuracyCounterStrings.cs b/osu.Game/Localisation/HUD/GameplayAccuracyCounterStrings.cs similarity index 95% rename from osu.Game/Localisation/GameplayAccuracyCounterStrings.cs rename to osu.Game/Localisation/HUD/GameplayAccuracyCounterStrings.cs index c9e936d8af..ec7f4a1af3 100644 --- a/osu.Game/Localisation/GameplayAccuracyCounterStrings.cs +++ b/osu.Game/Localisation/HUD/GameplayAccuracyCounterStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.HUD { public static class GameplayAccuracyCounterStrings { - private const string prefix = @"osu.Game.Resources.Localisation.GameplayAccuracyCounter"; + private const string prefix = @"osu.Game.Resources.Localisation.HUD.GameplayAccuracyCounter"; /// /// "Accuracy display mode" diff --git a/osu.Game/Localisation/JudgementCounterDisplayStrings.cs b/osu.Game/Localisation/HUD/JudgementCounterDisplayStrings.cs similarity index 96% rename from osu.Game/Localisation/JudgementCounterDisplayStrings.cs rename to osu.Game/Localisation/HUD/JudgementCounterDisplayStrings.cs index aeba06b2e7..b1c756e48e 100644 --- a/osu.Game/Localisation/JudgementCounterDisplayStrings.cs +++ b/osu.Game/Localisation/HUD/JudgementCounterDisplayStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.HUD { public static class JudgementCounterDisplayStrings { - private const string prefix = @"osu.Game.Resources.Localisation.JudgementCounterDisplay"; + private const string prefix = @"osu.Game.Resources.Localisation.HUD.JudgementCounterDisplay"; /// /// "Display mode" diff --git a/osu.Game/Localisation/SongProgressStrings.cs b/osu.Game/Localisation/HUD/SongProgressStrings.cs similarity index 93% rename from osu.Game/Localisation/SongProgressStrings.cs rename to osu.Game/Localisation/HUD/SongProgressStrings.cs index 033560ebb0..4c621e8e8c 100644 --- a/osu.Game/Localisation/SongProgressStrings.cs +++ b/osu.Game/Localisation/HUD/SongProgressStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.HUD { public static class SongProgressStrings { - private const string prefix = @"osu.Game.Resources.Localisation.SongProgress"; + private const string prefix = @"osu.Game.Resources.Localisation.HUD.SongProgress"; /// /// "Show difficulty graph" diff --git a/osu.Game/Localisation/BeatmapAttributeTextStrings.cs b/osu.Game/Localisation/SkinComponents/BeatmapAttributeTextStrings.cs similarity index 93% rename from osu.Game/Localisation/BeatmapAttributeTextStrings.cs rename to osu.Game/Localisation/SkinComponents/BeatmapAttributeTextStrings.cs index 1ceb482cf4..b2e2285faf 100644 --- a/osu.Game/Localisation/BeatmapAttributeTextStrings.cs +++ b/osu.Game/Localisation/SkinComponents/BeatmapAttributeTextStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.SkinComponents { public static class BeatmapAttributeTextStrings { - private const string prefix = @"osu.Game.Resources.Localisation.BeatmapAttributeText"; + private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.BeatmapAttributeText"; /// /// "Attribute" diff --git a/osu.Game/Localisation/FontAdjustableSkinComponentStrings.cs b/osu.Game/Localisation/SkinComponents/FontAdjustableSkinComponentStrings.cs similarity index 88% rename from osu.Game/Localisation/FontAdjustableSkinComponentStrings.cs rename to osu.Game/Localisation/SkinComponents/FontAdjustableSkinComponentStrings.cs index 76f9f2f8b9..8bcc45998a 100644 --- a/osu.Game/Localisation/FontAdjustableSkinComponentStrings.cs +++ b/osu.Game/Localisation/SkinComponents/FontAdjustableSkinComponentStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.SkinComponents { public static class FontAdjustableSkinComponentStrings { - private const string prefix = @"osu.Game.Resources.Localisation.FontAdjustableSkinComponent"; + private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.FontAdjustableSkinComponent"; /// /// "Font" diff --git a/osu.Game/Localisation/SkinnableSpriteStrings.cs b/osu.Game/Localisation/SkinComponents/SkinnableSpriteStrings.cs similarity index 90% rename from osu.Game/Localisation/SkinnableSpriteStrings.cs rename to osu.Game/Localisation/SkinComponents/SkinnableSpriteStrings.cs index 6192f5e43d..f039c9044f 100644 --- a/osu.Game/Localisation/SkinnableSpriteStrings.cs +++ b/osu.Game/Localisation/SkinComponents/SkinnableSpriteStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.SkinComponents { public static class SkinnableSpriteStrings { - private const string prefix = @"osu.Game.Resources.Localisation.SkinnableSprite"; + private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.SkinnableSprite"; /// /// "Sprite name" diff --git a/osu.Game/Localisation/TextElementStrings.cs b/osu.Game/Localisation/SkinComponents/TextElementStrings.cs similarity index 90% rename from osu.Game/Localisation/TextElementStrings.cs rename to osu.Game/Localisation/SkinComponents/TextElementStrings.cs index 6257b80d72..6417c1d923 100644 --- a/osu.Game/Localisation/TextElementStrings.cs +++ b/osu.Game/Localisation/SkinComponents/TextElementStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.SkinComponents { public static class TextElementStrings { - private const string prefix = @"osu.Game.Resources.Localisation.TextElement"; + private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.TextElement"; /// /// "Text" diff --git a/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs b/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs index 6c5ba52f27..9dce8996c3 100644 --- a/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs +++ b/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Configuration; using osu.Game.Graphics; -using osu.Game.Localisation; +using osu.Game.Localisation.HUD; using osu.Game.Rulesets.Objects; namespace osu.Game.Screens.Play.HUD diff --git a/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs b/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs index fccefd49a4..6eed563703 100644 --- a/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs +++ b/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs @@ -7,7 +7,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics; -using osu.Game.Localisation; +using osu.Game.Localisation.HUD; using osu.Game.Rulesets.Objects; using osuTK; diff --git a/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs b/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs index 3a7c97632d..9da032e489 100644 --- a/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs +++ b/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs @@ -6,7 +6,7 @@ using osu.Framework.Bindables; using osu.Framework.Localisation; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; -using osu.Game.Localisation; +using osu.Game.Localisation.HUD; using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Play.HUD diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs index f380165a66..eb5221aa45 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs @@ -17,7 +17,7 @@ using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; -using osu.Game.Localisation; +using osu.Game.Localisation.HUD; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osuTK; diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs index ac49e9ca5e..5793713fca 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs @@ -11,7 +11,7 @@ using osu.Framework.Graphics.Pooling; using osu.Framework.Graphics.Shapes; using osu.Framework.Localisation; using osu.Game.Configuration; -using osu.Game.Localisation; +using osu.Game.Localisation.HUD; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osuTK; diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs index 31b0b9ebc5..80d2e0863f 100644 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs +++ b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Localisation; using osu.Game.Configuration; -using osu.Game.Localisation; +using osu.Game.Localisation.HUD; using osu.Game.Rulesets.Scoring; using osu.Game.Skinning; using osuTK; diff --git a/osu.Game/Skinning/Components/BeatmapAttributeText.cs b/osu.Game/Skinning/Components/BeatmapAttributeText.cs index e8b2d547a9..2c16a67cac 100644 --- a/osu.Game/Skinning/Components/BeatmapAttributeText.cs +++ b/osu.Game/Skinning/Components/BeatmapAttributeText.cs @@ -18,6 +18,7 @@ using osu.Game.Configuration; using osu.Game.Extensions; using osu.Game.Graphics.Sprites; using osu.Game.Localisation; +using osu.Game.Localisation.SkinComponents; using osu.Game.Resources.Localisation.Web; namespace osu.Game.Skinning.Components diff --git a/osu.Game/Skinning/Components/TextElement.cs b/osu.Game/Skinning/Components/TextElement.cs index c160f3f9d0..1e0a0d0ad1 100644 --- a/osu.Game/Skinning/Components/TextElement.cs +++ b/osu.Game/Skinning/Components/TextElement.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Localisation; +using osu.Game.Localisation.SkinComponents; namespace osu.Game.Skinning.Components { diff --git a/osu.Game/Skinning/FontAdjustableSkinComponent.cs b/osu.Game/Skinning/FontAdjustableSkinComponent.cs index 9c28621d48..11d3e36d9e 100644 --- a/osu.Game/Skinning/FontAdjustableSkinComponent.cs +++ b/osu.Game/Skinning/FontAdjustableSkinComponent.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; using osu.Game.Graphics; -using osu.Game.Localisation; +using osu.Game.Localisation.SkinComponents; namespace osu.Game.Skinning { diff --git a/osu.Game/Skinning/SkinnableSprite.cs b/osu.Game/Skinning/SkinnableSprite.cs index 3deb264bc8..31391755a3 100644 --- a/osu.Game/Skinning/SkinnableSprite.cs +++ b/osu.Game/Skinning/SkinnableSprite.cs @@ -12,7 +12,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; -using osu.Game.Localisation; +using osu.Game.Localisation.SkinComponents; using osu.Game.Overlays.Settings; using osuTK; From 92306b912329aec3fdb74a2cf88822b42bf54537 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Feb 2023 16:02:16 +0900 Subject: [PATCH 7/7] Combine localisations for abstract skinnable components into a single file Generally we don't want localisation files with only one to two translations. It makes it harder for translators to handle in crowdin (a lot of file changes for small results). So for cases like this I believe we should be grouping translations where it makes sense. I've left individual components in their own files as I can see potential for more settings to be added in the future. Plus it gives a bit of extra context. --- .../FontAdjustableSkinComponentStrings.cs | 24 ---------- .../SkinnableComponentStrings.cs | 44 +++++++++++++++++++ .../SkinComponents/SkinnableSpriteStrings.cs | 24 ---------- .../SkinComponents/TextElementStrings.cs | 24 ---------- osu.Game/Skinning/Components/TextElement.cs | 2 +- .../Skinning/FontAdjustableSkinComponent.cs | 2 +- osu.Game/Skinning/SkinnableSprite.cs | 2 +- 7 files changed, 47 insertions(+), 75 deletions(-) delete mode 100644 osu.Game/Localisation/SkinComponents/FontAdjustableSkinComponentStrings.cs create mode 100644 osu.Game/Localisation/SkinComponents/SkinnableComponentStrings.cs delete mode 100644 osu.Game/Localisation/SkinComponents/SkinnableSpriteStrings.cs delete mode 100644 osu.Game/Localisation/SkinComponents/TextElementStrings.cs diff --git a/osu.Game/Localisation/SkinComponents/FontAdjustableSkinComponentStrings.cs b/osu.Game/Localisation/SkinComponents/FontAdjustableSkinComponentStrings.cs deleted file mode 100644 index 8bcc45998a..0000000000 --- a/osu.Game/Localisation/SkinComponents/FontAdjustableSkinComponentStrings.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) ppy Pty Ltd . 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.SkinComponents -{ - public static class FontAdjustableSkinComponentStrings - { - private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.FontAdjustableSkinComponent"; - - /// - /// "Font" - /// - public static LocalisableString Font => new TranslatableString(getKey(@"font"), "Font"); - - /// - /// "The font to use." - /// - public static LocalisableString FontDescription => new TranslatableString(getKey(@"font_description"), "The font to use."); - - private static string getKey(string key) => $"{prefix}:{key}"; - } -} diff --git a/osu.Game/Localisation/SkinComponents/SkinnableComponentStrings.cs b/osu.Game/Localisation/SkinComponents/SkinnableComponentStrings.cs new file mode 100644 index 0000000000..547df86fc7 --- /dev/null +++ b/osu.Game/Localisation/SkinComponents/SkinnableComponentStrings.cs @@ -0,0 +1,44 @@ +// Copyright (c) ppy Pty Ltd . 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.SkinComponents +{ + public static class SkinnableComponentStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.SkinnableComponentStrings"; + + /// + /// "Sprite name" + /// + public static LocalisableString SpriteName => new TranslatableString(getKey(@"sprite_name"), "Sprite name"); + + /// + /// "The filename of the sprite" + /// + public static LocalisableString SpriteNameDescription => new TranslatableString(getKey(@"sprite_name_description"), "The filename of the sprite"); + + /// + /// "Font" + /// + public static LocalisableString Font => new TranslatableString(getKey(@"font"), "Font"); + + /// + /// "The font to use." + /// + public static LocalisableString FontDescription => new TranslatableString(getKey(@"font_description"), "The font to use."); + + /// + /// "Text" + /// + public static LocalisableString TextElementText => new TranslatableString(getKey(@"text_element_text"), "Text"); + + /// + /// "The text to be displayed." + /// + public static LocalisableString TextElementTextDescription => new TranslatableString(getKey(@"text_element_text_description"), "The text to be displayed."); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinComponents/SkinnableSpriteStrings.cs b/osu.Game/Localisation/SkinComponents/SkinnableSpriteStrings.cs deleted file mode 100644 index f039c9044f..0000000000 --- a/osu.Game/Localisation/SkinComponents/SkinnableSpriteStrings.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) ppy Pty Ltd . 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.SkinComponents -{ - public static class SkinnableSpriteStrings - { - private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.SkinnableSprite"; - - /// - /// "Sprite name" - /// - public static LocalisableString SpriteName => new TranslatableString(getKey(@"sprite_name"), "Sprite name"); - - /// - /// "The filename of the sprite" - /// - public static LocalisableString SpriteNameDescription => new TranslatableString(getKey(@"sprite_name_description"), "The filename of the sprite"); - - private static string getKey(string key) => $"{prefix}:{key}"; - } -} diff --git a/osu.Game/Localisation/SkinComponents/TextElementStrings.cs b/osu.Game/Localisation/SkinComponents/TextElementStrings.cs deleted file mode 100644 index 6417c1d923..0000000000 --- a/osu.Game/Localisation/SkinComponents/TextElementStrings.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) ppy Pty Ltd . 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.SkinComponents -{ - public static class TextElementStrings - { - private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.TextElement"; - - /// - /// "Text" - /// - public static LocalisableString TextElementText => new TranslatableString(getKey(@"text_element_text"), "Text"); - - /// - /// "The text to be displayed." - /// - public static LocalisableString TextElementTextDescription => new TranslatableString(getKey(@"text_element_text_description"), "The text to be displayed."); - - private static string getKey(string key) => $"{prefix}:{key}"; - } -} diff --git a/osu.Game/Skinning/Components/TextElement.cs b/osu.Game/Skinning/Components/TextElement.cs index 1e0a0d0ad1..936f6a529b 100644 --- a/osu.Game/Skinning/Components/TextElement.cs +++ b/osu.Game/Skinning/Components/TextElement.cs @@ -15,7 +15,7 @@ namespace osu.Game.Skinning.Components [UsedImplicitly] public partial class TextElement : FontAdjustableSkinComponent { - [SettingSource(typeof(TextElementStrings), nameof(TextElementStrings.TextElementText), nameof(TextElementStrings.TextElementTextDescription))] + [SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.TextElementText), nameof(SkinnableComponentStrings.TextElementTextDescription))] public Bindable Text { get; } = new Bindable("Circles!"); private readonly OsuSpriteText text; diff --git a/osu.Game/Skinning/FontAdjustableSkinComponent.cs b/osu.Game/Skinning/FontAdjustableSkinComponent.cs index 11d3e36d9e..2e41b35abb 100644 --- a/osu.Game/Skinning/FontAdjustableSkinComponent.cs +++ b/osu.Game/Skinning/FontAdjustableSkinComponent.cs @@ -17,7 +17,7 @@ namespace osu.Game.Skinning { public bool UsesFixedAnchor { get; set; } - [SettingSource(typeof(FontAdjustableSkinComponentStrings), nameof(FontAdjustableSkinComponentStrings.Font), nameof(FontAdjustableSkinComponentStrings.FontDescription))] + [SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.Font), nameof(SkinnableComponentStrings.FontDescription))] public Bindable Font { get; } = new Bindable(Typeface.Torus); /// diff --git a/osu.Game/Skinning/SkinnableSprite.cs b/osu.Game/Skinning/SkinnableSprite.cs index 31391755a3..c3449562c3 100644 --- a/osu.Game/Skinning/SkinnableSprite.cs +++ b/osu.Game/Skinning/SkinnableSprite.cs @@ -28,7 +28,7 @@ namespace osu.Game.Skinning [Resolved] private TextureStore textures { get; set; } = null!; - [SettingSource(typeof(SkinnableSpriteStrings), nameof(SkinnableSpriteStrings.SpriteName), nameof(SkinnableSpriteStrings.SpriteNameDescription), SettingControlType = typeof(SpriteSelectorControl))] + [SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.SpriteName), nameof(SkinnableComponentStrings.SpriteNameDescription), SettingControlType = typeof(SpriteSelectorControl))] public Bindable SpriteName { get; } = new Bindable(string.Empty); [Resolved]