使用方法:

新建目录【项目目录/resources/lang/zh】

按以下内容创建文件,并将内容复制到文件中

修改

config/app.php

'locale' => 'zh',

'fallback_locale' => 'zh',

 <?php

 return [

     /*
|--------------------------------------------------------------------------
| Authentication Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used during authentication for various
| messages that we need to display to the user. You are free to modify
| these language lines according to your application's requirements.
|
*/ 'failed' => '当前凭证与我们的记录不相符',
'throttle' => '登录操作太频繁,请等待 :seconds 秒后重试。',
];

auth.php

 <?php

 return [

     /*
|--------------------------------------------------------------------------
| Pagination Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used by the paginator library to build
| the simple pagination links. You are free to change them to anything
| you want to customize your views to better match your application.
|
*/ 'previous' => '&laquo; 上一页',
'next' => '下一页 &raquo;', ];

pagination.php

 <?php

 return [

     /*
|--------------------------------------------------------------------------
| Password Reset Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are the default lines which match reasons
| that are given by the password broker for a password update attempt
| has failed, such as for an invalid token or invalid new password.
|
*/ 'password' => '密码必须最少为 6 个字符并与确认密码相同。',
'reset' => '您的密码已重置!',
'sent' => '我们已将密码重置链接发送到您的邮箱!',
'token' => '重置密码的令牌无效。',
'user' => "未找到使用此邮箱的用户。", ];

passwords.php

 <?php

 return [

     /*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
| the validator class. Some of these rules have multiple versions such
| as the size rules. Feel free to tweak each of these messages here.
|
*/ 'accepted' => ':attribute 必须为已接受',
'active_url' => ':attribute 不是有效的 URL',
'after' => ':attribute 必须大于 :date',
'after_or_equal' => ':attribute 必须大于或等于 :date',
'alpha' => ':attribute 可接受类型:字母',
'alpha_dash' => ':attribute 可接受类型:字母、数字、短划线和下划线',
'alpha_num' => ':attribute 可接受类型:字母、数字',
'array' => ':attribute 可接受类型:数组',
'before' => ':attribute 必须小于 :date',
'before_or_equal' => ':attribute 必须小于或等于 :date',
'between' => [
'numeric' => ':attribute 必须介于 [:min - :max] 之间',
'file' => ':attribute 最小::min KB,最大::max KB',
'string' => ':attribute 最少::min 个字符,最多::max 个字符',
'array' => ':attribute 最少::min 项,最多::max 项',
],
'boolean' => ':attribute 可接受类型:是 或 否',
'confirmed' => 'The :attribute confirmation does not match.',
'date' => ':attribute 不是有效的日期',
'date_format' => ':attribute 格式错误,格式::format.',
'different' => ':attribute 不能等于 :other',
'digits' => ':attribute 必须是 :digits 位数',
'digits_between' => ':attribute 最少 :min 位数,最多::max 位数',
'dimensions' => ':attribute 图片尺寸不匹配',
'distinct' => ':attribute 已存在相同的选项',
'email' => ':attribute 不是有效的邮箱地址',
'exists' => '不存在的选项::attribute',
'file' => ':attribute 必须是一个有效的文件',
'filled' => ':attribute 必须填写',
'gt' => [
'numeric' => ':attribute 必须大于 :value.',
'file' => ':attribute 必须大于 :value KB',
'string' => ':attribute 必须大于 :value 个字符',
'array' => ':attribute 必须大于 :value 项',
],
'gte' => [
'numeric' => ':attribute 必须大于或等于 :value',
'file' => ':attribute 必须大于或等于 :value KB',
'string' => ':attribute 必须大于或等于 :value 个字符',
'array' => ':attribute 必须大于或等于 :value 项',
],
'image' => ':attribute 必须是一个图像',
'in' => ':attribute 不是一个有效的值',
'in_array' => ':other 不包含 :attribute',
'integer' => ':attribute 必须是整数',
'ip' => ':attribute 无效的 IP 地址',
'ipv4' => ':attribute 无效的 IPv4 地址',
'ipv6' => ':attribute 无效的 IPv6 地址',
'json' => ':attribute 无效的 JSON 字符串',
'lt' => [
'numeric' => ':attribute 必须小于 :value.',
'file' => ':attribute 必须小于 :value KB',
'string' => ':attribute 必须小于 :value 个字符',
'array' => ':attribute 必须小于 :value 项',
],
'lte' => [
'numeric' => ':attribute 必须小于或等于 :value',
'file' => ':attribute 必须小于或等于 :value KB',
'string' => ':attribute 必须小于或等于 :value 个字符',
'array' => ':attribute 必须小于或等于 :value 项',
],
'max' => [
'numeric' => ':attribute 不能大于 :max',
'file' => ':attribute 不能大于 :max KB',
'string' => ':attribute 不能大于 :max 个字符',
'array' => ':attribute 不能多于 :max 项',
],
'mimes' => ':attribute 的文件类型必须是: :values.',
'mimetypes' => ':attribute 的文件类型必须是: :values.',
'min' => [
'numeric' => ':attribute 最小值::min.',
'file' => ':attribute 不能小于 :min KB',
'string' => ':attribute 最少 :min 个字符',
'array' => ':attribute 最少包含 :min 项',
],
'not_in' => '当前选项 :attribute 无效',
'not_regex' => ':attribute 格式错误',
'numeric' => ':attribute 必须是数值',
'present' => ':attribute 必须存在',
'regex' => ':attribute 格式错误',
'required' => '必须指定::attribute',
'required_if' => '当 :other 等于 :value 时,必须指定::attribute',
'required_unless' => '除非 :values 包含 :other,否则必须指定::attribute',
'required_with' => '当 :values 存在时,必须指定::attribute',
'required_with_all' => '当 :values 存在时,必须指定::attribute',
'required_without' => '当 :values 不存在时,必须指定::attribute',
'required_without_all' => '当 :values 未指定时,必须指定::attribute',
'same' => ':attribute 必须与 :other 相匹配',
'size' => [
'numeric' => ':attribute 必须是 :size',
'file' => ':attribute 必须是 :size KB',
'string' => ':attribute 必须是 :size 个字符',
'array' => ':attribute 必须是 :size 项',
],
'string' => ':attribute 必须是字符串',
'timezone' => ':attribute 必须是有效的时区',
'unique' => ':attribute 不能与已存在的项相同',
'uploaded' => ':attribute 上传失败',
'url' => ':attribute 格式错误',
'uuid' => ':attribute 无效的 UUID 格式', /*
|--------------------------------------------------------------------------
| Custom Validation Language Lines
|--------------------------------------------------------------------------
|
| Here you may specify custom validation messages for attributes using the
| convention "attribute.rule" to name the lines. This makes it quick to
| specify a specific custom language line for a given attribute rule.
|
*/ 'custom' => [
'attribute-name' => [
'rule-name' => 'custom-message',
],
], /*
|--------------------------------------------------------------------------
| Custom Validation Attributes
|--------------------------------------------------------------------------
|
| The following language lines are used to swap our attribute placeholder
| with something more reader friendly such as "E-Mail Address" instead
| of "email". This simply helps us make our message more expressive.
|
*/ 'attributes' => [], ];

validation.php

laravel 5.7 resources 本地化 简体中文的更多相关文章

  1. Laravel 5.4的本地化

    简介 Laravel 的本地化功能提供方便的方法来获取多语言的字符串,让你的网站可以简单的支持多语言. 语言包存放在 resources/lang 目录下的文件里.在此目录中应该有应用对应支持的语言并 ...

  2. Laravel Vuejs 实战:开发知乎 (3)本地化和自定义消息

    1.本地化 由于所有blade默认采用的是 _('')方式输出标签文本,所以可以安装一个语言包,直接指定本地语言为zh_CN即可: 安装 https://github.com/caouecs/Lara ...

  3. laravel基础课程---15、分页及验证码(lavarel分页效果如何实现)

    laravel基础课程---15.分页及验证码(lavarel分页效果如何实现) 一.总结 一句话总结: 数据库的paginate方法:$data=\DB::table("user" ...

  4. laravel基础课程---11、lavarel的ajax操作(ajax优劣势是什么)

    laravel基础课程---11.lavarel的ajax操作(ajax优劣势是什么) 一.总结 一句话总结: 优势:用户友好度:异步通信,不会频繁刷新页面,用户友好度比较高 优势:减轻数据库压力 缺 ...

  5. laravel基础课程---2、Laravel配置文件、路由及php artisan(php artisan是什么)

    laravel基础课程---2.Laravel配置文件.路由及php artisan(php artisan是什么) 一.总结 一句话总结: PHP工具匠:php artisan,其实本身就是一些PH ...

  6. laravel基础课程---1、laravel安装及基础介绍(laravel如何安装)

    laravel基础课程---1.laravel安装及基础介绍(laravel如何安装) 一.总结 一句话总结: [修改composer镜像地址].[明确laravel的安装要求].[安装指定版本的la ...

  7. iOS Programming Localization 本地化

    iOS Programming Localization 本地化 Internationalization is making sure your native cultural informatio ...

  8. WinNTSetup v3.8.7 正式版绿色增强版

    最强系统安装利器:WinNTSetup 现已更新至 v3.8.7 正式版!这次更新修复调整了诸多问题,新版非常好用接近完美!WinNTSetup 现在已经自带BCDBoot 选项,并且完全支持Wind ...

  9. php框架推荐

    ThinkPHP,  国内开发的框架,特别容易入门,中文文档细致,表述准确. Laravel, 国外框架,非常高级的一个框架,特别是前端比较模块化,但入门难一些,速度不高. laravel在lampp ...

随机推荐

  1. js小数乘法精确率问题

    研究拓扑图百分比乘法计算,带小数位计算会出现值溢出的问题 JS里做小数的乘法运算时会出现浮点错误:  结果是251.89999999999998 而不是251.9  这个问题想必有很多人为之头痛. 那 ...

  2. OpenLayers中的图层(转载)

    作者:田念明出处:http://www.cnblogs.com/nianming/本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法 ...

  3. 基础架构之日志管理平台搭建及java&net使用

    在现代化的软件开发流程中,日志显得非常的重要,不可能再零散的游离在各个项目中,等查看日志的时候再登录服务器去到特定的目录去查看,这显然很繁琐且效率低下,所有整合一套日志管理平台,也显得非常重要,这篇文 ...

  4. Open images from USB camera on linux using V4L2 with OpenCV

    I have always been using OpenCV's VideoCapture API to capture images from webcam or USB cameras. Ope ...

  5. restful课程凌杂知识点

      request.post:字典形式数据 request.body:收到的是源数据

  6. 1.初次运行git前的配置

    在系统上安装了 Git后,你会想要做几件事来定制你的 Git 环境. 每台计算机上只需要配置一次,程序升级时会保留配置信息. 你可以在任何时候再次通过运行命令来修改它们. Git 自带一个 git c ...

  7. C# 两个结构相同的类进行赋值

    假入两个类A类和B类不有任何继承关系,它们属性名相同,怎么给他们互相赋值呢?下面的方法就可以了. public L SetProperties<T, L>(T t) where L : n ...

  8. 一、docker学习笔记——安装docker

    系统win10 企业版 1.下载docker CE 2.安装.注意,由于docker 与Oracle VM VirtualBox 冲突,在windows平台上二者不可共存.你只能2选1!! 3.如果d ...

  9. angular2 文件上传

    ng2-file-upload文件上传 1.安装ng2-file-upload模块 npm install ng2-file-upload --save 2.如果使用systemjs打包,需要在配置s ...

  10. base64编码加密图片和展示图片

    base64是当前网络上最为常见的传输8Bit字节代码的编码方式其中之一.base64主要不是加密,它主要的用途是把某些二进制数转成普通字符用于 网络传输.由于这些二进制字符在传输协议中属于控制字符, ...