fix login i18n

This commit is contained in:
wvengen 2013-04-26 21:32:19 +02:00
parent 98b729eb71
commit 53d5eabf79
3 changed files with 27 additions and 26 deletions

View file

@ -22,7 +22,7 @@ class LoginController < ApplicationController
logger.debug("Sent password reset email to #{user.email}.")
end
end
redirect_to login_url, :notice => I18n.t('login.reset_password.notice')
redirect_to login_url, :notice => I18n.t('login.controller.reset_password.notice')
end
# Set a new password with a token from the password reminder email.
@ -38,7 +38,7 @@ class LoginController < ApplicationController
@user.reset_password_token = nil
@user.reset_password_expires = nil
@user.save
redirect_to login_url, :notice => I18n.t('login.update_password.notice')
redirect_to login_url, :notice => I18n.t('login.controller.update_password.notice')
else
render :new_password
end
@ -48,9 +48,9 @@ class LoginController < ApplicationController
def accept_invitation
@invite = Invite.find_by_token(params[:token])
if @invite.nil? || @invite.expires_at < Time.now
redirect_to login_url, alert: I18n.t('login.errors.invite_invalid')
redirect_to login_url, alert: I18n.t('login.controller.error_invite_invalid')
elsif @invite.group.nil?
redirect_to login_url, alert: I18n.t('login.errors.group_invalid')
redirect_to login_url, alert: I18n.t('login.controller.error_group_invalid')
elsif request.post?
User.transaction do
@user = User.new(params[:user])
@ -58,7 +58,7 @@ class LoginController < ApplicationController
if @user.save
Membership.new(:user => @user, :group => @invite.group).save!
@invite.destroy
redirect_to login_url, notice: I18n.t('login.accept_invitation.notice')
redirect_to login_url, notice: I18n.t('login.controller.accept_invitation.notice')
end
end
else
@ -71,7 +71,7 @@ class LoginController < ApplicationController
def validate_token
@user = User.find_by_id_and_reset_password_token(params[:id], params[:token])
if (@user.nil? || @user.reset_password_expires < Time.now)
redirect_to forgot_password_url, alert: I18n.t('login.errors.token_invalid')
redirect_to forgot_password_url, alert: I18n.t('login.controller.error_token_invalid')
end
end
end

View file

@ -25,15 +25,15 @@ de:
submit: 'Neues passwort speichern'
# used by controller
controller:
reset_password:
notice: 'Wenn Deine E-Mail hier registiert ist bekommst Du jetzt eine Nachricht mit einem Passwort-Zurücksetzen-Link.'
update_password:
notice: 'Dein Passwort wurde aktualisiert. Du kannst Dich jetzt anmelden.'
accept_invitation:
notice: 'Herzlichen Glückwunsch, Dein Account wurde erstellt. Du kannst Dich nun einloggen.'
errors:
invite_invalid: 'Deine Einladung ist nicht (mehr) gültig.'
group_invalid: 'Die Gruppe, in die Du eingeladen wurdest, existiert leider nicht mehr."'
token_invalid: 'Ungültiger oder abgelaufener Token. Bitte versuch es erneut.'
error_invite_invalid: 'Deine Einladung ist nicht (mehr) gültig.'
error_group_invalid: 'Die Gruppe, in die Du eingeladen wurdest, existiert leider nicht mehr.'
error_token_invalid: 'Ungültiger oder abgelaufener Token. Bitte versuch es erneut.'

View file

@ -25,13 +25,14 @@ en:
submit: 'Save new password'
# used by controller
controller:
reset_password:
notice: 'If your email is registered here, you will receive a message with a link to reset your password.'
update_password:
notice: 'Your password was updated. You can login now.'
accept_invitation:
notice: 'Congratulations, your account was created. You can login now.'
errors:
invite_invalid: 'Your invite is not valid (anymore).'
group_invalid: 'The group in which you were invited doesnt exist anymore."'
token_invalid: 'Invalid or expired token. Please try again.'
error_invite_invalid: 'Your invite is not valid (anymore).'
error_group_invalid: 'The group in which you were invited doesnt exist anymore.'
error_token_invalid: 'Invalid or expired token. Please try again.'