validatorjs2
Version:
Validation library inspired by Laravel's Validator
40 lines (39 loc) • 1.55 kB
JavaScript
module.exports = {
accepted: ':attribute必须是可接受的.',
alpha: ':attribute只能包含字母.',
alpha_dash: ':attribute只能包含字母,连字符和下划线.',
alpha_num: ':attribute只能包含字母和数字.',
between: ':attribute的(大小,长度等)只能在:min和:max之间.',
confirmed: ':attribute确认不一致.',
email: ':attribute格式不正确.',
date: ':attribute日期格式错误.',
def: ':attribute属性错误.',
digits: ':attribute必须是:digits位小数.',
digits_between: ':attribute 必须是介于 :min 和 :max 位的数字。',
different: ':attribute和:different必须不同.',
in: '选择的:attribute无效',
integer: ':attribute必须是一个整数.',
hex: 'The :attribute should have hexadecimal format',
min: {
numeric: ':attribute不能小于:min.',
string: ':attribute长度不能小于:min.'
},
max: {
numeric: ':attribute不能大于:max.',
string: ':attribute长度不能大于:max.'
},
not_in: '所选的:attribute无效.',
numeric: ':attribute必须是一个数字.',
present: 'The :attribute field must be present (but can be empty).',
required: ':attribute不能为空.',
required_if: '当:other是:value时,:attribute不能为空.',
same: ':attribute和:same必须一致.',
size: {
numeric: ':attribute必须等于:size.',
string: ':attribute的长度必须等于:size.'
},
string: ':attribute必须是一个字符串.',
url: ':attribute格式不正确.',
regex: ':attribute格式不正确.',
attributes: {}
};