Laravel表单验证提示设置多语言
默认表单提示是英文的,我们可以安装语言包构建多语言环境。
根据版本选择命令
For Laravel 7.x : run composer require caouecs/laravel-lang:~6.0 For Laravel 6.x : run composer require caouecs/laravel-lang:~5.0
For Laravel 5.8 : run composer require caouecs/laravel-lang:~4.0
For Laravel 5.1-5.7 : run composer require caouecs/laravel-lang:~3.0
For Laravel 5 : run composer require caouecs/laravel-lang:~2.0
扩展包含大多数语言,语言包位于vendor/caouecs/larvel-lang/src 目录中。
根据需要复制语言包到 resources/lang 目录中。
修改 config/app.php 配置文件
"locale" => "zh-CN",
参考文档:https://www.wjcms.net/archives/laravel%E8%A1%A8%E5%8D%95%E9%AA%8C%E8%AF%81%E6%8F%90%E7%A4%BA%E8%AE%BE%E7%BD%AE%E5%A4%9A%E8%AF%AD%E8%A8%80
本文由博客一文多发平台 OpenWrite 发布!
以上是 Laravel表单验证提示设置多语言 的全部内容, 来源链接: utcz.com/z/517884.html