中文安装后不起作用

中文包安装成功,配置也添加上,错误信息显示还是英文。想来可能是 composer 安装的时候出了什么问题,框架没有识别到中文包。遂把扩展包下的中文语言包/path/to/vendor/caouecs/laravel-lang/src/zh-CN复制到框架的语言包目录/path/to/resources/lang/zh-CN下,有效。
file

《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
讨论数量: 4
Nickel

去文档里翻了翻,发现是这样的说,
如果是laravel5 以上的需要替换这个地方:
Laraval 5.*
After completion of the above, Replace the config/app.php content
Illuminate\Translation\TranslationServiceProvider::class,
with:

Overtrue\LaravelLang\TranslationServiceProvider::class,
Lumen
Add the following line to bootstrap/app.php:

$app->register(Overtrue\LaravelLang\TranslationServiceProvider::class);

5年前 评论
Nickel

去文档里翻了翻,发现是这样的说,
如果是laravel5 以上的需要替换这个地方:
Laraval 5.*
After completion of the above, Replace the config/app.php content
Illuminate\Translation\TranslationServiceProvider::class,
with:

Overtrue\LaravelLang\TranslationServiceProvider::class,
Lumen
Add the following line to bootstrap/app.php:

$app->register(Overtrue\LaravelLang\TranslationServiceProvider::class);

5年前 评论

嗯, 也遇到了这个问题, 但是之前bbs教程里面, 改改local就好了, 很奇怪.

5年前 评论

嗯,现在laravel5.5.*设置表单验证错误中文提示不仅要改config/app.php中配置,还要复制语言包到sources/lang下.--2019.03.16

5年前 评论

我也是这个问题,看了大家的提问才知道怎么回事

5年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!