<?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 是不可用的链接.',
'after' => '注意: :attribute 必须为一个在 :date 之后的时间.',
'alpha' => '注意: :attribute 只允许全部为字母.',
'alpha_dash' => '注意: :attribute 只允许字幕,数字和_连接符.',
'alpha_num' => '注意: :attribute 只允许字幕和数字.',
'array' => '注意: :attribute 必须为数组.',
'before' => '注意: :attribute 必须为一个在 :date 之前的时间.',
'between' => [
'numeric' => '注意: :attribute 必须在 :min 至 :max 之间.',
'file' => '注意: :attribute 必须限制在 :min 至 :max k.',
'string' => '注意: :attribute 必须在 :min 至 :max 字符.',
'array' => '注意: :attribute 必须包含 :min 至 :max 键.',
],
'boolean' => '注意: :attribute 字段必须为 true 或 false.',
'confirmed' => '注意: :attribute 确认不匹配.',
'date' => '注意: :attribute 是一个不可用的时间.',
'date_format' => '注意: :attribute 不匹配: format :format.',
'different' => '注意: :attribute 和 :other 必须不同.',
'digits' => '注意: :attribute 必须 :digits 数值.',
'digits_between' => '注意: :attribute 必须在 :min 至 :max 数值之间.',
'dimensions' => '注意: :attribute 有无效的图片尺寸.',
'distinct' => '注意: :attribute 字段具有重复的值.',
'email' => '注意: :attribute 必须为可用的邮箱地址.',
'exists' => '注意: 选中的 :attribute 不可用.',
'file' => '注意: :attribute 必须为一个文件.',
'filled' => '注意: :attribute 字段必填.',
'image' => '注意: :attribute 必须为图片.',
'in' => '注意: 选中的 :attribute 不可以.',
'in_array' => '注意: :attribute 字段未出现在 :other 其中.',
'integer' => '注意: :attribute 必须为整数.',
'ip' => '注意: :attribute 必须为合法的IP地址.',
'json' => '注意: :attribute 必须为合法的JSON格式数据.',
'max' => [
'numeric' => '注意: :attribute 不可以比 :max 大.',
'file' => '注意: :attribute 不能超过 :max 千字节.',
'string' => '注意: :attribute 不可超过 :max 个字符.',
'array' => '注意: :attribute 不能超过 :max 个键值对.',
],
'mimes' => '注意: :attribute 必须为: :values 类型的文件.',
'min' => [
'numeric' => '注意: :attribute 必须最小为 :min.',
'file' => '注意: :attribute 必须至少 :min 千字节.',
'string' => '注意: :attribute 必须至少 :min 字符.',
'array' => '注意: :attribute 必须至少包含 :min 个键值对.',
],
'not_in' => '注意: 选中的 :attribute 不合法.',
'numeric' => '注意: :attribute 必须为数字.',
'present' => '注意: :attribute 必须出现.',
'regex' => '注意: :attribute 格式不合规范.',
'required' => '注意: :attribute 字段必填.',
'required_if' => '注意: :attribute 字段必填当 :other 即 :value.',
'required_unless' => '注意: :attribute 必填除非 :other 在 :values 其中.',
'required_with' => '注意: :attribute 必填当 :values 出现.',
'required_with_all' => '注意: :attribute 字段必填当 :values 出现.',
'required_without' => '注意: :attribute 字段必填当 :values 没有出现.',
'required_without_all' => '注意: :attribute 字段必填当 :values 无一可用.',
'same' => '注意: :attribute 和 :other 必须保持一致.',
'size' => [
'numeric' => '注意: :attribute 必须 :size.',
'file' => '注意: :attribute 必须包含 :size 千字节.',
'string' => '注意: :attribute 必须包含 :size 字符.',
'array' => '注意: :attribute 必须包含 :size 键.',
],
'string' => '注意: :attribute 必须为字符.',
'timezone' => '注意: :attribute 时区必须为合理的时区.',
'unique' => '注意: :attribute 已经被占用,请更换.',
'url' => '注意: :attribute 格式不可用.', /*
|--------------------------------------------------------------------------
| Custom Validation Language Lines
|--------------------------------------------------------------------------
|
| Here you may specify custom validation messages for attributes using 注意:
| convention "attribute.rule" to name 注意: 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
|--------------------------------------------------------------------------
|
| 注意: following language lines are used to swap attribute place-holders
| with something more reader friendly such as E-Mail Address instead
| of "email". This simply helps us make messages a little cleaner.
|
*/ 'attributes' => [], ];

  1.找到laravel框架中的resources\lang\找到en文件夹复制一份重命名zh

  2.然后复制以上代码到validation.php

  3.更改指定配置,找到config\app.php 找到'locale' => 'en',把en改成zh

  4.大功告成。

laravel表单中文错误提示本地化的更多相关文章

  1. Laravel表单验证提示设置多语言

    默认表单提示是英文的,我们可以安装语言包构建多语言环境. 根据版本选择命令 For Laravel 7.x : run composer require caouecs/laravel-lang:~6 ...

  2. Fort.js – 时尚、现代的表单填写进度提示效果

    Fort.js 是一款用于时尚.现代的表单填写进度提示效果的 JavaScript 库,你需要做的就是添加表单,剩下的任务就交给 Fort.js 算法了,使用非常简单.提供了Default.Gradi ...

  3. Laravel表单传值

    仔细阅读过Laravel官方文档的就不用看啦~ 整理下之前遇到的关于Laravel表单的一些小问题 表单传值无法传过去,因为laravel做了表单的防护 只需要将{{ csrf_field() }}放 ...

  4. django中ModelForm save方法 以及快速生成空表单或包含数据的表单 包含错误信息

    django中ModelForm学习系列一~save方法 Model代码 from django.db import models # Create your models here. class P ...

  5. Laravel 表单验证创建“表单请求”实现自定义请求类

    按照文档创建表单请求自定义类以后,调用总是403页面,咨询大佬说: public function authorize() { // 在表单验证类的这个方法这里要返回true,默认返回false,这个 ...

  6. 社群系统 ThinkSNS+ 中如何利用 Laravel 表单验证来验证用户名的?(我朝独有需求,两个字母占一个汉字。。。)

    ThinkSNS+后端框架使用laravel,每周和 laravel master 保持同步,而后台和 html 5 则采用 vue 开发.语言特性方面,采用 php 7 的严格模式. 言归正传,之所 ...

  7. laravel表单验证

    效果展示:         代码 实现: 后台: use Validator; public function login() { if($input = Input::all()){ //验证提交的 ...

  8. Servlet 快速开始 表单中文字段

    req.getParameter | getParameterValue 一大特点是 返回null表示没有. [web.xml] <servlet> <serlvlet-mappin ...

  9. Spring MVC 3 表单中文提交post请求和get请求乱码问题的解决方法

    在spring mvc 3.0 框架中,通过JSP页面.HTML页面以POST方式提交表单时,表单的参数传递到对应的servlet后会出现中文显示乱码的问题.解决办法可采用spring自带的过滤技术, ...

随机推荐

  1. Json转化与ExtJS树(后台处理)

    一.JSON对格式化数据的操作: 1.导入依赖包: import org.json.JSONArray; import org.json.JSONException; import org.json. ...

  2. 深入剖析ThreadLocal原理

    描述 ThreadLocal,很多地方叫做线程本地变量,也有些地方叫做线程本地存储.ThreadLocal为变量在每个线程中都创建了一个副本,那么每个线程可以访问自己内部的副本变量. 通常使用静态的变 ...

  3. 【python爬虫】scrapy入门7:Scrapy中runspider和crawl的区别

    runspider:不依赖创建项目 命令:scrapy runspider myspider.py  等同于  pyhton myspider.py crawl:使用spider进行爬取,依赖项目创建 ...

  4. tp5增删改查基本操作

    //插入数据 $res = Db::execute('insert into phptab(info) values("小张")'); dump($res); //修改数据 $re ...

  5. 使用net Manager工具远程连接Oracle配置监听

    一.在服务端配置Oracle端口 win + R 输入netca 弹出如下窗口后 选择监听程序配置,点击下一步: 二.配置端口号后使用Telnet工具调试端口是否连通 在命令行输入telnet 服务器 ...

  6. 第二章-数据绑定和第一个AnglarJS Web应用

    Angularjs中的数据绑定 AngularJS创建实时模板来代替视图,而不是将数据合并进模板之后更新DOM.任何一个独立视图组件中的值都是动态替换的.这个功能可以说是AngularJS中最最重要的 ...

  7. 像宝石一样的Java原子类

    十五年前,多处理器系统是高度专业化的系统,通常耗资数十万美元(其中大多数具有两到四个处理器). 如今,多处理器系统既便宜又丰富,几乎主流的微处理器都内置了对多处理器的支持,很多能够支持数十或数百个处理 ...

  8. Rocket - tilelink - RegionReplicator

    https://mp.weixin.qq.com/s/XZVCdt50tM6lavchGm9GRg   简单介绍RegionReplicator的实现.   ​​   1. 基本介绍   根据mask ...

  9. PowerPC-MPC56xx 启动模式

    https://mp.weixin.qq.com/s/aU4sg7780T3_5tJeApFYOQ   参考芯片参考手册第5章:Chapter 5 Microcontroller Boot   The ...

  10. 带你学够浪:Go语言基础系列-环境配置和 Hello world

    文章每周持续更新,原创不易,「三连」让更多人看到是对我最大的肯定.可以微信搜索公众号「 后端技术学堂 」第一时间阅读(一般比博客早更新一到两篇) 前面几周陆陆续续写了一些后端技术的文章,包括数据库.微 ...