Make invalid login message depend on use_nick (closes foodcoops#321)

This commit is contained in:
wvengen 2014-10-09 09:42:13 +02:00
parent 575928d8a3
commit 9a7b3378c3
5 changed files with 8 additions and 5 deletions

View file

@ -21,7 +21,7 @@ class SessionsController < ApplicationController
end end
redirect_to redirect_to_url, :notice => I18n.t('sessions.logged_in') redirect_to redirect_to_url, :notice => I18n.t('sessions.logged_in')
else else
flash.now.alert = I18n.t('sessions.login_invalid') flash.now.alert = I18n.t(FoodsoftConfig[:use_nick] ? 'sessions.login_invalid_nick' : 'sessions.login_invalid_email')
render "new" render "new"
end end
end end

View file

@ -1359,7 +1359,8 @@ de:
sessions: sessions:
logged_in: Angemeldet! logged_in: Angemeldet!
logged_out: Abgemeldet! logged_out: Abgemeldet!
login_invalid: Ungültiger Benutzername oder Passwort login_invalid_nick: Ungültiger Benutzername oder Passwort
login_invalid_email: Ungültiger Email oder Passwort
new: new:
forgot_password: Passwort vergessen? forgot_password: Passwort vergessen?
login: Anmelden login: Anmelden

View file

@ -1372,7 +1372,8 @@ en:
sessions: sessions:
logged_in: Logged in! logged_in: Logged in!
logged_out: Logged out! logged_out: Logged out!
login_invalid: Invalid username or password login_invalid_nick: Invalid username or password
login_invalid_email: Invalid email address or password
new: new:
forgot_password: Forgot password? forgot_password: Forgot password?
login: Login login: Login

View file

@ -1374,7 +1374,7 @@ fr:
sessions: sessions:
logged_in: Connecté! logged_in: Connecté!
logged_out: Déconnecté! logged_out: Déconnecté!
login_invalid: Identifiant ou mot de passe invalide login_invalid_nick: Identifiant ou mot de passe invalide
new: new:
forgot_password: Mot de passe oublié? forgot_password: Mot de passe oublié?
login: Te connecter login: Te connecter

View file

@ -1365,7 +1365,8 @@ nl:
sessions: sessions:
logged_in: Ingelogd! logged_in: Ingelogd!
logged_out: Uitgelogd! logged_out: Uitgelogd!
login_invalid: Onjuiste gebruikersnaam of wachtwoord login_invalid_nick: Gebruikersnaam of wachtwoord onjuist
login_invalid_email: Emailadres of wachtwoord onjuist
new: new:
forgot_password: Wachtwoord vergeten? forgot_password: Wachtwoord vergeten?
login: Aanmelden login: Aanmelden