Skip to content

Commit

Permalink
Merge pull request #200 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
Bronagh Sorota authored Jan 18, 2018
2 parents 3968ec5 + 020fff7 commit 4101c35
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/manageiq/providers/azure/cloud_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,8 @@ def snapshot_service(connection = nil)
connection ||= connect
::Azure::Armrest::Storage::SnapshotService.new(connection)
end

def self.display_name(number = 1)
n_('Cloud Provider (Microsoft Azure)', 'Cloud Providers (Microsoft Azure)', number)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,8 @@ def raw_status
_log.error "stack=[#{name}], error: #{err}"
raise MiqException::MiqOrchestrationStatusError, err.to_s, err.backtrace
end

def self.display_name(number = 1)
n_('Orchestration Stack (Microsoft Azure)', 'Orchestration Stacks (Microsoft Azure)', number)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def validate_format
err.message
end

def self.display_name(number = 1)
n_('Azure Template', 'Azure Templates', number)
end

private

def mode_opt
Expand Down
4 changes: 4 additions & 0 deletions app/models/manageiq/providers/azure/cloud_manager/vm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ def self.calculate_power_state(raw_power_state)
"unknown"
end
end

def self.display_name(number = 1)
n_('Instance (Microsoft Azure)', 'Instances (Microsoft Azure)', number)
end
end
4 changes: 4 additions & 0 deletions app/models/manageiq/providers/azure/network_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,8 @@ def self.hostname_required?
def description
ManageIQ::Providers::Azure::Regions.find_by_name(provider_region)[:description]
end

def self.display_name(number = 1)
n_('Network Manager (Microsoft Azure)', 'Network Managers (Microsoft Azure)', number)
end
end
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
class ManageIQ::Providers::Azure::NetworkManager::CloudNetwork < ::CloudNetwork
def self.display_name(number = 1)
n_('Cloud Network (Microsoft Azure)', 'Cloud Networks (Microsoft Azure)', number)
end
end
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
class ManageIQ::Providers::Azure::NetworkManager::CloudSubnet < ::CloudSubnet
def self.display_name(number = 1)
n_('Cloud Subnet (Microsoft Azure)', 'Cloud Subnets (Microsoft Azure)', number)
end
end
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
class ManageIQ::Providers::Azure::NetworkManager::LoadBalancer < ::LoadBalancer
def self.display_name(number = 1)
n_('Load Balancer (Microsoft Azure)', 'Load Balancers (Microsoft Azure)', number)
end
end
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
class ManageIQ::Providers::Azure::NetworkManager::NetworkPort < ::NetworkPort
def self.display_name(number = 1)
n_('Network Port (Microsoft Azure)', 'Network Ports (Microsoft Azure)', number)
end
end

0 comments on commit 4101c35

Please sign in to comment.