Skip to content
Snippets Groups Projects
Commit a9d64d51 authored by Christian Foidl's avatar Christian Foidl
Browse files

Issue #3422412: Properly translate UI text

parent 9787e993
No related branches found
No related tags found
No related merge requests found
Pipeline #98756 passed
......@@ -7,7 +7,6 @@ use Drupal\Core\Flood\FloodInterface;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\BareHtmlPageRendererInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Url;
use Drupal\magic_code_email_login\MagicCodeEmailLoginFloodTrait;
use Drupal\user\UserInterface;
......@@ -85,7 +84,7 @@ class MagicCodeEmailLoginForm extends FormBase {
'spellcheck' => 'false',
'autofocus' => 'autofocus',
'autocomplete' => 'email',
'placeholder' => new TranslatableMarkup('email@example.com'),
'placeholder' => $this->t('email@example.com'),
],
];
......@@ -95,7 +94,7 @@ class MagicCodeEmailLoginForm extends FormBase {
'#attributes' => [
'class' => 'form-description',
],
'#value' => new TranslatableMarkup('You will receive a <strong>code</strong> via email with which you can log in.'),
'#value' => $this->t('You will receive a <strong>code</strong> via email with which you can log in.'),
];
$form['actions'] = [
......@@ -115,7 +114,7 @@ class MagicCodeEmailLoginForm extends FormBase {
'class' => 'button button--secondary button--login-with-pass',
'href' => Url::fromRoute('user.login', ['destination' => $destination])->toString(),
],
'#value' => 'Login with password',
'#value' => $this->t('Login with password'),
];
return $form;
......
......@@ -79,7 +79,9 @@ class MagicCodeEmailLoginVerifyForm extends MagicCodeVerifyFormBase {
public function buildForm(array $form, FormStateInterface $form_state) {
$email = $this->getRequest()->get('email');
if (!$email) {
$this->messenger()->addError('E-Mail not set, please try again!');
$this->messenger()->addError(
$this->t('E-Mail not set, please try again!')
);
$destination = $this->getRequest()->get('destination');
$this->getRequest()->query->remove('destination');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment