Laravel 10 安装多语言 laravel-lang

这个大大提高了效率,无需自己汉化

进入项目目录下进行 composer 安装

composer require --dev laravel-lang/publisher
composer require --dev laravel-lang/lang
composer require --dev laravel-lang/attributes
composer require --dev laravel-lang/http-statuses

完成后安装所需要的语言包,我添加了四个

php artisan lang:add zh_TW zh_CN ja en

删除和更新等相关参考文档

Installation | Laravel Lang

部分语言标识列表

Referents by language | Laravel Lang

你可能感兴趣的:(laravel,前端,php)