Skip to content

Commit b7718e8

Browse files
committed
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
1 parent c5ca0d0 commit b7718e8

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

src/lib/rmt/maria_db/current_root_password_dialog.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ module RMT::MariaDB; end
2525

2626
class RMT::MariaDB::CurrentRootPasswordDialog < RMT::Shared::InputPasswordDialog
2727
def initialize
28+
textdomain 'rmt'
2829
super
2930

30-
@dialog_heading = N_('Database root password is required')
31-
@dialog_label = N_('In order to setup RMT, database access is required. Please provide the current database root password.')
32-
@password_field_label = N_('MariaDB root &password')
31+
@dialog_heading = _('Database root password is required')
32+
@dialog_label = _('In order to setup RMT, database access is required. Please provide the current database root password.')
33+
@password_field_label = _('MariaDB root &password')
3334
end
3435

3536
private

src/lib/rmt/maria_db/new_root_password_dialog.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ module RMT::MariaDB; end
2525

2626
class RMT::MariaDB::NewRootPasswordDialog < RMT::Shared::SetPasswordDialog
2727
def initialize
28+
textdomain 'rmt'
2829
super
2930

30-
@dialog_heading = N_('Setting database root password')
31-
@dialog_label = N_('The current MariaDB root password is empty. Setting a root password is required for security reasons.')
32-
@password_field_label = N_('New MariaDB root &Password')
31+
@dialog_heading = _('Setting database root password')
32+
@dialog_label = _('The current MariaDB root password is empty. Setting a root password is required for security reasons.')
33+
@password_field_label = _('New MariaDB root &Password')
3334
end
3435

3536
def set_root_password(new_root_password, hostname)

src/lib/rmt/shared/input_password_dialog.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ def ok_handler
5353
def dialog_content
5454
VBox(
5555
VSpacing(1),
56-
Heading(_(@dialog_heading)),
56+
Heading(@dialog_heading),
5757
VSpacing(1),
5858
HBox(
5959
HSpacing(2),
6060
VBox(
61-
Label(_(@dialog_label)),
61+
Label(@dialog_label),
6262
VSpacing(1),
63-
MinWidth(15, Password(Id(:password), _(@password_field_label)))
63+
MinWidth(15, Password(Id(:password), @password_field_label))
6464
),
6565
HSpacing(2)
6666
),

src/lib/rmt/shared/set_password_dialog.rb

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module RMT::Shared; end
2525
class RMT::Shared::SetPasswordDialog < UI::Dialog
2626
def initialize
2727
@min_password_size = 0
28-
@password_confirmation_field_label = N_('C&onfirm Password')
28+
@password_confirmation_field_label = _('C&onfirm Password')
2929
textdomain 'rmt'
3030
end
3131

@@ -60,19 +60,15 @@ def ok_handler
6060
def dialog_content
6161
VBox(
6262
VSpacing(1),
63-
Heading(_(@dialog_heading)),
63+
Heading(@dialog_heading),
6464
VSpacing(1),
6565
HBox(
6666
HSpacing(2),
6767
VBox(
68-
Label(
69-
_(
70-
@dialog_label
71-
)
72-
),
68+
Label(@dialog_label),
7369
VSpacing(1),
74-
MinWidth(15, Password(Id(:password), _(@password_field_label))),
75-
MinWidth(15, Password(Id(:password_confirmation), _(@password_confirmation_field_label)))
70+
MinWidth(15, Password(Id(:password), @password_field_label)),
71+
MinWidth(15, Password(Id(:password_confirmation), @password_confirmation_field_label))
7672
),
7773
HSpacing(2)
7874
),

src/lib/rmt/ssl/current_ca_password_dialog.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ module RMT::SSL; end
2626

2727
class RMT::SSL::CurrentCaPasswordDialog < RMT::Shared::InputPasswordDialog
2828
def initialize
29+
textdomain 'rmt'
2930
super
3031

31-
@dialog_heading = N_('Your CA private key is encrypted.')
32-
@dialog_label = N_('Please input password.')
33-
@password_field_label = N_('&Password')
32+
@dialog_heading = _('Your CA private key is encrypted.')
33+
@dialog_label = _('Please input password.')
34+
@password_field_label = _('&Password')
3435
@cert_generator = RMT::SSL::CertificateGenerator.new
3536
end
3637

src/lib/rmt/ssl/new_ca_password_dialog.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ module RMT::SSL; end
2525

2626
class RMT::SSL::NewCaPasswordDialog < RMT::Shared::SetPasswordDialog
2727
def initialize
28+
textdomain 'rmt'
2829
super
2930

30-
@dialog_heading = N_('Setting CA private key password')
31-
@dialog_label = N_('Please set a password for the CA private key.')
32-
@password_field_label = N_('&Password')
31+
@dialog_heading = _('Setting CA private key password')
32+
@dialog_label = _('Please set a password for the CA private key.')
33+
@password_field_label = _('&Password')
3334
@min_password_size = 4
3435
end
3536
end

0 commit comments

Comments
 (0)