diff --git a/src/Controller/UserSettingsController.php b/src/Controller/UserSettingsController.php index c524481e..afa62297 100644 --- a/src/Controller/UserSettingsController.php +++ b/src/Controller/UserSettingsController.php @@ -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!'); } diff --git a/src/Form/TFAGoogleSettingsType.php b/src/Form/TFAGoogleSettingsType.php index 17cc44ce..495e27c0 100644 --- a/src/Form/TFAGoogleSettingsType.php +++ b/src/Form/TFAGoogleSettingsType.php @@ -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'] ]); } diff --git a/templates/Users/_2fa_settings.html.twig b/templates/Users/_2fa_settings.html.twig index 1398a59a..56ac7255 100644 --- a/templates/Users/_2fa_settings.html.twig +++ b/templates/Users/_2fa_settings.html.twig @@ -59,10 +59,10 @@
{% trans %}tfa_google.manual_setup.type{% endtrans %}: TOTP
-{% trans %}tfa_google.manual_setup.username{% endtrans %}: {{ tfa_google.username }}
-{% trans %}tfa_google.manual_setup.secret{% endtrans %}: {{ tfa_google.secret }}
-{% trans %}tfa_google.manual_setup.digit_count{% endtrans %}: 6
+{% trans %}tfa_google.manual_setup.type{% endtrans %}: TOTP
+{% trans %}tfa_google.manual_setup.username{% endtrans %}: {{ tfa_google.username }}
+{% trans %}tfa_google.manual_setup.secret{% endtrans %}: {{ tfa_google.secret }}
+{% trans %}tfa_google.manual_setup.digit_count{% endtrans %}: 6