Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localise common game notifications #24064

Merged
merged 3 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions osu.Game/Localisation/NotificationsStrings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,31 @@ public static class NotificationsStrings
/// </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}";
}
}
10 changes: 5 additions & 5 deletions osu.Game/OsuGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public void HandleLink(LinkDetails link) => Schedule(() =>
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;
Expand Down Expand Up @@ -477,7 +477,7 @@ public void OpenUrlExternally(string url, bool bypassExternalUrlWarning = false)
{
Notifications.Post(new SimpleErrorNotification
{
Text = $"The URL {url} has an unsupported or dangerous protocol and will not be opened.",
Text = NotificationsStrings.UnsupportedOrDangerousUrlProtocol(url),
});

return;
Expand Down Expand Up @@ -1147,7 +1147,7 @@ private void forwardGeneralLogsToNotifications()
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);
Expand Down Expand Up @@ -1179,7 +1179,7 @@ private void forwardTabletLogsToNotifications()
{
Notifications.Post(new SimpleNotification
{
Text = $"Disabling tablet support due to error: \"{message}\"",
Text = NotificationsStrings.TabletSupportDisabledDueToError(message),
Icon = FontAwesome.Solid.PenSquare,
IconColour = Colours.RedDark,
});
Expand All @@ -1196,7 +1196,7 @@ private void forwardTabletLogsToNotifications()
{
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 = () =>
Expand Down