From 249b083c8190d1f8008a27b793d67796ab4c4196 Mon Sep 17 00:00:00 2001 From: Milan Zazrivec Date: Tue, 27 Feb 2018 12:08:11 +0100 Subject: [PATCH 1/2] Add missing gettext into vm_common/_reconfigure.html.haml --- app/views/vm_common/_reconfigure.html.haml | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/views/vm_common/_reconfigure.html.haml b/app/views/vm_common/_reconfigure.html.haml index 504ac22c21a..c261d7e5e63 100644 --- a/app/views/vm_common/_reconfigure.html.haml +++ b/app/views/vm_common/_reconfigure.html.haml @@ -16,8 +16,8 @@ "name" => "cb_memory", "ng-model" => "vm.cb_memory", "ng-change" => "vm.cbChange()", - "switch-on-text" => "Yes", - "switch-off-text" => "No"} + "switch-on-text" => _("Yes"), + "switch-off-text" => _("No")} #memory_div{"ng-if" => "vm.cb_memory"} .col-md-4 %input.form-control{"type" => "text", @@ -56,8 +56,8 @@ "name" => "cb_cpu", "ng-model" => "vm.cb_cpu", "ng-change" => "vm.cbChange()", - "switch-on-text" => "Yes", - "switch-off-text" => "No"} + "switch-on-text" => _("Yes"), + "switch-off-text" => _("No")} %br #cpu_div{"ng-if" => "vm.cb_cpu", :style => "margin-left: 20px"} %h3= _(' Processor Options') @@ -123,7 +123,7 @@ "ng-show" => "!vm.reconfigureModel.addEnabled"}= _('Add Disk') %button.btn.btn-default.btn-sm{:type => "button", "ng-click" => "vm.hideAddDisk()", - "ng-show" => "vm.reconfigureModel.addEnabled"}= ('Cancel Add') + "ng-show" => "vm.reconfigureModel.addEnabled"}= _('Cancel Add') %table.table.table-striped.table-condensed.table-bordered %thead %th= _('Name') @@ -175,7 +175,7 @@ "ng-model" => "vm.reconfigureModel.hdSize", "required" => "", "ng-pattern" => "hdpattern", - "placeholder" => "Enter New Size", + "placeholder" => _("Enter New Size"), "ng-change" => "vm.hdChanged()"} %span{"style" => "color:red", "ng-show" => "rowForm.dvcSize.$invalid"} = _(" Valid numeric disk size required ") @@ -189,14 +189,14 @@ "selectpicker-for-select-tag" => "") %td{"ng-if" => @reconfigitems.first.vendor == 'vmware'} %input{"bs-switch" => "", - :data => {:on_text => 'Yes', :off_text => 'No', :size => 'mini'}, + :data => {:on_text => _('Yes'), :off_text => _('No'), :size => 'mini'}, "type" => "checkbox", "name" => "vm.cb_dependent", "ng-model" => "vm.reconfigureModel.cb_dependent"} %td %td{"ng-if" => @reconfigitems.first.vendor == 'redhat'} %input{"bs-switch" => "", - :data => {:on_text => 'Yes', :off_text => 'No', :size => 'mini'}, + :data => {:on_text => _('Yes'), :off_text => _('No'), :size => 'mini'}, "type" => "checkbox", "name" => "vm.cb_bootable", "ng-model" => "vm.reconfigureModel.cb_bootable"} @@ -226,7 +226,7 @@ "ng-model" => "disk.hdSize", "required" => "", "ng-pattern" => "hdpattern", - "placeholder" => "Enter Size", + "placeholder" => _("Enter Size"), "ng-change" => "vm.hdChanged()", "validate-multiple" => "1", :miqmin => "{{ (disk.orgHdUnit === 'GB') ? (1024 * disk.orgHdSize + 1) : (1 * disk.orgHdSize + 1) }}", @@ -246,7 +246,7 @@ "selectpicker-for-select-tag" => "") %td{"ng-if" => @reconfigitems.first.vendor == 'vmware'} %input{"bs-switch" => "", - :data => {:on_text => 'Yes', :off_text => 'No', :size => 'mini'}, + :data => {:on_text => _('Yes'), :off_text => _('No'), :size => 'mini'}, "type" => "checkbox", "name" => "vm.cb_dependent", "ng-model" => "disk.cb_dependent", @@ -255,7 +255,7 @@ "ng-if" => "disk.add_remove=='add'"} %td %input{"bs-switch" => "", - :data => {:on_text => 'Yes', :off_text => 'No', :size => 'mini'}, + :data => {:on_text => _('Yes'), :off_text => _('No'), :size => 'mini'}, "type" => "checkbox", "name" => "cb_deletebacking", "ng-model" => "disk.delete_backing", @@ -264,7 +264,7 @@ "ng-if" => "disk.add_remove!='add'"} %td{"ng-if" => @reconfigitems.first.vendor == 'redhat'} %input{"bs-switch" => "", - :data => {:on_text => 'Yes', :off_text => 'No', :size => 'mini'}, + :data => {:on_text => _('Yes'), :off_text => _('No'), :size => 'mini'}, "type" => "checkbox", "name" => "cb_bootable", "ng-model" => "disk.cb_bootable", From 84e5df7212bc463d6459375c668c0f97e48d500d Mon Sep 17 00:00:00 2001 From: Milan Zazrivec Date: Tue, 27 Feb 2018 12:08:48 +0100 Subject: [PATCH 2/2] Add missing gettext into VmActions::Reconfigure mixin --- app/controllers/mixins/actions/vm_actions/reconfigure.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/mixins/actions/vm_actions/reconfigure.rb b/app/controllers/mixins/actions/vm_actions/reconfigure.rb index 7f55281960e..ecc29f1704f 100644 --- a/app/controllers/mixins/actions/vm_actions/reconfigure.rb +++ b/app/controllers/mixins/actions/vm_actions/reconfigure.rb @@ -89,7 +89,7 @@ def get_reconfig_limits(reconfigure_ids) @reconfig_limits = VmReconfigureRequest.request_limits(:src_ids => reconfigure_ids) mem1, fmt1 = reconfigure_calculations(@reconfig_limits[:min__vm_memory]) mem2, fmt2 = reconfigure_calculations(@reconfig_limits[:max__vm_memory]) - @reconfig_memory_note = "Between #{mem1}#{fmt1} and #{mem2}#{fmt2}" + @reconfig_memory_note = _("Between %{min} and %{max}") % {:min => "#{mem1}#{fmt1}", :max => "#{mem2}#{fmt2}"} @socket_options = [] @reconfig_limits[:max__number_of_sockets].times do |tidx|