1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 15:22:55 +08:00

Add localisation for ChangelogHeader

This commit is contained in:
kj415j45 2021-07-18 01:35:54 +08:00
parent 1b4bff0d9f
commit 53fe61504c
2 changed files with 27 additions and 6 deletions

View 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}";
}
}

View File

@ -9,7 +9,9 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Localisation;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Changelog
{
@ -21,16 +23,16 @@ namespace osu.Game.Overlays.Changelog
public ChangelogUpdateStreamControl Streams;
private const string listing_string = "listing";
public LocalisableString ListingString => LayoutStrings.HeaderChangelogIndex;
private Box streamsBackground;
public ChangelogHeader()
{
TabControl.AddItem(listing_string);
TabControl.AddItem(ListingString);
Current.ValueChanged += e =>
{
if (e.NewValue == listing_string)
if (e.NewValue == ListingString)
ListingSelected?.Invoke();
};
@ -63,7 +65,7 @@ namespace osu.Game.Overlays.Changelog
}
else
{
Current.Value = listing_string;
Current.Value = ListingString;
Streams.Current.Value = null;
}
}
@ -114,8 +116,8 @@ namespace osu.Game.Overlays.Changelog
{
public ChangelogHeaderTitle()
{
Title = "changelog";
Description = "track recent dev updates in the osu! ecosystem";
Title = LayoutStrings.MenuHomeChangelogIndex;
Description = osu.Game.Localisation.ChangelogStrings.HeaderDescription;
IconTexture = "Icons/Hexacons/devtools";
}
}