From 2bb12d5339c5dcd67777c90bdd3868d6e206a457 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 28 Jul 2024 04:04:48 +0300 Subject: [PATCH] define strings preset --- src/Entity/Browser/Menu/File/Open.php | 10 +++++++--- src/Entity/Browser/Menu/File/Save.php | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/Entity/Browser/Menu/File/Open.php b/src/Entity/Browser/Menu/File/Open.php index 0116d330..a49073f6 100644 --- a/src/Entity/Browser/Menu/File/Open.php +++ b/src/Entity/Browser/Menu/File/Open.php @@ -29,6 +29,10 @@ class Open '*.gmi' => null ]; + public const DIALOG_TITLE = 'Open file'; + public const DIALOG_BUTTON_CANCEL = 'Cancel'; + public const DIALOG_BUTTON_OPEN = 'Open'; + public function __construct( File $file ) { @@ -49,13 +53,13 @@ class Open function() { $dialog = new GtkFileChooserDialog( - 'Open file', + _($this::DIALOG_TITLE), $this->file->menu->browser->gtk, GtkFileChooserAction::OPEN, [ - 'Cancel', + _($this::DIALOG_BUTTON_CANCEL), GtkResponseType::CANCEL, - 'Open', + _($this::DIALOG_BUTTON_OPEN), GtkResponseType::OK ] ); diff --git a/src/Entity/Browser/Menu/File/Save.php b/src/Entity/Browser/Menu/File/Save.php index e9bf360e..0c78c730 100644 --- a/src/Entity/Browser/Menu/File/Save.php +++ b/src/Entity/Browser/Menu/File/Save.php @@ -22,6 +22,10 @@ class Save // Defaults public const LABEL = 'Save As..'; + public const DIALOG_TITLE = 'Save to file'; + public const DIALOG_BUTTON_CANCEL = 'Cancel'; + public const DIALOG_BUTTON_SAVE = 'Save'; + public function __construct( File $file ) { @@ -42,13 +46,13 @@ class Save function() { $dialog = new GtkFileChooserDialog( - 'Save to file', + _($this::DIALOG_TITLE), $this->file->menu->browser->gtk, GtkFileChooserAction::SAVE, [ - 'Cancel', + _($this::DIALOG_BUTTON_CANCEL), GtkResponseType::CANCEL, - 'Save', + _($this::DIALOG_BUTTON_SAVE), GtkResponseType::APPLY ] );