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

@ -29,30 +29,30 @@ class HTTPException
$titles = [
200 => 'OK',
400 => L10n::t('Bad Request'),
401 => L10n::t('Unauthorized'),
403 => L10n::t('Forbidden'),
404 => L10n::t('Not Found'),
500 => L10n::t('Internal Server Error'),
503 => L10n::t('Service Unavailable'),
400 => DI::l10n()->t('Bad Request'),
401 => DI::l10n()->t('Unauthorized'),
403 => DI::l10n()->t('Forbidden'),
404 => DI::l10n()->t('Not Found'),
500 => DI::l10n()->t('Internal Server Error'),
503 => DI::l10n()->t('Service Unavailable'),
];
$title = ($titles[$e->getCode()] ?? '') ?: 'Error ' . $e->getCode();
if (empty($message)) {
// Explanations are taken from https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
$explanation = [
400 => L10n::t('The server cannot or will not process the request due to an apparent client error.'),
401 => L10n::t('Authentication is required and has failed or has not yet been provided.'),
403 => L10n::t('The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource, or may need an account.'),
404 => L10n::t('The requested resource could not be found but may be available in the future.'),
500 => L10n::t('An unexpected condition was encountered and no more specific message is suitable.'),
503 => L10n::t('The server is currently unavailable (because it is overloaded or down for maintenance). Please try again later.'),
400 => DI::l10n()->t('The server cannot or will not process the request due to an apparent client error.'),
401 => DI::l10n()->t('Authentication is required and has failed or has not yet been provided.'),
403 => DI::l10n()->t('The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource, or may need an account.'),
404 => DI::l10n()->t('The requested resource could not be found but may be available in the future.'),
500 => DI::l10n()->t('An unexpected condition was encountered and no more specific message is suitable.'),
503 => DI::l10n()->t('The server is currently unavailable (because it is overloaded or down for maintenance). Please try again later.'),
];
$message = $explanation[$e->getCode()] ?? '';
}
return ['$title' => $title, '$message' => $message, '$back' => L10n::t('Go back')];
return ['$title' => $title, '$message' => $message, '$back' => DI::l10n()->t('Go back')];
}
/**