1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Add localisation for RankingOverlay

This commit is contained in:
kj415j45 2021-07-18 02:15:14 +08:00
parent 53fe61504c
commit 224c37bdc3

View File

@ -1,9 +1,12 @@
// 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 osu.Framework.Graphics;
using osu.Framework.Bindables;
using osu.Framework.Localisation;
using osu.Game.Rulesets;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Users;
namespace osu.Game.Overlays.Rankings
@ -29,13 +32,14 @@ namespace osu.Game.Overlays.Rankings
{
public RankingsTitle()
{
Title = "ranking";
Title = LayoutStrings.MenuRankingsDefault;
Description = "find out who's the best right now";
IconTexture = "Icons/Hexacons/rankings";
}
}
}
[LocalisableEnum(typeof(RankingsScopeEnumLocalisationMapper))]
public enum RankingsScope
{
Performance,
@ -43,4 +47,29 @@ namespace osu.Game.Overlays.Rankings
Score,
Country
}
public class RankingsScopeEnumLocalisationMapper : EnumLocalisationMapper<RankingsScope>
{
public override LocalisableString Map(RankingsScope value)
{
switch (value)
{
case RankingsScope.Performance:
return LayoutStrings.MenuRankingsIndex;
case RankingsScope.Spotlights:
return LayoutStrings.MenuRankingsCharts;
case RankingsScope.Score:
return LayoutStrings.MenuRankingsScore;
case RankingsScope.Country:
return LayoutStrings.MenuRankingsCountry;
default:
throw new ArgumentOutOfRangeException(nameof(value), value, null);
}
}
}
}