laravel 5.7 resources 本地化 简体中文
使用方法:
新建目录【项目目录/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' => '« 上一页',
'next' => '下一页 »', ];
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 本地化 简体中文的更多相关文章
- Laravel 5.4的本地化
简介 Laravel 的本地化功能提供方便的方法来获取多语言的字符串,让你的网站可以简单的支持多语言. 语言包存放在 resources/lang 目录下的文件里.在此目录中应该有应用对应支持的语言并 ...
- Laravel Vuejs 实战:开发知乎 (3)本地化和自定义消息
1.本地化 由于所有blade默认采用的是 _('')方式输出标签文本,所以可以安装一个语言包,直接指定本地语言为zh_CN即可: 安装 https://github.com/caouecs/Lara ...
- laravel基础课程---15、分页及验证码(lavarel分页效果如何实现)
laravel基础课程---15.分页及验证码(lavarel分页效果如何实现) 一.总结 一句话总结: 数据库的paginate方法:$data=\DB::table("user" ...
- laravel基础课程---11、lavarel的ajax操作(ajax优劣势是什么)
laravel基础课程---11.lavarel的ajax操作(ajax优劣势是什么) 一.总结 一句话总结: 优势:用户友好度:异步通信,不会频繁刷新页面,用户友好度比较高 优势:减轻数据库压力 缺 ...
- laravel基础课程---2、Laravel配置文件、路由及php artisan(php artisan是什么)
laravel基础课程---2.Laravel配置文件.路由及php artisan(php artisan是什么) 一.总结 一句话总结: PHP工具匠:php artisan,其实本身就是一些PH ...
- laravel基础课程---1、laravel安装及基础介绍(laravel如何安装)
laravel基础课程---1.laravel安装及基础介绍(laravel如何安装) 一.总结 一句话总结: [修改composer镜像地址].[明确laravel的安装要求].[安装指定版本的la ...
- iOS Programming Localization 本地化
iOS Programming Localization 本地化 Internationalization is making sure your native cultural informatio ...
- WinNTSetup v3.8.7 正式版绿色增强版
最强系统安装利器:WinNTSetup 现已更新至 v3.8.7 正式版!这次更新修复调整了诸多问题,新版非常好用接近完美!WinNTSetup 现在已经自带BCDBoot 选项,并且完全支持Wind ...
- php框架推荐
ThinkPHP, 国内开发的框架,特别容易入门,中文文档细致,表述准确. Laravel, 国外框架,非常高级的一个框架,特别是前端比较模块化,但入门难一些,速度不高. laravel在lampp ...
随机推荐
- 03_Zookeeper基本数据模型及基本命令操作
[Zookeeper基本数据模型及注意点] * zk的数据模型可以类比为Linux的文件目录,是一种树状结构,如:/dubbo/com.service.DemoService/provider.... ...
- Genymotion模拟器拖入文件报An error occured while deploying the file的错误
今天需要用到资源文件,需要将资源文件拖拽到sd卡中,但老是出现这个问题: 资源文件拖不进去genymotion.查看了sd的DownLoad目录,确实没有成功拖拽进去. 遇到这种问题的,我按下面的思路 ...
- toasf的苦水
http://blog.csdn.net/qq_25867141/article/details/52807705 优化 上面的几种方式我大致也都走了一遍,其实我觉得都没啥区别,看你喜欢用哪种吧.我其 ...
- 属性锁TimeLock
属性锁TimeLock 这是本人所写的几个类,用于对属性设置值时进行锁定与解锁,适用于高逼格动画当中. 源码: TimeLock.h 与 TimeLock.m // // TimeLock.h // ...
- VMWARE里安装时出现'SMBus Host Controller not enabled'
在虚拟机上运行Linux内核版本为4.7或以上的系统都在安装过程中或在启动时会因为加载intel_powerclamp驱动而导致崩溃.解决办法:1.在启动Ubuntu的时候按住左Shift键:2.Ub ...
- CefSharp 浏览器核心,爬虫
CefSharp是什么 A framework for embedding web-browsing-like capabilities to a standard .NET application ...
- linux 里的`反引号
Shell中可以将数字或字符直接赋予变量,也可以将Linux命令的执行结果赋予变量,如下: (1) $ count=9 #将数字赋予变量count (2) $ name=" ...
- SVG基本图形
SVG 是使用 XML 来描述二维图形和绘图程序的语言 SVG 指可伸缩矢量图形 (Scalable Vector Graphics) SVG 用来定义用于网络的基于矢量的图形 SVG 使用 XML ...
- mvc:view-controller 标签
一.SpringMVC 会把ModelAndView 的model中的数据放到request 域中 二.如果不想让请求经过任何handler,而直接响应页面,可以使用 mvc:view-control ...
- Ubuntu16.04死机解决方案
内核下载地址:http://kernel.ubuntu.com/~kernel-ppa/mainline/ Ubuntu 16.04 LTS,电源设置里面的休眠/挂起/睡眠功能会使电脑会进入死机状态, ...