From b7718e87968c00ffa5437166daf28810c1390c93 Mon Sep 17 00:00:00 2001 From: Luis Caparroz Date: Mon, 3 Mar 2025 12:44:34 +0100 Subject: [PATCH 1/3] fix: Mark strings for translation Mark strings that previously were not marked for translation, making the UI show text partially in English and partially on another language on some dialogs. Changed shared dialog classes to assume instance variables holds already localized strings, no need to further call gettext functions on them. This means classes that inherit these shared ones should no longer use 'N_(...)', but instead '_(...)'. Refs: bsc#1127676 --- .../rmt/maria_db/current_root_password_dialog.rb | 7 ++++--- src/lib/rmt/maria_db/new_root_password_dialog.rb | 7 ++++--- src/lib/rmt/shared/input_password_dialog.rb | 6 +++--- src/lib/rmt/shared/set_password_dialog.rb | 14 +++++--------- src/lib/rmt/ssl/current_ca_password_dialog.rb | 7 ++++--- src/lib/rmt/ssl/new_ca_password_dialog.rb | 7 ++++--- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/lib/rmt/maria_db/current_root_password_dialog.rb b/src/lib/rmt/maria_db/current_root_password_dialog.rb index 05e7050..4750fe2 100644 --- a/src/lib/rmt/maria_db/current_root_password_dialog.rb +++ b/src/lib/rmt/maria_db/current_root_password_dialog.rb @@ -25,11 +25,12 @@ module RMT::MariaDB; end class RMT::MariaDB::CurrentRootPasswordDialog < RMT::Shared::InputPasswordDialog def initialize + textdomain 'rmt' super - @dialog_heading = N_('Database root password is required') - @dialog_label = N_('In order to setup RMT, database access is required. Please provide the current database root password.') - @password_field_label = N_('MariaDB root &password') + @dialog_heading = _('Database root password is required') + @dialog_label = _('In order to setup RMT, database access is required. Please provide the current database root password.') + @password_field_label = _('MariaDB root &password') end private diff --git a/src/lib/rmt/maria_db/new_root_password_dialog.rb b/src/lib/rmt/maria_db/new_root_password_dialog.rb index 9b4f9b9..4f806ef 100644 --- a/src/lib/rmt/maria_db/new_root_password_dialog.rb +++ b/src/lib/rmt/maria_db/new_root_password_dialog.rb @@ -25,11 +25,12 @@ module RMT::MariaDB; end class RMT::MariaDB::NewRootPasswordDialog < RMT::Shared::SetPasswordDialog def initialize + textdomain 'rmt' super - @dialog_heading = N_('Setting database root password') - @dialog_label = N_('The current MariaDB root password is empty. Setting a root password is required for security reasons.') - @password_field_label = N_('New MariaDB root &Password') + @dialog_heading = _('Setting database root password') + @dialog_label = _('The current MariaDB root password is empty. Setting a root password is required for security reasons.') + @password_field_label = _('New MariaDB root &Password') end def set_root_password(new_root_password, hostname) diff --git a/src/lib/rmt/shared/input_password_dialog.rb b/src/lib/rmt/shared/input_password_dialog.rb index 4af921d..e5b546b 100644 --- a/src/lib/rmt/shared/input_password_dialog.rb +++ b/src/lib/rmt/shared/input_password_dialog.rb @@ -53,14 +53,14 @@ def ok_handler def dialog_content VBox( VSpacing(1), - Heading(_(@dialog_heading)), + Heading(@dialog_heading), VSpacing(1), HBox( HSpacing(2), VBox( - Label(_(@dialog_label)), + Label(@dialog_label), VSpacing(1), - MinWidth(15, Password(Id(:password), _(@password_field_label))) + MinWidth(15, Password(Id(:password), @password_field_label)) ), HSpacing(2) ), diff --git a/src/lib/rmt/shared/set_password_dialog.rb b/src/lib/rmt/shared/set_password_dialog.rb index 22a1bb4..9a1025c 100644 --- a/src/lib/rmt/shared/set_password_dialog.rb +++ b/src/lib/rmt/shared/set_password_dialog.rb @@ -25,7 +25,7 @@ module RMT::Shared; end class RMT::Shared::SetPasswordDialog < UI::Dialog def initialize @min_password_size = 0 - @password_confirmation_field_label = N_('C&onfirm Password') + @password_confirmation_field_label = _('C&onfirm Password') textdomain 'rmt' end @@ -60,19 +60,15 @@ def ok_handler def dialog_content VBox( VSpacing(1), - Heading(_(@dialog_heading)), + Heading(@dialog_heading), VSpacing(1), HBox( HSpacing(2), VBox( - Label( - _( - @dialog_label - ) - ), + Label(@dialog_label), VSpacing(1), - MinWidth(15, Password(Id(:password), _(@password_field_label))), - MinWidth(15, Password(Id(:password_confirmation), _(@password_confirmation_field_label))) + MinWidth(15, Password(Id(:password), @password_field_label)), + MinWidth(15, Password(Id(:password_confirmation), @password_confirmation_field_label)) ), HSpacing(2) ), diff --git a/src/lib/rmt/ssl/current_ca_password_dialog.rb b/src/lib/rmt/ssl/current_ca_password_dialog.rb index 7eeb80d..367403c 100644 --- a/src/lib/rmt/ssl/current_ca_password_dialog.rb +++ b/src/lib/rmt/ssl/current_ca_password_dialog.rb @@ -26,11 +26,12 @@ module RMT::SSL; end class RMT::SSL::CurrentCaPasswordDialog < RMT::Shared::InputPasswordDialog def initialize + textdomain 'rmt' super - @dialog_heading = N_('Your CA private key is encrypted.') - @dialog_label = N_('Please input password.') - @password_field_label = N_('&Password') + @dialog_heading = _('Your CA private key is encrypted.') + @dialog_label = _('Please input password.') + @password_field_label = _('&Password') @cert_generator = RMT::SSL::CertificateGenerator.new end diff --git a/src/lib/rmt/ssl/new_ca_password_dialog.rb b/src/lib/rmt/ssl/new_ca_password_dialog.rb index b549582..af1c356 100644 --- a/src/lib/rmt/ssl/new_ca_password_dialog.rb +++ b/src/lib/rmt/ssl/new_ca_password_dialog.rb @@ -25,11 +25,12 @@ module RMT::SSL; end class RMT::SSL::NewCaPasswordDialog < RMT::Shared::SetPasswordDialog def initialize + textdomain 'rmt' super - @dialog_heading = N_('Setting CA private key password') - @dialog_label = N_('Please set a password for the CA private key.') - @password_field_label = N_('&Password') + @dialog_heading = _('Setting CA private key password') + @dialog_label = _('Please set a password for the CA private key.') + @password_field_label = _('&Password') @min_password_size = 4 end end From cec28c5593bae1b9b0f61f03838d26adee575872 Mon Sep 17 00:00:00 2001 From: Luis Caparroz Date: Mon, 3 Mar 2025 12:54:41 +0100 Subject: [PATCH 2/3] chore: Bump version to 1.3.6 --- package/yast2-rmt.changes | 6 ++++++ package/yast2-rmt.spec | 2 +- src/lib/rmt.rb | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package/yast2-rmt.changes b/package/yast2-rmt.changes index 53ee620..92b760d 100644 --- a/package/yast2-rmt.changes +++ b/package/yast2-rmt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Mar 3 11:52:35 UTC 2025 - Luis Caparroz + +- Mark strings on UI dialogs for tranlation (bsc#1127676). +- Version 1.3.6 + ------------------------------------------------------------------- Thu Feb 8 16:10:29 UTC 2024 - Luis Caparroz diff --git a/package/yast2-rmt.spec b/package/yast2-rmt.spec index ef45b53..c978153 100644 --- a/package/yast2-rmt.spec +++ b/package/yast2-rmt.spec @@ -17,7 +17,7 @@ Name: yast2-rmt -Version: 1.3.5 +Version: 1.3.6 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/src/lib/rmt.rb b/src/lib/rmt.rb index 20ced44..bc09a35 100644 --- a/src/lib/rmt.rb +++ b/src/lib/rmt.rb @@ -17,5 +17,5 @@ # you may find current contact information at www.suse.com module RMT - VERSION = '1.3.5'.freeze + VERSION = '1.3.6'.freeze end From 3f560f282335b7b4e20c18cc698587deaf193790 Mon Sep 17 00:00:00 2001 From: Luis Caparroz Date: Wed, 5 Mar 2025 14:56:12 +0100 Subject: [PATCH 3/3] ci: Add ruby-devel installation to Rubocop job Add a step on the GitHub Actions job "Rubocop" to install the package 'ruby-devel', which provide Ruby's headers, required by the 'racc' (installed with 'bundle install'). --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f428cd4..796814f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,6 +53,9 @@ jobs: - name: Git Checkout uses: actions/checkout@v2 + - name: Install ruby-devel package + run: zypper --non-interactive install ruby-devel + - name: Install project dependencies run: bundle install