Simple, the code in src/Illuminate/Pagination/LengthAwarePaginator.php line 118, 122 don't use locale.
})->prepend([
'url' => $this->previousPageUrl(),
'label' => 'Previous',
'active' => false,
])->push([
'url' => $this->nextPageUrl(),
'label' => 'Next',
'active' => false,
]);
It should use the locale, something like:
'label' => __('pagination.next'),
Thanks.
1- Install Laravel with other than English locale
2- Use the pagination function for Collection and see the result in JSON
Sure, PR it.
@taylorotwell Great, PR is open. https://github.com/laravel/framework/pull/34710
This PR for this had to be reverted because it used an IlluminateFoundation helper (__) in a component. That can cause problems for people using it outside of Laravel. So, we would have to find another way to solve this.
@taylorotwell What will be the better way then, a function check ? Or other translations methods ? Default values ?
Checking if the function exists is probably reasonable middle ground, yeah.
New PR open for this. https://github.com/laravel/framework/pull/34714
Thanks.