diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index d602a206..72078d8d 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -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 diff --git a/config/locales/de/de.sessions.yml b/config/locales/de/de.sessions.yml index 1b0b1d6c..cf621abe 100644 --- a/config/locales/de/de.sessions.yml +++ b/config/locales/de/de.sessions.yml @@ -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'