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

Use existing localised error message

This commit is contained in:
Dean Herbert 2022-08-03 20:15:42 +09:00
parent 7354f9e6ba
commit d3954fc583
2 changed files with 4 additions and 3 deletions

View File

@ -112,7 +112,7 @@ namespace osu.Game.Database
if (error is WebException webException && webException.Message == @"TooManyRequests") if (error is WebException webException && webException.Message == @"TooManyRequests")
{ {
notification.Close(); notification.Close();
PostNotification?.Invoke(new TooManyDownloadsNotification(importer.HumanisedModelName)); PostNotification?.Invoke(new TooManyDownloadsNotification());
} }
else else
Logger.Error(error, $"{importer.HumanisedModelName.Titleize()} download failed!"); Logger.Error(error, $"{importer.HumanisedModelName.Titleize()} download failed!");

View File

@ -5,14 +5,15 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Database namespace osu.Game.Database
{ {
public class TooManyDownloadsNotification : SimpleNotification public class TooManyDownloadsNotification : SimpleNotification
{ {
public TooManyDownloadsNotification(string humanisedModelName) public TooManyDownloadsNotification()
{ {
Text = $"You have downloaded too many {humanisedModelName}s! Please try again later."; Text = BeatmapsetsStrings.DownloadLimitExceeded;
Icon = FontAwesome.Solid.ExclamationCircle; Icon = FontAwesome.Solid.ExclamationCircle;
} }