mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 16:02:55 +08:00
Merge pull request #20709 from Domilz/toolbar-localisation
Localise toolbar home button and ruleset description tooltips
This commit is contained in:
commit
c799375ae0
@ -19,6 +19,21 @@ namespace osu.Game.Localisation
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString Connecting => new TranslatableString(getKey(@"connecting"), @"Connecting...");
|
public static LocalisableString Connecting => new TranslatableString(getKey(@"connecting"), @"Connecting...");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "home"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString HomeHeaderTitle => new TranslatableString(getKey(@"home_header_title"), @"home");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "return to the main menu"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString HomeHeaderDescription => new TranslatableString(getKey(@"home_header_description"), @"return to the main menu");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "play some {0}"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString PlaySomeRuleset(string arg0) => new TranslatableString(getKey(@"play_some_ruleset"), @"play some {0}", arg0);
|
||||||
|
|
||||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Game.Input.Bindings;
|
using osu.Game.Input.Bindings;
|
||||||
|
using osu.Game.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Toolbar
|
namespace osu.Game.Overlays.Toolbar
|
||||||
{
|
{
|
||||||
@ -19,8 +20,8 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
TooltipMain = "home";
|
TooltipMain = ToolbarStrings.HomeHeaderTitle;
|
||||||
TooltipSub = "return to the main menu";
|
TooltipSub = ToolbarStrings.HomeHeaderDescription;
|
||||||
SetIcon("Icons/Hexacons/home");
|
SetIcon("Icons/Hexacons/home");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,12 +3,13 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Effects;
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Game.Localisation;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Input.Events;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Toolbar
|
namespace osu.Game.Overlays.Toolbar
|
||||||
{
|
{
|
||||||
@ -29,7 +30,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
var rInstance = value.CreateInstance();
|
var rInstance = value.CreateInstance();
|
||||||
|
|
||||||
ruleset.TooltipMain = rInstance.Description;
|
ruleset.TooltipMain = rInstance.Description;
|
||||||
ruleset.TooltipSub = $"play some {rInstance.Description}";
|
ruleset.TooltipSub = ToolbarStrings.PlaySomeRuleset(rInstance.Description);
|
||||||
ruleset.SetIcon(rInstance.CreateIcon());
|
ruleset.SetIcon(rInstance.CreateIcon());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user