Skip to content

Instantly share code, notes, and snippets.

@ayaka209
Last active July 13, 2019 03:05
Show Gist options
  • Save ayaka209/85485aa07808c071cce969679aaa9143 to your computer and use it in GitHub Desktop.
Save ayaka209/85485aa07808c071cce969679aaa9143 to your computer and use it in GitHub Desktop.
Laravel 5.8 中文验证信息 Chinese validation message translation, 欢迎在评论提出建议
<?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必须是true或者false.',
'confirmed' => ':attribute重复确认不一致',
'date' => ':attribute不是一个有效的日期',
'date_equals' => ':attribute必须是日期:date.',
'date_format' => ':attribute与格式:format不匹配',
'different' => ':attribute与:other必须不同',
'digits' => ':attribute必须是:digits位数',
'digits_between' => ':attribute位数必须介于:min和:max之间.',
'dimensions' => ':attribute图片尺寸不正确.',
'distinct' => ':attribute包含重复的值',
'email' => ':attribute必须是有效的email地址',
'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' => ':attribute不在:other之中',
'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 items.',
],
'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' => '除非:other是:values之一,: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项',
],
'starts_with' => ':attribute必须以:values之一开头',
'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' => [],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment