Skip to content

Commit

Permalink
Merge pull request #174 from mzazrivec/migrate_display_names_for_models
Browse files Browse the repository at this point in the history
Migrate model display names from locale/en.yml to plugin
  • Loading branch information
agrare authored Jan 18, 2018
2 parents 62d7a35 + 3575676 commit bd7fd5e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/manageiq/providers/vmware/cloud_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,8 @@ def vm_restart(vm, _options = {})
rescue => err
$vcloud_log.error("vm=[#{vm.name}], error: #{err}")
end

def self.display_name(number = 1)
n_('Cloud Provider (VMware vCloud)', 'Cloud Providers (VMware vCloud)', number)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,8 @@ def validate_format
rescue REXML::ParseException => err
err.message
end

def self.display_name(number = 1)
n_('vApp Template', 'vApp Templates', number)
end
end
4 changes: 4 additions & 0 deletions app/models/manageiq/providers/vmware/cloud_manager/vm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ def self.calculate_power_state(raw_power_state)
# https://github.com/xlab-si/fog-vcloud-director/blob/master/lib/fog/vcloud_director/parsers/compute/vm.rb#L70
POWER_STATES[raw_power_state.to_s] || "terminated"
end

def self.display_name(number = 1)
n_('Instance (VMware vCloud)', 'Instances (VMware vCloud)', number)
end
end
4 changes: 4 additions & 0 deletions app/models/manageiq/providers/vmware/infra_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -540,4 +540,8 @@ def refresh_files_on_datastore(datastore)
EmsRefresh.save_storage_files_inventory(datastore, hashes)
end
end

def self.display_name(number = 1)
n_('Infrastructure Provider (VMware)', 'Infrastructure Providers (VMware)', number)
end
end
4 changes: 4 additions & 0 deletions app/models/manageiq/providers/vmware/infra_manager/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,8 @@ def detect_discovered_hypervisor(_ost, ipaddr)
end

supports :quick_stats

def self.display_name(number = 1)
n_('Host (Vmware)', 'Hosts (Vmware)', number)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,8 @@ def refresh_advanced_settings
ash = vim_advanced_settings
AdvancedSetting.add_elements(self, ash) unless ash.nil?
end

def self.display_name(number = 1)
n_('Host (Vmware)', 'Hosts (Vmware)', number)
end
end
4 changes: 4 additions & 0 deletions app/models/manageiq/providers/vmware/infra_manager/vm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ def cpu_ready_available?

supports :snapshots
supports :quick_stats

def self.display_name(number = 1)
n_('Virtual Machine (VMware)', 'Virtual Machines (VMware)', number)
end
end

0 comments on commit bd7fd5e

Please sign in to comment.