Skip to content
Extraits de code Groupes Projets
Valider c1c20e14 rédigé par Ariel Zavala's avatar Ariel Zavala
Parcourir les fichiers

Added translations to requests controller

parent f95cebcb
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -13,15 +13,15 @@ class RequestsController < ApplicationController ...@@ -13,15 +13,15 @@ class RequestsController < ApplicationController
if params[:accept] if params[:accept]
if params[:aspect_id] if params[:aspect_id]
@friend = current_user.accept_and_respond( params[:id], 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]) respond_with :location => current_user.aspect_by_id(params[:aspect_id])
else else
flash[:error] = "Please select an aspect!" flash[:error] = I18n.t 'requests.destroy.error'
respond_with :location => requests_url respond_with :location => requests_url
end end
else else
current_user.ignore_friend_request params[:id] current_user.ignore_friend_request params[:id]
flash[:notice] = "Ignored friend request." flash[:notice] = I18n.t 'requests.destroy.ignore'
respond_with :location => requests_url respond_with :location => requests_url
end end
end end
...@@ -37,7 +37,7 @@ class RequestsController < ApplicationController ...@@ -37,7 +37,7 @@ class RequestsController < ApplicationController
rel_hash = relationship_flow(params[:request][:destination_url]) rel_hash = relationship_flow(params[:request][:destination_url])
rescue Exception => e rescue Exception => e
raise e unless e.message.include? "not found" 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 respond_with :location => aspect
return return
end end
...@@ -48,16 +48,16 @@ class RequestsController < ApplicationController ...@@ -48,16 +48,16 @@ class RequestsController < ApplicationController
@request = current_user.send_friend_request_to(rel_hash[:friend], aspect) @request = current_user.send_friend_request_to(rel_hash[:friend], aspect)
rescue Exception => e rescue Exception => e
raise e unless e.message.include? "already friends" 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 respond_with :location => aspect
return return
end end
if @request 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 respond_with :location => aspect
else else
flash[:error] = "Something went horribly wrong." flash[:error] = I18n.t 'requests.create.horribly_wrong'
respond_with :location => aspect respond_with :location => aspect
end end
end end
......
...@@ -175,3 +175,12 @@ de: ...@@ -175,3 +175,12 @@ de:
save: "save" save: "save"
are_you_sure: "Are you sure?" are_you_sure: "Are you sure?"
remove_friend: "remove friend" 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: ...@@ -180,3 +180,12 @@ en:
enter_a_diaspora_username: "Enter a Diaspora username:" enter_a_diaspora_username: "Enter a Diaspora username:"
your_diaspora_username_is: "Your Diaspora username is: %{diaspora_handle}" your_diaspora_username_is: "Your Diaspora username is: %{diaspora_handle}"
friends_username: "Friend's username" 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: ...@@ -30,11 +30,11 @@ es:
logout: "desloguear" logout: "desloguear"
shared: shared:
aspect_nav: aspect_nav:
all_aspects: "Todo los Aspectos" all_aspects: "Todos los Aspectos"
manage: "Manejar" manage: "Manejar"
manage_your_aspects: "Maneja tus Aspectos" manage_your_aspects: "Maneja tus Aspectos"
sub_header: sub_header:
all_aspects: "Todo los Aspectos" all_aspects: "Todos los Aspectos"
manage_aspects: "Manejar Aspectos" manage_aspects: "Manejar Aspectos"
publisher: publisher:
share: "Compartir" share: "Compartir"
...@@ -178,3 +178,12 @@ es: ...@@ -178,3 +178,12 @@ es:
enter_a_diaspora_username: "Escribe el usuario de Diaspora:" enter_a_diaspora_username: "Escribe el usuario de Diaspora:"
your_diaspora_username_is: "Tu usuario de Diaspora es: %{diaspora_handle}" your_diaspora_username_is: "Tu usuario de Diaspora es: %{diaspora_handle}"
friends_username: "Usuario de amigo" 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: ...@@ -166,3 +166,13 @@ fr:
save: "save" save: "save"
are_you_sure: "Are you sure?" are_you_sure: "Are you sure?"
remove_friend: "remove friend" 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."
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter