mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Fix incorrectly implemented localisation
This commit is contained in:
@ -100,14 +100,14 @@ namespace osu.Game.Localisation
|
|||||||
public static LocalisableString TimelineTicks => new TranslatableString(getKey(@"timeline_ticks"), @"Ticks");
|
public static LocalisableString TimelineTicks => new TranslatableString(getKey(@"timeline_ticks"), @"Ticks");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "0.0°"
|
/// "{0:0.0}°"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString RotationFormatUnsnapped => new TranslatableString(getKey(@"rotation_format_unsnapped"), @"0.0°");
|
public static LocalisableString RotationUnsnapped(float newRotation) => new TranslatableString(getKey(@"rotation_unsnapped"), @"{0:0.0}°", newRotation);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "0.0° (snapped)"
|
/// "{0:0.0}° (snapped)"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString RotationFormatSnapped => new TranslatableString(getKey(@"rotation_format_snapped"), @"0.0° (snapped)");
|
public static LocalisableString RotationSnapped(float newRotation) => new TranslatableString(getKey(@"rotation_snapped"), @"{0:0.0}° (snapped)", newRotation);
|
||||||
|
|
||||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ using System;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.EnumExtensions;
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Framework.Extensions.LocalisationExtensions;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
@ -125,8 +124,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
cumulativeRotation.Value = newRotation;
|
cumulativeRotation.Value = newRotation;
|
||||||
|
|
||||||
HandleRotate?.Invoke(newRotation - oldRotation);
|
HandleRotate?.Invoke(newRotation - oldRotation);
|
||||||
string tooltipFormat = shouldSnap ? EditorStrings.RotationFormatSnapped.ToString() : EditorStrings.RotationFormatUnsnapped.ToString();
|
TooltipText = shouldSnap ? EditorStrings.RotationSnapped(newRotation) : EditorStrings.RotationUnsnapped(newRotation);
|
||||||
TooltipText = newRotation.ToLocalisableString(tooltipFormat);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private float snap(float value, float step) => MathF.Round(value / step) * step;
|
private float snap(float value, float step) => MathF.Round(value / step) * step;
|
||||||
|
Reference in New Issue
Block a user