1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:22:55 +08:00

Localise dashboard overlay header.

This commit is contained in:
Lucas A 2021-06-30 20:28:27 +02:00
parent 181243d7ce
commit 285c49be7e

View File

@ -1,7 +1,10 @@
// 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 System;
using System.ComponentModel;
using osu.Framework.Localisation;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Dashboard
{
@ -13,13 +16,14 @@ namespace osu.Game.Overlays.Dashboard
{
public DashboardTitle()
{
Title = "dashboard";
Title = HomeStrings.UserTitle;
Description = "view your friends and other information";
IconTexture = "Icons/Hexacons/social";
}
}
}
[LocalisableEnum(typeof(DashboardOverlayTabsEnumLocalisationMapper))]
public enum DashboardOverlayTabs
{
Friends,
@ -27,4 +31,22 @@ namespace osu.Game.Overlays.Dashboard
[Description("Currently Playing")]
CurrentlyPlaying
}
public class DashboardOverlayTabsEnumLocalisationMapper : EnumLocalisationMapper<DashboardOverlayTabs>
{
public override LocalisableString Map(DashboardOverlayTabs value)
{
switch (value)
{
case DashboardOverlayTabs.Friends:
return FriendsStrings.TitleCompact;
case DashboardOverlayTabs.CurrentlyPlaying:
return @"Currently Playing";
default:
throw new ArgumentOutOfRangeException(nameof(value), value, null);
}
}
}
}