Added translations to new requests view and aspects controller

This commit is contained in:
Ariel Zavala 2010-09-17 16:38:50 -04:00
parent cb145c346a
commit f95cebcb8b
6 changed files with 68 additions and 12 deletions

View file

@ -29,7 +29,7 @@ class AspectsController < ApplicationController
begin
current_user.drop_aspect @aspect
flash[:notice] = "#{@aspect.name} was successfully removed."
flash[:notice] = i18n.t 'aspects.destroy.success',:name => @aspect.name
rescue RuntimeError => e
flash[:error] = e.message
end
@ -53,7 +53,7 @@ class AspectsController < ApplicationController
def update
@aspect = Aspect.find_by_id(params[:id])
@aspect.update_attributes(params[:aspect])
flash[:notice] = "Your aspect, #{@aspect.name}, has been successfully edited."
flash[:notice] = i18n.t 'aspects.update.success',:name => @aspect.name
respond_with @aspect
end
@ -61,25 +61,25 @@ class AspectsController < ApplicationController
params[:moves].each{ |move|
move = move[1]
unless current_user.move_friend(move)
flash[:error] = "Aspect editing failed for friend #{Person.find_by_id( move[:friend_id] ).real_name}."
flash[:error] = i18n.t 'aspects.move_friends.failure', :real_name => Person.find_by_id( move[:friend_id] ).real_name
redirect_to Aspect.first, :action => "edit"
return
end
}
flash[:notice] = "Aspects edited successfully."
flash[:notice] = i18n.t 'aspects.move_friends.success'
redirect_to Aspect.first, :action => "edit"
end
def move_friend
unless current_user.move_friend( :friend_id => params[:friend_id], :from => params[:from], :to => params[:to][:to])
flash[:error] = "didn't work #{params.inspect}"
flash[:error] = I18n.t 'aspects.move_friend.error',:inspect => params.inspect
end
if aspect = Aspect.first(:id => params[:to][:to])
flash[:notice] = "You are now showing your friend a different aspect of yourself."
flash[:notice] = I18n.t 'aspects.move_friend.notice'
respond_with aspect
else
flash[:notice] = "You are now showing your friend a different aspect of yourself."
flash[:notice] = I18n.t 'aspects.move_friend.notice'
respond_with Person.first(:id => params[:friend_id])
end
end

View file

@ -4,18 +4,18 @@
%h1
Add a new friend to
=t('.add_a_new_friend_to')
%i= aspect.name
= form_for Request.new do |f|
= f.error_messages
Enter a Diaspora username:
=t('.enter_a_diaspora_username')
%br
%i= "Your Diaspora username is: #{current_user.diaspora_handle}"
%i= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle
%p
= f.label :destination_url, "Friend's username"
= f.label :destination_url, t(".friends_username")
= f.text_field :destination_url
= f.hidden_field :aspect_id, :value => aspect.id
= f.submit

View file

@ -84,6 +84,18 @@ de:
new_aspect:
add_a_new_aspect: "Neuen Aspekt erstellen"
create: "Erstellen"
create:
success: "Click on the plus on the left side to tell Diaspora who can see your new aspect."
destroy:
success: "%{name} was successfully removed."
update:
success: "Your aspect, %{name}, has been successfully edited."
move_friends:
failure: "Aspect editing failed for friend %{real_name}."
success: "Aspects edited successfully."
move_friend:
error: "didn't work %{inspect}"
notice: "You are now showing your friend a different aspect of yourself."
helper:
remove: "remove"
aspect_not_empty: "Aspect not empty"

View file

@ -85,7 +85,17 @@ en:
add_a_new_aspect: "Add a new aspect"
create: "Create"
create:
success:"Click on the plus on the left side to tell Diaspora who can see your new aspect."
success: "Click on the plus on the left side to tell Diaspora who can see your new aspect."
destroy:
success: "%{name} was successfully removed."
update:
success: "Your aspect, %{name}, has been successfully edited."
move_friends:
failure: "Aspect editing failed for friend %{real_name}."
success: "Aspects edited successfully."
move_friend:
error: "didn't work %{inspect}"
notice: "You are now showing your friend a different aspect of yourself."
helper:
remove: "remove"
aspect_not_empty: "Aspect not empty"
@ -164,3 +174,9 @@ en:
save: "save"
are_you_sure: "Are you sure?"
remove_friend: "remove friend"
requests:
new_request:
add_a_new_friend_to: "Add a new friend to"
enter_a_diaspora_username: "Enter a Diaspora username:"
your_diaspora_username_is: "Your Diaspora username is: %{diaspora_handle}"
friends_username: "Friend's username"

View file

@ -87,6 +87,16 @@ es:
create: "Crear"
create:
success:"Pulsa en el signo de mas a la izquierda para escojer quien puede ver su nuevo aspecto."
destroy:
success: "%{name} fue removido exitosamente."
update:
success: "Su aspecto, %{name}, fue editado exitosamente."
move_friends:
failure: "Fallo el editar aspecto para el amigo %{real_name}."
success: "Los aspectos fueron editados exitosamente."
move_friend:
error: "no funciono %{inspect}"
notice: "Ahora estas mostrando a tu amigo un aspecto diferente de ti."
helper:
remove: "remover"
aspect_not_empty: "Aspecto no esta vacio"
@ -162,3 +172,9 @@ es:
save: "guardar"
are_you_sure: "Esta seguro?"
remove_friend: "remover amigo"
requests:
new_request:
add_a_new_friend_to: "Añade un nuevo amigo a "
enter_a_diaspora_username: "Escribe el usuario de Diaspora:"
your_diaspora_username_is: "Tu usuario de Diaspora es: %{diaspora_handle}"
friends_username: "Usuario de amigo"

View file

@ -78,6 +78,18 @@ fr:
new_aspect:
add_a_new_aspect: "Ajouter un nouvel aspect"
create: "Créer"
create:
success: "Click on the plus on the left side to tell Diaspora who can see your new aspect."
destroy:
success: "%{name} was successfully removed."
update:
success: "Your aspect, %{name}, has been successfully edited."
move_friends:
failure: "Aspect editing failed for friend %{real_name}."
success: "Aspects edited successfully."
move_friend:
error: "didn't work %{inspect}"
notice: "You are now showing your friend a different aspect of yourself."
helper:
remove: "remove"
aspect_not_empty: "Aspect not empty"