Added translations for 2FA.

This commit is contained in:
Jan Böhmer 2020-01-01 15:42:18 +01:00
parent 0c7a8bd85e
commit 96fa3be7cc
8 changed files with 1612 additions and 78 deletions

View file

@ -69,7 +69,7 @@ class UserSettingsController extends AbstractController
}
if (empty($user->getBackupCodes())) {
$this->addFlash('error', 'You do not have any backup codes enabled, therefore you can not view them!');
$this->addFlash('error', 'tfa_backup.no_codes_enabled');
throw new Exception('You do not have any backup codes enabled, therefore you can not view them!');
}

View file

@ -40,9 +40,8 @@ class TFAGoogleSettingsType extends AbstractType
protected $translator;
public function __construct(TranslatorInterface $translator)
public function __construct()
{
$this->translator = $translator;
}
public function buildForm(FormBuilderInterface $builder, array $options)
@ -73,11 +72,11 @@ class TFAGoogleSettingsType extends AbstractType
);
$form->add('submit', SubmitType::class, [
'label' => $this->translator->trans('tfa_google.enable')
'label' => 'tfa_google.enable'
]);
} else {
$form->add('submit', SubmitType::class, [
'label' => $this->translator->trans('tfa_google.disable'),
'label' =>'tfa_google.disable',
'attr' => ['class' => 'btn-danger']
]);
}