Added translations to new requests view and aspects controller
This commit is contained in:
parent
cb145c346a
commit
f95cebcb8b
6 changed files with 68 additions and 12 deletions
|
|
@ -29,7 +29,7 @@ class AspectsController < ApplicationController
|
||||||
|
|
||||||
begin
|
begin
|
||||||
current_user.drop_aspect @aspect
|
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
|
rescue RuntimeError => e
|
||||||
flash[:error] = e.message
|
flash[:error] = e.message
|
||||||
end
|
end
|
||||||
|
|
@ -53,7 +53,7 @@ class AspectsController < ApplicationController
|
||||||
def update
|
def update
|
||||||
@aspect = Aspect.find_by_id(params[:id])
|
@aspect = Aspect.find_by_id(params[:id])
|
||||||
@aspect.update_attributes(params[:aspect])
|
@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
|
respond_with @aspect
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -61,25 +61,25 @@ class AspectsController < ApplicationController
|
||||||
params[:moves].each{ |move|
|
params[:moves].each{ |move|
|
||||||
move = move[1]
|
move = move[1]
|
||||||
unless current_user.move_friend(move)
|
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"
|
redirect_to Aspect.first, :action => "edit"
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
flash[:notice] = "Aspects edited successfully."
|
flash[:notice] = i18n.t 'aspects.move_friends.success'
|
||||||
redirect_to Aspect.first, :action => "edit"
|
redirect_to Aspect.first, :action => "edit"
|
||||||
end
|
end
|
||||||
|
|
||||||
def move_friend
|
def move_friend
|
||||||
unless current_user.move_friend( :friend_id => params[:friend_id], :from => params[:from], :to => params[:to][:to])
|
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
|
end
|
||||||
if aspect = Aspect.first(:id => params[:to][:to])
|
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
|
respond_with aspect
|
||||||
else
|
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])
|
respond_with Person.first(:id => params[:friend_id])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -4,18 +4,18 @@
|
||||||
|
|
||||||
|
|
||||||
%h1
|
%h1
|
||||||
Add a new friend to
|
=t('.add_a_new_friend_to')
|
||||||
%i= aspect.name
|
%i= aspect.name
|
||||||
|
|
||||||
= form_for Request.new do |f|
|
= form_for Request.new do |f|
|
||||||
= f.error_messages
|
= f.error_messages
|
||||||
|
|
||||||
Enter a Diaspora username:
|
=t('.enter_a_diaspora_username')
|
||||||
%br
|
%br
|
||||||
%i= "Your Diaspora username is: #{current_user.diaspora_handle}"
|
%i= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle
|
||||||
|
|
||||||
%p
|
%p
|
||||||
= f.label :destination_url, "Friend's username"
|
= f.label :destination_url, t(".friends_username")
|
||||||
= f.text_field :destination_url
|
= f.text_field :destination_url
|
||||||
= f.hidden_field :aspect_id, :value => aspect.id
|
= f.hidden_field :aspect_id, :value => aspect.id
|
||||||
= f.submit
|
= f.submit
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,18 @@ de:
|
||||||
new_aspect:
|
new_aspect:
|
||||||
add_a_new_aspect: "Neuen Aspekt erstellen"
|
add_a_new_aspect: "Neuen Aspekt erstellen"
|
||||||
create: "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:
|
helper:
|
||||||
remove: "remove"
|
remove: "remove"
|
||||||
aspect_not_empty: "Aspect not empty"
|
aspect_not_empty: "Aspect not empty"
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,17 @@ en:
|
||||||
add_a_new_aspect: "Add a new aspect"
|
add_a_new_aspect: "Add a new aspect"
|
||||||
create: "Create"
|
create: "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:
|
helper:
|
||||||
remove: "remove"
|
remove: "remove"
|
||||||
aspect_not_empty: "Aspect not empty"
|
aspect_not_empty: "Aspect not empty"
|
||||||
|
|
@ -164,3 +174,9 @@ en:
|
||||||
save: "save"
|
save: "save"
|
||||||
are_you_sure: "Are you sure?"
|
are_you_sure: "Are you sure?"
|
||||||
remove_friend: "remove friend"
|
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"
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,16 @@ es:
|
||||||
create: "Crear"
|
create: "Crear"
|
||||||
create:
|
create:
|
||||||
success:"Pulsa en el signo de mas a la izquierda para escojer quien puede ver su nuevo aspecto."
|
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:
|
helper:
|
||||||
remove: "remover"
|
remove: "remover"
|
||||||
aspect_not_empty: "Aspecto no esta vacio"
|
aspect_not_empty: "Aspecto no esta vacio"
|
||||||
|
|
@ -162,3 +172,9 @@ es:
|
||||||
save: "guardar"
|
save: "guardar"
|
||||||
are_you_sure: "Esta seguro?"
|
are_you_sure: "Esta seguro?"
|
||||||
remove_friend: "remover amigo"
|
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"
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,18 @@ fr:
|
||||||
new_aspect:
|
new_aspect:
|
||||||
add_a_new_aspect: "Ajouter un nouvel aspect"
|
add_a_new_aspect: "Ajouter un nouvel aspect"
|
||||||
create: "Créer"
|
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:
|
helper:
|
||||||
remove: "remove"
|
remove: "remove"
|
||||||
aspect_not_empty: "Aspect not empty"
|
aspect_not_empty: "Aspect not empty"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue