IMPR: i18n for AJAX security forms

This commit is contained in:
Tony Air 2024-02-27 16:24:11 +02:00
parent 505609bfef
commit ecf6afd33a
1 changed files with 21 additions and 3 deletions

View File

@ -72,12 +72,19 @@ class AjaxControllerEx extends Extension
self::_processFields($form);
//$form->addExtraClass('ajax-form');
$form->setLegend('Log in to your service account');
if ($form->get_protector()) {
$form->enableSpamProtection();
}
$form->setLegend(
_t(
'SilverStripe\\Security\\Security.LOGINFORMLEGEND',
'Log in'
)
);
return $form;
}
@ -94,13 +101,24 @@ class AjaxControllerEx extends Extension
self::_processFields($form);
$form->addExtraClass('ajax-form');
$form->setLegend('I\'ve lost my password');
$form->Actions()->first()->setTitle('Submit');
$form->Actions()->first()->setTitle(
_t(
'SilverStripe\\Security\\Security.SUBMITTITLE',
'Submit'
)
);
if ($form->get_protector()) {
$form->enableSpamProtection();
}
$form->setLegend(
_t(
'SilverStripe\\Security\\Security.LOSTPASSWORDFORMLEGEND',
'I\'ve lost my password'
)
);
return $form;
}