added I18n support to inactive_message in RegistrationsController

This commit is contained in:
hck 2011-08-02 08:11:25 +03:00
parent bc9ea93f50
commit 7264bb55b2
2 changed files with 5 additions and 1 deletions

View File

@ -19,7 +19,7 @@ class Devise::RegistrationsController < ApplicationController
sign_in(resource_name, resource)
respond_with resource, :location => redirect_location(resource_name, resource)
else
set_flash_message :notice, :inactive_signed_up, :reason => resource.inactive_message.to_s if is_navigational_format?
set_flash_message :notice, :inactive_signed_up, :reason => I18n.t("devise.registrations.reasons." << resource.inactive_message.to_s) if is_navigational_format?
expire_session_data_after_sign_in!
respond_with resource, :location => after_inactive_sign_up_path_for(resource)
end

View File

@ -37,6 +37,10 @@ en:
inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
updated: 'You updated your account successfully.'
destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
reasons:
inactive: 'inactive'
unconfirmed: 'unconfirmed'
locked: 'locked'
unlocks:
send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
unlocked: 'Your account was successfully unlocked. You are now signed in.'