mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 14:03:01 +08:00
Add localisation for ChangelogHeader
This commit is contained in:
parent
1b4bff0d9f
commit
53fe61504c
19
osu.Game/Localisation/ChangelogStrings.cs
Normal file
19
osu.Game/Localisation/ChangelogStrings.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// 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 static class ChangelogStrings
|
||||||
|
{
|
||||||
|
private const string prefix = @"osu.Game.Resources.Localisation.Changelog";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "track recent dev updates in the osu! ecosystem"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString HeaderDescription => new TranslatableString(getKey(@"header_description"), @"track recent dev updates in the osu! ecosystem");
|
||||||
|
|
||||||
|
private static string getKey(string key) => $"{prefix}:{key}";
|
||||||
|
}
|
||||||
|
}
|
@ -9,7 +9,9 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
|
using osu.Game.Resources.Localisation.Web;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Changelog
|
namespace osu.Game.Overlays.Changelog
|
||||||
{
|
{
|
||||||
@ -21,16 +23,16 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
|
|
||||||
public ChangelogUpdateStreamControl Streams;
|
public ChangelogUpdateStreamControl Streams;
|
||||||
|
|
||||||
private const string listing_string = "listing";
|
public LocalisableString ListingString => LayoutStrings.HeaderChangelogIndex;
|
||||||
|
|
||||||
private Box streamsBackground;
|
private Box streamsBackground;
|
||||||
|
|
||||||
public ChangelogHeader()
|
public ChangelogHeader()
|
||||||
{
|
{
|
||||||
TabControl.AddItem(listing_string);
|
TabControl.AddItem(ListingString);
|
||||||
Current.ValueChanged += e =>
|
Current.ValueChanged += e =>
|
||||||
{
|
{
|
||||||
if (e.NewValue == listing_string)
|
if (e.NewValue == ListingString)
|
||||||
ListingSelected?.Invoke();
|
ListingSelected?.Invoke();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -63,7 +65,7 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Current.Value = listing_string;
|
Current.Value = ListingString;
|
||||||
Streams.Current.Value = null;
|
Streams.Current.Value = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -114,8 +116,8 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
{
|
{
|
||||||
public ChangelogHeaderTitle()
|
public ChangelogHeaderTitle()
|
||||||
{
|
{
|
||||||
Title = "changelog";
|
Title = LayoutStrings.MenuHomeChangelogIndex;
|
||||||
Description = "track recent dev updates in the osu! ecosystem";
|
Description = osu.Game.Localisation.ChangelogStrings.HeaderDescription;
|
||||||
IconTexture = "Icons/Hexacons/devtools";
|
IconTexture = "Icons/Hexacons/devtools";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user