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 ...
随机推荐
- 本地存储localStroage的用法及示例
localStorage是HTML5在在客户端存储数据的新方法,存储的数据没有时间限制. localStorage的主要API: localStorage.setItem(key,value); ...
- Django—middleware
一.Django中间件的请求周期 我们从浏览器发出一个请求 Request,得到一个响应后的内容 HttpResponse ,这个请求传递到 Django的过程如下: 也就是说,每一个请求都是先通过中 ...
- WebClient用法小结(转载)
如果只想从特定的URI请求文件,则使用WebClient,它是最简单的.NET类,它只用一两条命令执行基本操作,.NET FRAMEWORK目前支持以http:.https:.ftp:.和 file: ...
- Apache服务器运维笔记(3)----容器部分
1.<IfModule>容器 <IfModule>容器作用于模块,它会首先判断模块是否载入,然后再决定是否进行处理,也就是说只有当判断结果为真时才会执行容器内的指令,相反如果为 ...
- 批量删除微博的js代码
清空微博,网上找了一段js代码,试了下,还行. var fileref=document.createElement('script') fileref.setAttribute("type ...
- 【Leetcode】【Medium】Unique Binary Search Trees II
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For e ...
- SpringBoot页面访问处理
SpringBoot页面访问处理 1.介绍 Springboot推荐使用thymeleaf模板引擎搭载html页面实现jsp动态渲染效果,因此这里才会用该种方案进行. 2.集成步骤 引入thymele ...
- 404错误 标签: servlet浏览器 2016-11-16 16:58 61人阅读 评论(0) 收藏
404是资源没有找到,一般由于以下几个方面导致: 1.路径出错: a)检查web.xml中servlet的配置是否出错 b)浏览器访问是路径书写方式:http://localhost:8080/项目名 ...
- 在Ubuntu16.04.4上安装docker
在Ubuntu16.04.4上安装docker 一.环境准备 首先我们需要一台Ubuntu16.04 虚拟机或者真机,其次,我们对其进行环境配置. 1.1.移除已经安装过的dock ...
- June 25th 2017 Week 26th Sunday
There is always that one song that brings back old memories. 总有那么一首歌,让你想起那些旧的回忆. There are seveal so ...