Localise detail buttons.

This commit is contained in:
Lucas A
2021-08-07 18:27:55 +02:00
parent 7bbc917f75
commit fc48696718
3 changed files with 34 additions and 7 deletions

View File

@ -15,9 +15,11 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Online;
using osu.Game.Online.API;
using osu.Game.Overlays.BeatmapListing.Panels;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Users;
using osuTK;
using osuTK.Graphics;
using osu.Game.Localisation;
namespace osu.Game.Overlays.BeatmapSet.Buttons
{
@ -27,7 +29,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
private readonly bool noVideo;
public LocalisableString TooltipText => button.Enabled.Value ? "download this beatmap" : "login to download";
public LocalisableString TooltipText => button.Enabled.Value ? BeatmapsetsStrings.ShowDetailsDownloadDefault : BeatmapsetsStrings.ShowDetailsLoggedOut;
private readonly IBindable<User> localUser = new Bindable<User>();
@ -113,7 +115,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
{
new OsuSpriteText
{
Text = "Downloading...",
Text = DownloadButtonStrings.Downloading,
Font = OsuFont.GetFont(size: text_size, weight: FontWeight.Bold)
},
};
@ -124,7 +126,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
{
new OsuSpriteText
{
Text = "Importing...",
Text = DownloadButtonStrings.Importing,
Font = OsuFont.GetFont(size: text_size, weight: FontWeight.Bold)
},
};
@ -139,7 +141,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
{
new OsuSpriteText
{
Text = "Download",
Text = BeatmapsetsStrings.ShowDetailsDownloadDefault,
Font = OsuFont.GetFont(size: text_size, weight: FontWeight.Bold)
},
new OsuSpriteText
@ -158,12 +160,12 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
private void enabledChanged(ValueChangedEvent<bool> e) => this.FadeColour(e.NewValue ? Color4.White : Color4.Gray, 200, Easing.OutQuint);
private string getVideoSuffixText()
private LocalisableString getVideoSuffixText()
{
if (!BeatmapSet.Value.OnlineInfo.HasVideo)
return string.Empty;
return noVideo ? "without Video" : "with Video";
return noVideo ? BeatmapsetsStrings.ShowDetailsDownloadNoVideo : BeatmapsetsStrings.ShowDetailsDownloadVideo;
}
}
}