1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 15:17:27 +08:00

Localise common game notifications

This commit is contained in:
Bastian Pedersen 2023-06-27 20:56:35 +02:00
parent 9b08aaf93f
commit 37ee3a7bbd
2 changed files with 30 additions and 5 deletions

View File

@ -63,6 +63,31 @@ Please try changing your audio device to a working setting.");
/// </summary>
public static LocalisableString ScoreOverlayDisabled(LocalisableString arg0) => new TranslatableString(getKey(@"score_overlay_disabled"), @"The score overlay is currently disabled. You can toggle this by pressing {0}.", arg0);
/// <summary>
/// "The URL {0} has an unsupported or dangerous protocol and will not be opened"
/// </summary>
public static LocalisableString UnsupportedOrDangerousUrlProtocol(string url) => new TranslatableString(getKey(@"unsupported_or_dangerous_url_protocol"), @"The URL {0} has an unsupported or dangerous protocol and will not be opened.", url);
/// <summary>
/// "Subsequent messages have been logged. Click to view log files"
/// </summary>
public static LocalisableString SubsequentMessagesLogged => new TranslatableString(getKey(@"subsequent_messages_logged"), @"Subsequent messages have been logged. Click to view log files");
/// <summary>
/// "Disabling tablet support due to error: &quot;{0}&quot;"
/// </summary>
public static LocalisableString TabletSupportDisabledDueToError(string message) => new TranslatableString(getKey(@"tablet_support_disabled_due_to_error"), @"Disabling tablet support due to error: ""{0}""", message);
/// <summary>
/// "Encountered tablet warning, your tablet may not function correctly. Click here for a list of all tablets supported."
/// </summary>
public static LocalisableString EncounteredTabletWarning => new TranslatableString(getKey(@"encountered_tablet_warning"), @"Encountered tablet warning, your tablet may not function correctly. Click here for a list of all tablets supported.");
/// <summary>
/// "This link type is not yet supported!"
/// </summary>
public static LocalisableString LinkTypeNotSupported => new TranslatableString(getKey(@"unsupported_link_type"), @"This link type is not yet supported!");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@ -435,7 +435,7 @@ namespace osu.Game
case LinkAction.Spectate:
waitForReady(() => Notifications, _ => Notifications.Post(new SimpleNotification
{
Text = @"This link type is not yet supported!",
Text = NotificationsStrings.LinkTypeNotSupported,
Icon = FontAwesome.Solid.LifeRing,
}));
break;
@ -477,7 +477,7 @@ namespace osu.Game
{
Notifications.Post(new SimpleErrorNotification
{
Text = $"The URL {url} has an unsupported or dangerous protocol and will not be opened.",
Text = NotificationsStrings.UnsupportedOrDangerousUrlProtocol(url),
});
return;
@ -1147,7 +1147,7 @@ namespace osu.Game
Schedule(() => Notifications.Post(new SimpleNotification
{
Icon = FontAwesome.Solid.EllipsisH,
Text = "Subsequent messages have been logged. Click to view log files.",
Text = NotificationsStrings.SubsequentMessagesLogged,
Activated = () =>
{
Storage.GetStorageForDirectory(@"logs").PresentFileExternally(logFile);
@ -1179,7 +1179,7 @@ namespace osu.Game
{
Notifications.Post(new SimpleNotification
{
Text = $"Disabling tablet support due to error: \"{message}\"",
Text = NotificationsStrings.TabletSupportDisabledDueToError(message),
Icon = FontAwesome.Solid.PenSquare,
IconColour = Colours.RedDark,
});
@ -1196,7 +1196,7 @@ namespace osu.Game
{
Schedule(() => Notifications.Post(new SimpleNotification
{
Text = @"Encountered tablet warning, your tablet may not function correctly. Click here for a list of all tablets supported.",
Text = NotificationsStrings.EncounteredTabletWarning,
Icon = FontAwesome.Solid.PenSquare,
IconColour = Colours.YellowDark,
Activated = () =>