Skip to content

Commit

Permalink
Move dialog strings to more common class name
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed May 31, 2024
1 parent e52f524 commit 5dfeaa3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

namespace osu.Game.Localisation
{
public static class DeleteConfirmationDialogStrings
public static class DialogStrings
{
private const string prefix = @"osu.Game.Resources.Localisation.DeleteConfirmationDialog";
private const string prefix = @"osu.Game.Resources.Localisation.DialogStrings";

/// <summary>
/// "Caution"
/// </summary>
public static LocalisableString HeaderText => new TranslatableString(getKey(@"header_text"), @"Caution");
public static LocalisableString Caution => new TranslatableString(getKey(@"header_text"), @"Caution");

/// <summary>
/// "Yes. Go for it."
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Online/Chat/ExternalLinkOpener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public partial class ExternalLinkDialog : PopupDialog
{
public ExternalLinkDialog(string url, Action openExternalLinkAction, Action copyExternalLinkAction)
{
HeaderText = DeleteConfirmationDialogStrings.HeaderText;
HeaderText = DialogStrings.Caution;
BodyText = $"Are you sure you want to open the following link in a web browser?\n\n{url}";

Icon = FontAwesome.Solid.ExclamationTriangle;
Expand Down
6 changes: 3 additions & 3 deletions osu.Game/Overlays/Dialog/DangerousActionDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ public abstract partial class DangerousActionDialog : PopupDialog

protected DangerousActionDialog()
{
HeaderText = DeleteConfirmationDialogStrings.HeaderText;
HeaderText = DialogStrings.DialogCautionHeader;

Icon = FontAwesome.Regular.TrashAlt;

Buttons = new PopupDialogButton[]
{
new PopupDialogDangerousButton
{
Text = DeleteConfirmationDialogStrings.Confirm,
Text = DialogStrings.DialogConfirm,
Action = () => DangerousAction?.Invoke()
},
new PopupDialogCancelButton
{
Text = DeleteConfirmationDialogStrings.Cancel,
Text = DialogStrings.Cancel,
Action = () => CancelAction?.Invoke()
}
};
Expand Down

0 comments on commit 5dfeaa3

Please sign in to comment.