From: Jozef Zigmund <jzigmund(a)redhat.com>
---
src/app/controllers/instances_controller.rb | 16 ++++----
src/app/views/instances/_edit.html.haml | 8 ++--
src/app/views/instances/_history.html.haml | 2 +-
src/app/views/instances/_parameters.haml | 2 +-
src/app/views/instances/_permissions.html.haml | 2 +-
src/app/views/instances/_properties.html.haml | 44 ++++++++++++------------
6 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/src/app/controllers/instances_controller.rb
b/src/app/controllers/instances_controller.rb
index 8b18ede..7df908e 100644
--- a/src/app/controllers/instances_controller.rb
+++ b/src/app/controllers/instances_controller.rb
@@ -42,7 +42,7 @@ class InstancesController < ApplicationController
def show
load_instances
- @tab_captions = ['Properties', 'History', 'Permissions']
+ @tab_captions = [t('instances.tab_captions.properties'),
t('instances.tab_captions.history'),
t('instances.tab_captions.permissions')]
@details_tab = params[:details_tab].blank? ? 'properties' :
params[:details_tab]
save_breadcrumb(instance_path(@instance), @instance.name)
respond_to do |format|
@@ -142,13 +142,13 @@ class InstancesController < ApplicationController
begin
require_privilege(Privilege::USE,instance)
unless instance.valid_action?('stop')
- raise ActionError.new("stop is an invalid action.")
+ raise ActionError.new(t('instances.errors.stop_invalid'))
end
#permissons check here
@task = instance.queue_action(current_user, 'stop')
unless @task
- raise ActionError.new("stop cannot be performed on this instance.")
+ raise ActionError.new(t('instances.errors.stop_not_be_performed'))
end
Taskomatic.stop_instance(@task)
notices << "#{instance.name}:
#{t('instances.flash.notice.stop')}"
@@ -193,11 +193,11 @@ class InstancesController < ApplicationController
def set_view_vars
@header = [
- {:name => 'VM NAME', :sort_attr => 'name'},
- {:name => 'STATUS', :sortable => false},
- {:name => 'PUBLIC ADDRESS', :sort_attr =>
'public_addresses'},
- {:name => 'PROVIDER', :sortable => false},
- {:name => 'CREATED BY', :sort_attr => 'users.last_name'},
+ {:name => t('instances.headers.vm_name'), :sort_attr =>
'name'},
+ {:name => t('instances.headers.status'), :sortable => false},
+ {:name => t('instances.headers.public_address'), :sort_attr =>
'public_addresses'},
+ {:name => t('instances.headers.provider'), :sortable => false},
+ {:name => t('instances.headers.created_by'), :sort_attr =>
'users.last_name'},
]
@pools = Pool.list_for_user(current_user, Privilege::CREATE, :target_type =>
Instance)
diff --git a/src/app/views/instances/_edit.html.haml
b/src/app/views/instances/_edit.html.haml
index f94551e..78d3c88 100644
--- a/src/app/views/instances/_edit.html.haml
+++ b/src/app/views/instances/_edit.html.haml
@@ -1,11 +1,11 @@
- if @instance.errors.any?
= render 'layouts/error_messages', :object => @instance
-%h2 Edit instance
+%h2= t'instances.edit.edit_instance'
= form_for @instance do
%ul
%li
- = label :instance, :name
+ = label :instance, t('instances.edit.name')
= text_field :instance, :name
- = submit_tag 'Cancel', :name => 'cancel'
- = submit_tag 'Save', :name => 'save', :id => 'save'
+ = submit_tag t('cancel'), :name => 'cancel'
+ = submit_tag t('save'), :name => 'save', :id => 'save'
diff --git a/src/app/views/instances/_history.html.haml
b/src/app/views/instances/_history.html.haml
index 313d3a5..c4e3349 100644
--- a/src/app/views/instances/_history.html.haml
+++ b/src/app/views/instances/_history.html.haml
@@ -1,5 +1,5 @@
%h3
- History for
+ = t 'instances.history.history_for'
= @instance.name
%ul
- @instance.events.each do |event|
diff --git a/src/app/views/instances/_parameters.haml
b/src/app/views/instances/_parameters.haml
index cf0eb48..92ffb28 100644
--- a/src/app/views/instances/_parameters.haml
+++ b/src/app/views/instances/_parameters.haml
@@ -1,5 +1,5 @@
%h3
- Config Parameters for
+ = t 'instances.parameters.config_parameters_for'
= @instance.name
%ul
- @instance.instance_parameters.each do |parameter|
diff --git a/src/app/views/instances/_permissions.html.haml
b/src/app/views/instances/_permissions.html.haml
index 02da418..bbaaded 100644
--- a/src/app/views/instances/_permissions.html.haml
+++ b/src/app/views/instances/_permissions.html.haml
@@ -1,3 +1,3 @@
%h3
- Permissions for
+ = t 'instances.permissions.permissions_for'
= @instance.name
diff --git a/src/app/views/instances/_properties.html.haml
b/src/app/views/instances/_properties.html.haml
index 3cec61b..fb90404 100644
--- a/src/app/views/instances/_properties.html.haml
+++ b/src/app/views/instances/_properties.html.haml
@@ -1,54 +1,54 @@
%h3
- Properties for
+ = t 'instances.properties.properties_for'
= @instance.name
%ul
%li
- = label_tag :name, 'Name'
+ = label_tag :name, t('instances.properties.name')
%span= @instance.name
%li
- = label_tag :status, 'Status'
+ = label_tag :status, t('instances.properties.status')
%span= @instance.state
%li
- = label_tag :public_addresses, 'Public Addresses'
+ = label_tag :public_addresses, t('instances.properties.public_addresses')
%span= @instance.public_addresses
%li
- = label_tag :private_addresses, 'Private Addresses'
+ = label_tag :private_addresses, t('instances.properties.private_adresses')
%span= @instance.private_addresses
- %li
- = label_tag :assembly, 'Assembly'
+ = label_tag :assembly, t('instances.properties.assembly')
%span= @instance.assembly_xml.name
%li
- = label_tag :provider, 'Provider'
+ = label_tag :provider, t('instances.properties.provider')
%span= @instance.provider_account.provider.name if @instance.provider_account
%li
- = label_tag :architecture, 'Architecture'
+ = label_tag :architecture, t('instances.properties.architecture')
%span= @instance.hardware_profile.architecture.value
%li
- = label_tag :memory, 'Memory'
+ = label_tag :memory, t('instances.properties.memory')
%span= @instance.hardware_profile.memory.value
%li
- = label_tag :storage, 'Storage'
+ = label_tag :storage, t('instances.properties.storage')
%span= @instance.hardware_profile.storage.value
%li
- = label_tag :instantiation_time, 'Instantiation Time'
+ = label_tag :instantiation_time,
t('instances.properties.instantiation_time')
%span= @instance.created_at.strftime("%d-%b-%Y %H:%M:%S")
%li
- = label_tag :current_alerts, 'Current Alerts'
+ = label_tag :current_alerts, t('instances.properties.current_alerts')
%span= 0
- %li
- = label_tag :console_connection, 'Console Connection'
- %span= 'via SSH'
+ = label_tag :console_connection,
t('instances.properties.console_connection')
+ %span= t('instances.properties.via_ssh')
- if @instance.instance_key
%li
- = label_tag :instance_key, 'SSH key'
- %span= link_to("Download", key_instance_path(@instance), :id
=>'download_ssh_key')
+ = label_tag :instance_key, t('instances.properties.ssh_key')
+ %span= link_to t('instances.properties.download'),
key_instance_path(@instance), :id =>'download_ssh_key'
%li
- = label_tag :owner, 'Owner'
+ = label_tag :owner, t('instances.properties.owner')
%span= "#{(a)instance.owner.first_name} #{(a)instance.owner.last_name}"
%li
- = label_tag :shared_to, 'Shared to'
- %span= "N/A"
+ = label_tag :shared_to, t('instances.properties.shared_to')
+ %span= t('instances.properties.n_a')
- if @instance.state == Instance::STATE_ERROR
%li
- = label_tag :error, 'Error'
+ = label_tag :error, t('instances.properties.error')
%span= @instance.last_error
+ %li
+ %li
--
1.7.6.4