From a45965637d0cd0095937e4f42940c256ff44cd44 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 20 Jul 2024 11:49:08 +0300 Subject: [PATCH] use gettext cover for defaults --- src/Abstract/Entity/Button.php | 2 +- src/Abstract/Entity/Entry.php | 4 ++-- src/Entity/Browser/Container/Page/Title.php | 12 ++++++------ src/Entity/Browser/Header/Navigation.php | 2 +- src/Entity/Browser/Header/Tab.php | 4 ++-- src/Entity/Browser/Menu/Tab/Add.php | 4 ++-- src/Entity/Browser/Menu/Tab/Close.php | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Abstract/Entity/Button.php b/src/Abstract/Entity/Button.php index febf8c8..adbe8a4 100644 --- a/src/Abstract/Entity/Button.php +++ b/src/Abstract/Entity/Button.php @@ -20,7 +20,7 @@ abstract class Button ); $this->gtk->set_label( - $this->_label + _($this->_label) ); // Render diff --git a/src/Abstract/Entity/Entry.php b/src/Abstract/Entity/Entry.php index c10c59e..53633a3 100644 --- a/src/Abstract/Entity/Entry.php +++ b/src/Abstract/Entity/Entry.php @@ -19,7 +19,7 @@ abstract class Entry $this->gtk = new \GtkEntry; $this->gtk->set_placeholder_text( - $this->_placeholder + _($this->_placeholder) ); $this->gtk->set_max_length( @@ -27,7 +27,7 @@ abstract class Entry ); $this->gtk->set_text( - $this->_value + _($this->_value) ); $this->gtk->set_visibility( diff --git a/src/Entity/Browser/Container/Page/Title.php b/src/Entity/Browser/Container/Page/Title.php index 2d16a1c..578bd44 100644 --- a/src/Entity/Browser/Container/Page/Title.php +++ b/src/Entity/Browser/Container/Page/Title.php @@ -19,9 +19,9 @@ class Title // Defaults private int $_ellipsize = 3; private int $_length = 16; - private ?string $_value = 'New page'; - private ?string $_subtitle = null; - private ?string $_tooltip = null; + private string $_value = 'New page'; + private string $_subtitle = ''; + private string $_tooltip = ''; public function __construct( Page $page, @@ -68,7 +68,7 @@ class Title ): void { $this->gtk->set_text( - is_null($value) ? $this->_value : trim( + is_null($value) ? _($this->_value) : trim( $value ) ); @@ -78,7 +78,7 @@ class Title ?string $subtitle = null ): void { - $this->subtitle = is_null($subtitle) ? $this->_subtitle : strtolower( + $this->subtitle = is_null($subtitle) ? _($this->_subtitle) : strtolower( trim( $subtitle ) @@ -90,7 +90,7 @@ class Title ): void { $this->gtk->set_tooltip_text( - is_null($tooltip) ? $this->_tooltip : trim( + is_null($tooltip) ? _($this->_tooltip) : trim( $tooltip ) ); diff --git a/src/Entity/Browser/Header/Navigation.php b/src/Entity/Browser/Header/Navigation.php index c4c1cec..17a6abb 100644 --- a/src/Entity/Browser/Header/Navigation.php +++ b/src/Entity/Browser/Header/Navigation.php @@ -30,7 +30,7 @@ class Navigation $this->gtk = new \GtkMenuButton; $this->gtk->set_tooltip_text( - $this->_tooltip + _($this->_tooltip) ); // Init menu diff --git a/src/Entity/Browser/Header/Tab.php b/src/Entity/Browser/Header/Tab.php index 1eef926..780da06 100644 --- a/src/Entity/Browser/Header/Tab.php +++ b/src/Entity/Browser/Header/Tab.php @@ -27,11 +27,11 @@ class Tab $this->gtk = new \GtkButton; $this->gtk->set_label( - $this->_label + _($this->_label) ); $this->gtk->set_tooltip_text( - $this->_tooltip + _($this->_tooltip) ); // Render diff --git a/src/Entity/Browser/Menu/Tab/Add.php b/src/Entity/Browser/Menu/Tab/Add.php index 2e46d70..8096dac 100644 --- a/src/Entity/Browser/Menu/Tab/Add.php +++ b/src/Entity/Browser/Menu/Tab/Add.php @@ -25,11 +25,11 @@ class Add // Init menu item $this->gtk = \GtkMenuItem::new_with_label( - $this->_label + _($this->_label) ); $this->gtk->set_tooltip_text( - $this->_tooltip + _($this->_tooltip) ); // Render diff --git a/src/Entity/Browser/Menu/Tab/Close.php b/src/Entity/Browser/Menu/Tab/Close.php index 44fe90d..3e25850 100644 --- a/src/Entity/Browser/Menu/Tab/Close.php +++ b/src/Entity/Browser/Menu/Tab/Close.php @@ -25,11 +25,11 @@ class Close // Init menu item $this->gtk = \GtkMenuItem::new_with_label( - $this->_label + _($this->_label) ); $this->gtk->set_tooltip_text( - $this->_tooltip + _($this->_tooltip) ); // Render