Added translations to requests controller
This commit is contained in:
parent
f95cebcb8b
commit
c1c20e14f7
5 changed files with 46 additions and 9 deletions
|
|
@ -13,15 +13,15 @@ class RequestsController < ApplicationController
|
|||
if params[:accept]
|
||||
if params[:aspect_id]
|
||||
@friend = current_user.accept_and_respond( params[:id], params[:aspect_id])
|
||||
flash[:notice] = "You are now friends."
|
||||
flash[:notice] = I18n.t 'requests.destroy.success'
|
||||
respond_with :location => current_user.aspect_by_id(params[:aspect_id])
|
||||
else
|
||||
flash[:error] = "Please select an aspect!"
|
||||
flash[:error] = I18n.t 'requests.destroy.error'
|
||||
respond_with :location => requests_url
|
||||
end
|
||||
else
|
||||
current_user.ignore_friend_request params[:id]
|
||||
flash[:notice] = "Ignored friend request."
|
||||
flash[:notice] = I18n.t 'requests.destroy.ignore'
|
||||
respond_with :location => requests_url
|
||||
end
|
||||
end
|
||||
|
|
@ -37,7 +37,7 @@ class RequestsController < ApplicationController
|
|||
rel_hash = relationship_flow(params[:request][:destination_url])
|
||||
rescue Exception => e
|
||||
raise e unless e.message.include? "not found"
|
||||
flash[:error] = "No diaspora seed found with this email!"
|
||||
flash[:error] = I18n.t 'requests.create.error'
|
||||
respond_with :location => aspect
|
||||
return
|
||||
end
|
||||
|
|
@ -48,16 +48,16 @@ class RequestsController < ApplicationController
|
|||
@request = current_user.send_friend_request_to(rel_hash[:friend], aspect)
|
||||
rescue Exception => e
|
||||
raise e unless e.message.include? "already friends"
|
||||
flash[:notice] = "You are already friends with #{params[:request][:destination_url]}!"
|
||||
flash[:notice] = I18n.t 'requests.create.already_friends', :destination_url => params[:request][:destination_url]
|
||||
respond_with :location => aspect
|
||||
return
|
||||
end
|
||||
|
||||
if @request
|
||||
flash[:notice] = "A friend request was sent to #{@request.destination_url}."
|
||||
flash[:notice] = I18n.t 'requests.create.success',:destination_url => @request.destination_url
|
||||
respond_with :location => aspect
|
||||
else
|
||||
flash[:error] = "Something went horribly wrong."
|
||||
flash[:error] = I18n.t 'requests.create.horribly_wrong'
|
||||
respond_with :location => aspect
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -175,3 +175,12 @@ de:
|
|||
save: "save"
|
||||
are_you_sure: "Are you sure?"
|
||||
remove_friend: "remove friend"
|
||||
destroy:
|
||||
success: "You are now friends."
|
||||
error: "Please select an aspect!"
|
||||
ignore: "Ignored friend request."
|
||||
create:
|
||||
error: "No diaspora seed found with this email!"
|
||||
already_friends: "You are already friends with %{destination_url}!"
|
||||
success: "A friend request was sent to %{destination_url}."
|
||||
horribly_wrong: "Something went horribly wrong."
|
||||
|
|
|
|||
|
|
@ -180,3 +180,12 @@ en:
|
|||
enter_a_diaspora_username: "Enter a Diaspora username:"
|
||||
your_diaspora_username_is: "Your Diaspora username is: %{diaspora_handle}"
|
||||
friends_username: "Friend's username"
|
||||
destroy:
|
||||
success: "You are now friends."
|
||||
error: "Please select an aspect!"
|
||||
ignore: "Ignored friend request."
|
||||
create:
|
||||
error: "No diaspora seed found with this email!"
|
||||
already_friends: "You are already friends with %{destination_url}!"
|
||||
success: "A friend request was sent to %{destination_url}."
|
||||
horribly_wrong: "Something went horribly wrong."
|
||||
|
|
|
|||
|
|
@ -30,11 +30,11 @@ es:
|
|||
logout: "desloguear"
|
||||
shared:
|
||||
aspect_nav:
|
||||
all_aspects: "Todo los Aspectos"
|
||||
all_aspects: "Todos los Aspectos"
|
||||
manage: "Manejar"
|
||||
manage_your_aspects: "Maneja tus Aspectos"
|
||||
sub_header:
|
||||
all_aspects: "Todo los Aspectos"
|
||||
all_aspects: "Todos los Aspectos"
|
||||
manage_aspects: "Manejar Aspectos"
|
||||
publisher:
|
||||
share: "Compartir"
|
||||
|
|
@ -178,3 +178,12 @@ es:
|
|||
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"
|
||||
destroy:
|
||||
success: "Ahora son amigos."
|
||||
error: "Seleccione un aspecto!"
|
||||
ignore: "Ignorar peticion de amistad"
|
||||
create:
|
||||
error: "No diaspora seed found with this email!"
|
||||
already_friends: "Ya eres amigo de %{destination_url}!"
|
||||
success: "Una peticion de amistad se envio a %{destination_url}."
|
||||
horribly_wrong: "Algo horriblemente mal sucedio"
|
||||
|
|
|
|||
|
|
@ -166,3 +166,13 @@ fr:
|
|||
save: "save"
|
||||
are_you_sure: "Are you sure?"
|
||||
remove_friend: "remove friend"
|
||||
destroy:
|
||||
success: "You are now friends."
|
||||
error: "Please select an aspect!"
|
||||
ignore: "Ignored friend request."
|
||||
create:
|
||||
error: "No diaspora seed found with this email!"
|
||||
already_friends: "You are already friends with %{destination_url}!"
|
||||
success: "A friend request was sent to %{destination_url}."
|
||||
horribly_wrong: "Something went horribly wrong."
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue