Added translations to photos and registrations controllers

This commit is contained in:
Ariel Zavala 2010-09-17 18:25:36 -04:00
parent ce3284f1a1
commit 4558f9901e
6 changed files with 51 additions and 7 deletions

View file

@ -40,15 +40,15 @@ class PhotosController < ApplicationController
end end
rescue TypeError rescue TypeError
message = "Photo upload failed. Are you sure an image was added?" message = I18n.t 'photos.create.type_error'
respond_with :location => album, :error => message respond_with :location => album, :error => message
rescue CarrierWave::IntegrityError rescue CarrierWave::IntegrityError
message = "Photo upload failed. Are you sure that was an image?" message = I18n.t 'photos.create.integrity_error'
respond_with :location => album, :error => message respond_with :location => album, :error => message
rescue RuntimeError => e rescue RuntimeError => e
message = "Photo upload failed. Are you sure that your seatbelt is fastened?" message = I18n.t 'photos.create.runtime_error'
respond_with :location => album, :error => message respond_with :location => album, :error => message
raise e raise e
end end
@ -63,7 +63,7 @@ class PhotosController < ApplicationController
def destroy def destroy
@photo = Photo.find_by_id params[:id] @photo = Photo.find_by_id params[:id]
@photo.destroy @photo.destroy
flash[:notice] = "Photo deleted." flash[:notice] = I18n.t 'photos.destroy.notice'
respond_with :location => @photo.album respond_with :location => @photo.album
end end
@ -84,10 +84,10 @@ class PhotosController < ApplicationController
def update def update
@photo = Photo.find_by_id params[:id] @photo = Photo.find_by_id params[:id]
if @photo.update_attributes params[:photo] if @photo.update_attributes params[:photo]
flash[:notice] = "Photo successfully updated." flash[:notice] = I18n.t 'photos.update.notice'
respond_with @photo respond_with @photo
else else
flash[:error] = "Failed to edit photo." flash[:error] = I18n.t 'photos.update.error'
render :action => :edit render :action => :edit
end end
end end

View file

@ -16,7 +16,7 @@ class RegistrationsController < Devise::RegistrationsController
end end
if user if user
#set_flash_message :notice, :signed_up #set_flash_message :notice, :signed_up
flash[:notice] = "You've joined Diaspora!" flash[:notice] = I18n.t 'registrations.create.success'
#redirect_to root_url #redirect_to root_url
sign_in_and_redirect(:user, user) sign_in_and_redirect(:user, user)
else else

View file

@ -137,9 +137,20 @@ de:
new_photo: "Foto erstellen" new_photo: "Foto erstellen"
back_to_list: "Zurück zur Liste" back_to_list: "Zurück zur Liste"
post_it: "Hochladen" post_it: "Hochladen"
create:
runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?"
integrity_error: "Photo upload failed. Are you sure that was an image?"
type_error: "Photo upload failed. Are you sure an image was added?"
update:
notice: "Photo successfully updated."
error: "Failed to edit photo."
destroy:
notice: "Photo deleted."
registrations: registrations:
new: new:
sign_up: "Anmelden" sign_up: "Anmelden"
create:
success: "You've joined Diaspora!"
status_messages: status_messages:
new_status_message: new_status_message:
tell_me_something_good: "Erzähl' mir was schönes!" tell_me_something_good: "Erzähl' mir was schönes!"

View file

@ -136,9 +136,20 @@ en:
new_photo: "New Photo" new_photo: "New Photo"
back_to_list: "Back to List" back_to_list: "Back to List"
post_it: "post it!" post_it: "post it!"
create:
runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?"
integrity_error: "Photo upload failed. Are you sure that was an image?"
type_error: "Photo upload failed. Are you sure an image was added?"
update:
notice: "Photo successfully updated."
error: "Failed to edit photo."
destroy:
notice: "Photo deleted."
registrations: registrations:
new: new:
sign_up: "Sign up" sign_up: "Sign up"
create:
success: "You've joined Diaspora!"
status_messages: status_messages:
new_status_message: new_status_message:
tell_me_something_good: "tell me something good" tell_me_something_good: "tell me something good"

View file

@ -137,9 +137,20 @@ es:
new_photo: "Nueva Foto" new_photo: "Nueva Foto"
back_to_list: "Devuelta a la lista" back_to_list: "Devuelta a la lista"
post_it: "post it!" post_it: "post it!"
create:
runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?"
integrity_error: "Photo upload failed. Are you sure that was an image?"
type_error: "Photo upload failed. Are you sure an image was added?"
update:
notice: "Photo successfully updated."
error: "Failed to edit photo."
destroy:
notice: "Photo deleted."
registrations: registrations:
new: new:
sign_up: "Registrate" sign_up: "Registrate"
create:
success: "Esta registrado en Diaspora!"
status_messages: status_messages:
new_status_message: new_status_message:
tell_me_something_good: "dime algo bueno" tell_me_something_good: "dime algo bueno"

View file

@ -128,9 +128,20 @@ fr:
new_photo: "Nouvelle photo" new_photo: "Nouvelle photo"
back_to_list: "Retour à la liste" back_to_list: "Retour à la liste"
post_it: "postez le !" post_it: "postez le !"
create:
runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?"
integrity_error: "Photo upload failed. Are you sure that was an image?"
type_error: "Photo upload failed. Are you sure an image was added?"
update:
notice: "Photo successfully updated."
error: "Failed to edit photo."
destroy:
notice: "Photo deleted."
registrations: registrations:
new: new:
sign_up: "Enregistrement" sign_up: "Enregistrement"
create:
success: "You've joined Diaspora!"
status_messages: status_messages:
new_status_message: new_status_message:
tell_me_something_good: "Dites quelque-chose de bien" tell_me_something_good: "Dites quelque-chose de bien"