Merge pull request #2578 from alxwr/master

Translate AuthController flash messages
This commit is contained in:
Lucas Bartholemy 2017-06-04 19:04:46 +02:00 committed by GitHub
commit 80a307584f
2 changed files with 16 additions and 5 deletions

View File

@ -121,12 +121,18 @@ class AuthController extends Controller
// Check if E-Mail is given
if (!isset($attributes['email'])) {
Yii::$app->session->setFlash('error', "Missing E-Mail Attribute from AuthClient.");
Yii::$app->session->setFlash('error', Yii::t(
'UserModule.base',
'Missing E-Mail Attribute from AuthClient.'
));
return $this->redirect(['/user/auth/login']);
}
if (!isset($attributes['id'])) {
Yii::$app->session->setFlash('error', "Missing ID AuthClient Attribute from AuthClient.");
Yii::$app->session->setFlash('error', Yii::t(
'UserModule.base',
'Missing ID AuthClient Attribute from AuthClient.'
));
return $this->redirect(['/user/auth/login']);
}
@ -177,11 +183,11 @@ class AuthController extends Controller
$redirectUrl = Yii::$app->user->returnUrl;
}
} elseif ($user->status == User::STATUS_DISABLED) {
Yii::$app->session->setFlash('error', 'Your account is disabled!');
Yii::$app->session->setFlash('error', Yii::t('UserModule.base', 'Your account is disabled!'));
} elseif ($user->status == User::STATUS_NEED_APPROVAL) {
Yii::$app->session->setFlash('error', 'Your account is not approved yet!');
Yii::$app->session->setFlash('error', Yii::t('UserModule.base', 'Your account is not approved yet!'));
} else {
Yii::$app->session->setFlash('error', 'Unknown user status!');
Yii::$app->session->setFlash('error', Yii::t('UserModule.base', 'Unknown user status!'));
}
if (Yii::$app->request->getIsAjax()) {

View File

@ -32,4 +32,9 @@ return array (
'You\'re not registered.' => 'Du bist nicht registriert.',
'Your new password must not equal your current password!' => 'Das neue Passwort muss sich vom aktuellen Passwort unterscheiden!',
'or' => 'oder',
'You're not registered.' => 'Du bist nicht registriert.',
'User with the same email already exists but isn't linked to you. Login using your email first to link it.' => 'Ein Benutzer mit der selben Email-Adresse existiert bereits. Dieser ist aber nicht mit dir verknüpft. Melde dich mit deiner Email-Adresse an, um die Verknüpfung herzustellen.',
'Your account is disabled!' => 'Dein Accound ist deaktiviert!',
'Your account is not approved yet!' => 'Dein Account wurde noch nicht freigeschalten!',
'Unknown user status!' => 'Unbekannter User-Status!',
);