mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-01 05:54:32 +02:00
Added translations for 2FA.
This commit is contained in:
parent
0c7a8bd85e
commit
96fa3be7cc
8 changed files with 1612 additions and 78 deletions
|
@ -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!');
|
||||
}
|
||||
|
||||
|
|
|
@ -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']
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue