<?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. 最香远程开发解决方案!手把手教你配置VS Code远程开发工具,工作效率提升N倍

    文章每周持续更新,原创不易,「三连」让更多人看到是对我最大的肯定.可以微信搜索公众号「 后端技术学堂 」第一时间阅读(一般比博客早更新一到两篇) 今天和大家分享远程开发工具,分享一下我平常是如何用 V ...

  2. DPDK IP分片及重组库(学习笔记)

    1 前置知识学习 1.1 MTU MTU是最大传输单元( Maximum Transmission Unit)的缩写,指一个接口无需分片所能发送的数据包的最大字节数.  MTU范围在46 ~ 1500 ...

  3. js 简单有效判断日期有效性(含闰年)

    原文:https://zhidao.baidu.com/question/1701946584925153620.html 要想精确验证,最容易想到的方法就是通过月份判断日期是否合法(1~28/29/ ...

  4. CSS实现漂亮的小水球效果

    先看效果图: 代码: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> ...

  5. 对于近似有序序列(即除掉少数K个元素后是有序序列且K<<n),试分析直接插入排序,冒牌排序和简单选择排序的时间复杂度

    学弟问的一道数据结构的题,关于一些排序算法的时间复杂度. 针对近似有序序列, ①当使用直接插入排序时,其基本操作为数组中元素的移动.最好情况下,待排序列有序,无需移动,此时时间复杂度为O(n), 当为 ...

  6. linux高级管理第十二章--rsync

    实验部分 1.安装rsync 2.配置文件 3.配置密码 4.后续 5.为了测试,创建几个文件 配置实时同步 1.调整inotify内核参数 安装inotify-tools 测试同步 编写脚本 验证 ...

  7. [ES6系列-03]ES6中关于参数相关特性详解(参数默认值与参数解构赋值与剩余参数)

    [原创] 码路工人 大家好,这里是码路工人有力量,我是码路工人,你们是力量. 今天总结一下 ES6 中跟参数相关的内容. 欢迎补充斧正.留言交流. 让我们互相学习一起进步. 1. ES6 参数默认值( ...

  8. Redis详解(十)------ 从零开始搭建集群

    在上一篇博客我们介绍了------Redis哨兵(Sentinel)模式,哨兵模式主要是解决高可用问题,在master节点宕机时,slave节点能够自动切换成为master节点 本篇博客我们来介绍Re ...

  9. [FlashDevelop] 002.FlashDevelop + LayaFlash播放SWF并转成HTML5

    在上一个教程中,我讲解了如何搭建FLashDevelop环境,并创建了Hello的小Demo.那么接下来,我们来看看如何实现播放swf文件,并将其转成可以在浏览器上播放的HTML5文件.那么首先我们得 ...

  10. Protocol Buffers工作原理

    这里记录一下学习与使用Protocol Buffer的笔记,优点缺点如何使用这里不再叙述,重点关注与理解Protocol Buffers的工作原理,其大概实现. 我们经常使用Protocol Buff ...