also internationalize sessions controller
This commit is contained in:
parent
0c09696b2c
commit
1860e1c4cc
2 changed files with 7 additions and 3 deletions
|
@ -17,15 +17,15 @@ class SessionsController < ApplicationController
|
||||||
else
|
else
|
||||||
redirect_to_url = root_url
|
redirect_to_url = root_url
|
||||||
end
|
end
|
||||||
redirect_to redirect_to_url, :notice => "Logged in!"
|
redirect_to redirect_to_url, :notice => I18n.t('sessions.logged_in')
|
||||||
else
|
else
|
||||||
flash.now.alert = "Invalid email or password"
|
flash.now.alert = I18n.t('sessions.login_invalid')
|
||||||
render "new"
|
render "new"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
session[:user_id] = nil
|
session[:user_id] = nil
|
||||||
redirect_to login_url, :notice => "Logged out!"
|
redirect_to login_url, :notice => I18n.t('session.logged_out')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,3 +8,7 @@ de:
|
||||||
password: 'Passwort'
|
password: 'Passwort'
|
||||||
login: 'Anmelden'
|
login: 'Anmelden'
|
||||||
forgot_password: 'Passwort vergessen?'
|
forgot_password: 'Passwort vergessen?'
|
||||||
|
# used in controller
|
||||||
|
logged_in: 'Logged in!'
|
||||||
|
logged_out: 'Logged out!'
|
||||||
|
login_invalid: 'Invalid email or password'
|
||||||
|
|
Loading…
Reference in a new issue