<?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. Python创建一个简单的区块链

    区块链(Blockchain)是一种分布式账本(listributed ledger),它是一种仅供增加(append-only),内容不可变(immutable)的有序(ordered)链式数据结构 ...

  2. JavaScript数组常见用法

    最近做一个项目中做一个竞猜游戏界面,游戏规则和彩票是一样的.在实现“机选一注”,“机选五注”的时候遇到数组的一些操作,例如产生['01', '02' ... '35']这样的数组,随机抽取不重复的元素 ...

  3. Java 对象的继承,抽象类,接口

    子父级继承 关键字 extends 首先创建一个父类 class Fu { String name; int a=1; public void word() { System.out.println( ...

  4. 使用websocket开发智能聊天机器人

    前面我们学习了异步web框架(sanic)和http异步调用库httpx,今天我们学习websocket技术. websocket简介 我们知道HTTP协议是:请求->响应,如果没有响应就一直等 ...

  5. C# 数据操作系列 - 19 FreeSql 入坑介绍

    0. 前言 前几天FreeSql的作者向我推荐了FreeSql框架,想让我帮忙写个文章介绍一下.嗯,想不到我也能带个货了.哈哈,开个玩笑-看了下觉得设计的挺有意思的,所以就谢了这篇文章. 简单介绍一下 ...

  6. [注]一条牛B的游戏推送要具备哪些条件?

    旁白:推送内容写的好,可以给游戏带来很大的收益,但如果写的很糟糕,就可能是在提醒用户还有一个该卸载的软件没卸载.那么如何写出一个优秀的推送内容呢? 总结:推送文字八字原则 从运营的角度来讲,我们需要找 ...

  7. 03 . 前端之JavaScipt

    JavaScript概述 ECMAScript和JavaScript的关系 1996年11月,JavaScript的创造者–Netscape公司,决定将JavaScript提交给国际标准化组织ECMA ...

  8. 关于ubuntu下使用l2tpvpn和远程桌面windows系统的测试

    一.背景: 2019年9月下旬到10月上旬,到海南澄迈福山度假.随身带的笔记本电脑中windows10系统因硬盘故障挂了,在另一块硬盘上的ubuntu18.04系统正常.因媳妇需要在10月1日远程回公 ...

  9. Rocket - diplomacy - 模块结构信息

    https://mp.weixin.qq.com/s/cTRxXwWNEeb4-XX_t4bRcg   讨论模块结构信息的来源及使用方式.     ​​   1. diplomacy   diplom ...

  10. Chisel3 - 基本数据类型

    https://mp.weixin.qq.com/s/bSrM-wLRn7O_75xYKeoaEQ   Chisel中的基本数据类型,不是Verilog中的Wire和Reg.Wire和Register ...