Move L10n::t() calls to DI::l10n()->t() calls

This commit is contained in:
nupplaPhil 2020-01-18 20:52:34 +01:00
parent af88c2daa3
commit 5dfee31108
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
175 changed files with 2841 additions and 2841 deletions

View file

@ -87,8 +87,8 @@ class Login extends BaseModule
$reg = false;
if ($register && intval(DI::config()->get('config', 'register_policy')) !== Register::CLOSED) {
$reg = [
'title' => L10n::t('Create a New Account'),
'desc' => L10n::t('Register'),
'title' => DI::l10n()->t('Create a New Account'),
'desc' => DI::l10n()->t('Register'),
'url' => self::getRegisterURL()
];
}
@ -112,12 +112,12 @@ class Login extends BaseModule
}
if (!empty(Session::get('openid_identity'))) {
$openid_title = L10n::t('Your OpenID: ');
$openid_title = DI::l10n()->t('Your OpenID: ');
$openid_readonly = true;
$identity = Session::get('openid_identity');
$username_desc = L10n::t('Please enter your username and password to add the OpenID to your existing account.');
$username_desc = DI::l10n()->t('Please enter your username and password to add the OpenID to your existing account.');
} else {
$openid_title = L10n::t('Or login using OpenID: ');
$openid_title = DI::l10n()->t('Or login using OpenID: ');
$openid_readonly = false;
$identity = '';
$username_desc = '';
@ -127,12 +127,12 @@ class Login extends BaseModule
$tpl,
[
'$dest_url' => DI::baseUrl()->get(true) . '/login',
'$logout' => L10n::t('Logout'),
'$login' => L10n::t('Login'),
'$logout' => DI::l10n()->t('Logout'),
'$login' => DI::l10n()->t('Login'),
'$lname' => ['username', L10n::t('Nickname or Email: '), '', $username_desc],
'$lpassword' => ['password', L10n::t('Password: '), '', ''],
'$lremember' => ['remember', L10n::t('Remember me'), 0, ''],
'$lname' => ['username', DI::l10n()->t('Nickname or Email: '), '', $username_desc],
'$lpassword' => ['password', DI::l10n()->t('Password: '), '', ''],
'$lremember' => ['remember', DI::l10n()->t('Remember me'), 0, ''],
'$openid' => !$noid,
'$lopenid' => ['openid_url', $openid_title, $identity, '', $openid_readonly],
@ -141,14 +141,14 @@ class Login extends BaseModule
'$register' => $reg,
'$lostpass' => L10n::t('Forgot your password?'),
'$lostlink' => L10n::t('Password Reset'),
'$lostpass' => DI::l10n()->t('Forgot your password?'),
'$lostlink' => DI::l10n()->t('Password Reset'),
'$tostitle' => L10n::t('Website Terms of Service'),
'$toslink' => L10n::t('terms of service'),
'$tostitle' => DI::l10n()->t('Website Terms of Service'),
'$toslink' => DI::l10n()->t('terms of service'),
'$privacytitle' => L10n::t('Website Privacy Policy'),
'$privacylink' => L10n::t('privacy policy'),
'$privacytitle' => DI::l10n()->t('Website Privacy Policy'),
'$privacylink' => DI::l10n()->t('privacy policy'),
]
);

View file

@ -40,11 +40,11 @@ class Recovery extends BaseModule
if (RecoveryCode::existsForUser(local_user(), $recovery_code)) {
RecoveryCode::markUsedForUser(local_user(), $recovery_code);
Session::set('2fa', true);
notice(L10n::t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user())));
notice(DI::l10n()->t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user())));
DI::auth()->setForUser($a, $a->user, true, true);
} else {
notice(L10n::t('Invalid code, please retry.'));
notice(DI::l10n()->t('Invalid code, please retry.'));
}
}
}
@ -63,11 +63,11 @@ class Recovery extends BaseModule
return Renderer::replaceMacros(Renderer::getMarkupTemplate('twofactor/recovery.tpl'), [
'$form_security_token' => self::getFormSecurityToken('twofactor_recovery'),
'$title' => L10n::t('Two-factor recovery'),
'$message' => 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' => L10n::t('Dont have your phone? <a href="%s">Enter a two-factor recovery code</a>', '2fa/recovery'),
'$recovery_code' => ['recovery_code', L10n::t('Please enter a recovery code'), '', '', '', 'placeholder="000000-000000"'],
'$recovery_label' => L10n::t('Submit recovery code and complete login'),
'$title' => DI::l10n()->t('Two-factor recovery'),
'$message' => DI::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' => DI::l10n()->t('Dont have your phone? <a href="%s">Enter a two-factor recovery code</a>', '2fa/recovery'),
'$recovery_code' => ['recovery_code', DI::l10n()->t('Please enter a recovery code'), '', '', '', 'placeholder="000000-000000"'],
'$recovery_label' => DI::l10n()->t('Submit recovery code and complete login'),
]);
}
}

View file

@ -40,7 +40,7 @@ class Verify extends BaseModule
// Resume normal login workflow
DI::auth()->setForUser($a, $a->user, true, true);
} else {
self::$errors[] = L10n::t('Invalid code, please retry.');
self::$errors[] = DI::l10n()->t('Invalid code, please retry.');
}
}
}
@ -59,13 +59,13 @@ class Verify extends BaseModule
return Renderer::replaceMacros(Renderer::getMarkupTemplate('twofactor/verify.tpl'), [
'$form_security_token' => self::getFormSecurityToken('twofactor_verify'),
'$title' => L10n::t('Two-factor authentication'),
'$message' => L10n::t('<p>Open the two-factor authentication app on your device to get an authentication code and verify your identity.</p>'),
'$title' => DI::l10n()->t('Two-factor authentication'),
'$message' => DI::l10n()->t('<p>Open the two-factor authentication app on your device to get an authentication code and verify your identity.</p>'),
'$errors_label' => L10n::tt('Error', 'Errors', count(self::$errors)),
'$errors' => self::$errors,
'$recovery_message' => L10n::t('Dont have your phone? <a href="%s">Enter a two-factor recovery code</a>', '2fa/recovery'),
'$verify_code' => ['verify_code', L10n::t('Please enter a code from your authentication app'), '', '', 'required', 'autofocus placeholder="000000"', 'tel'],
'$verify_label' => L10n::t('Verify code and complete login'),
'$recovery_message' => DI::l10n()->t('Dont have your phone? <a href="%s">Enter a two-factor recovery code</a>', '2fa/recovery'),
'$verify_code' => ['verify_code', DI::l10n()->t('Please enter a code from your authentication app'), '', '', 'required', 'autofocus placeholder="000000"', 'tel'],
'$verify_label' => DI::l10n()->t('Verify code and complete login'),
]);
}
}