also internationalize sessions controller

This commit is contained in:
wvengen 2013-02-04 02:00:27 +01:00
parent 0c09696b2c
commit 1860e1c4cc
2 changed files with 7 additions and 3 deletions

View file

@ -17,15 +17,15 @@ class SessionsController < ApplicationController
else
redirect_to_url = root_url
end
redirect_to redirect_to_url, :notice => "Logged in!"
redirect_to redirect_to_url, :notice => I18n.t('sessions.logged_in')
else
flash.now.alert = "Invalid email or password"
flash.now.alert = I18n.t('sessions.login_invalid')
render "new"
end
end
def destroy
session[:user_id] = nil
redirect_to login_url, :notice => "Logged out!"
redirect_to login_url, :notice => I18n.t('session.logged_out')
end
end

View file

@ -8,3 +8,7 @@ de:
password: 'Passwort'
login: 'Anmelden'
forgot_password: 'Passwort vergessen?'
# used in controller
logged_in: 'Logged in!'
logged_out: 'Logged out!'
login_invalid: 'Invalid email or password'