Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate model display names from locale/en.yml to plugin #200

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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