0

我正在尝试在文章中显示日期,$article->created_at->diffForHumans()现在我正在使用英语,例如:2 小时前。

我想用捷克语获得日期。

我试过的:

通过这篇文章:Laravel 5 Carbon 全球语言环境如何为 Carbon 设置语言?

在 AppServicePrivider.php 中,我为 Carbon 设置了区域设置。

`public function boot()
{
    Carbon::setLocale('cz');

}`

但它没有用。我还尝试了不同的语言,如德语、西班牙语和法语,除了捷克语之外的所有作品。我正在使用 Laravel 5.6。

4

0 回答 0