Replace $this->l10n->t() with $this->t() for Modules

This commit is contained in:
Philipp 2021-11-18 21:33:05 +01:00
parent 207662251d
commit dab9e13c69
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
23 changed files with 246 additions and 226 deletions

View file

@ -70,11 +70,11 @@ class Recovery extends BaseModule
if (RecoveryCode::existsForUser(local_user(), $recovery_code)) {
RecoveryCode::markUsedForUser(local_user(), $recovery_code);
$this->session->set('2fa', true);
info($this->l10n->t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user())));
info($this->t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user())));
$this->auth->setForUser($this->app, User::getById($this->app->getLoggedInUserId()), true, true);
} else {
notice($this->l10n->t('Invalid code, please retry.'));
notice($this->t('Invalid code, please retry.'));
}
}
}
@ -93,11 +93,11 @@ class Recovery extends BaseModule
return Renderer::replaceMacros(Renderer::getMarkupTemplate('twofactor/recovery.tpl'), [
'$form_security_token' => self::getFormSecurityToken('twofactor_recovery'),
'$title' => $this->l10n->t('Two-factor recovery'),
'$message' => $this->l10n->t('<p>You can enter one of your one-time recovery codes in case you lost access to your mobile device.</p>'),
'$recovery_message' => $this->l10n->t('Dont have your phone? <a href="%s">Enter a two-factor recovery code</a>', '2fa/recovery'),
'$recovery_code' => ['recovery_code', $this->l10n->t('Please enter a recovery code'), '', '', '', 'placeholder="000000-000000"'],
'$recovery_label' => $this->l10n->t('Submit recovery code and complete login'),
'$title' => $this->t('Two-factor recovery'),
'$message' => $this->t('<p>You can enter one of your one-time recovery codes in case you lost access to your mobile device.</p>'),
'$recovery_message' => $this->t('Dont have your phone? <a href="%s">Enter a two-factor recovery code</a>', '2fa/recovery'),
'$recovery_code' => ['recovery_code', $this->t('Please enter a recovery code'), '', '', '', 'placeholder="000000-000000"'],
'$recovery_label' => $this->t('Submit recovery code and complete login'),
]);
}
}