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 ...
随机推荐
- CSS3弹性盒布局
使用自适应的窗口弹性盒布局 可以使div总宽度等于浏览器宽度,而且可以随着浏览器的改变而改变. <!DOCTYPE html> <html lang="zh-CN" ...
- 实现移动端touch事件的横向滑动列表效果
要实现手机端横向滑动效果并不难,了解实现的原理及业务逻辑就很容易实现.原理:touchstart(手指按下瞬间获取相对于页面的位置)——>touchmove(手指移动多少,元素相应移动多少). ...
- UNIX/Linux系统管理技术手册(2)----bash脚本编程
1. 一个简单的例子: $ vim readname.sh #file:readname.sh#!/bin/bash echo -n "Enter your name: " rea ...
- 我的视频网站开通,第一个 ArcGIS文本文件,excel文件生成点操作发布,希望大家支持
网站地址:http://i.youku.com/gisoracle第一个学习视屏:ArcGIS文本文件,excel文件生成点操作http://v.youku.com/v_show/id_XNzM3Nz ...
- 【Python】安装配置Anaconda
优点:解决Python 库依赖问题 清华安装镜像 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
- win7 64 位安装 python,提示: 0x80240017-未指定的错误
首先确保从python官网下载正确的python版本: https://www.python.org/downloads/windows/ 然后,应该是 VC 相关的问题. 去微软网站下载下列补丁包即 ...
- Android学习——Service(二)
今天来介绍Service的第二种使用方式,Bind方式 Bind方式启动服务 Bind方式和Start方式启动很类似,都是通过Intent来启动,不同的是,Bind方式需要传入三个参数,如下: Int ...
- python调用chrome打开指定网址
#!/usr/bin/python # -*- coding:utf-8 -*- import os f = open("chrome_cmd_path.txt") chrome ...
- NFS-heartbeat-drbd模拟NFS高可用
NFS介绍: NFS(Network File System)即网络文件系统,是FreeBSD支持的文件系统中的一种,它允许网络中的计算机之间通过TCP/IP网络共享资源.在NFS的应用中,本地NFS ...
- My SQL 和SQL Server区别
MySQL 与SQL Server区别 今天了解了二者区别,整理网上查阅资料,总结列举如下: MSSQL == SQL server 是sybase与微软合作时期的产物. 对于程序开发人员而言,目前使 ...