diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 82c35b36c9b75cee0a519d3eb047bdb2dec83125..5d572742af38770155fd42a547158ae81fad2088 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -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 diff --git a/app/views/requests/_new_request.haml b/app/views/requests/_new_request.haml index b7e5819f69cbf5534b2013577e9597b988b488de..70c204e7cb5a9e0ee9001f8484df58c092fb74e0 100644 --- a/app/views/requests/_new_request.haml +++ b/app/views/requests/_new_request.haml @@ -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 diff --git a/config/locales/de.yml b/config/locales/de.yml index 06fb5e6cb673a4fb3fd74d65016464d6834b49e2..07ff690d7b1743cdaf42e7cb909af3d7c3f17941 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -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" diff --git a/config/locales/en.yml b/config/locales/en.yml index f4dc9d076a06844a01595dc852af0b655a163de1..cd8055775cccc62d3fb89a6004125aa1eccca7af 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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" diff --git a/config/locales/es.yml b/config/locales/es.yml index 7243c73a5a403a884e63931fbdc3fe279cd725c2..b9c11e4a6aa207440ceb933860c112dab43dff4a 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -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" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 0384d4577e7b14ea779ba95aef82df91a29d2f19..7d58cd4aa9d3024869e0c3184a19fb007580fe56 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -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"