Where are the http-statuses translation keys are actually used in Laravel?
#80
Answered
by
andrey-helldar
jhm-ciberman
asked this question in
Q&A
-
|
Question: Where are the |
Beta Was this translation helpful? Give feedback.
Answered by
andrey-helldar
Mar 30, 2023
Replies: 1 comment 9 replies
-
|
The keys for this project are not used under the hood of the Laravel framework. In turn, Laravel uses a direct translation of phrases such as The For example: namespace App\Exceptions;
class Handler extends BaseHandler
{
public function register(): void
{
$this->registerDefault();
}
protected function registerDefault(): void
{
$this->renderable(function (Throwable $e) {
$code = method_exists($e, 'getStatusCode') ? $e->getStatusCode() : $e->getCode();
return config('app.debug')
? $this->response($e->getMessage(), (int) $code)
: $this->response(__('http-statuses.' . $code), (int) $code);
});
}
} |
Beta Was this translation helpful? Give feedback.
9 replies
Answer selected by
andrey-helldar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The keys for this project are not used under the hood of the Laravel framework.
In turn, Laravel uses a direct translation of phrases such as
Not FoundorPage Expired.The
HTTP Statusespackage allows developers to use these keys themselves in their project.For example: