improve package gvalid

This commit is contained in:
John
2020-05-10 22:34:16 +08:00
parent 47a6284274
commit b0c722e297
3 changed files with 87 additions and 87 deletions

View File

@ -66,7 +66,7 @@ func getErrorMessageByRule(ruleKey string, customMsgMap map[string]string) strin
if content != "" {
return content
}
content = gi18n.GetContent(fmt.Sprintf(`gf.gvalid.%s`, ruleKey))
content = gi18n.GetContent(fmt.Sprintf(`gf.gvalid.rule.%s`, ruleKey))
if content == "" {
content = defaultMessages[ruleKey]
}

View File

@ -1,43 +1,43 @@
"gf.gvalid.required" = ":attribute字段不能为空"
"gf.gvalid.required-if" = ":attribute字段不能为空"
"gf.gvalid.required-unless" = ":attribute字段不能为空"
"gf.gvalid.required-with" = ":attribute字段不能为空"
"gf.gvalid.required-with-all" = ":attribute字段不能为空"
"gf.gvalid.required-without" = ":attribute字段不能为空"
"gf.gvalid.required-without-all" = ":attribute字段不能为空"
"gf.gvalid.date" = ":attribute日期格式不正确"
"gf.gvalid.date-format" = ":attribute日期格式不满足:format"
"gf.gvalid.email" = ":attribute邮箱地址格式不正确"
"gf.gvalid.phone" = ":attribute手机号码格式不正确"
"gf.gvalid.telephone" = ":attribute电话号码格式不正确"
"gf.gvalid.passport" = ":attribute账号格式不合法必需以字母开头只能包含字母、数字和下划线长度在6~18之间"
"gf.gvalid.password" = ":attribute密码格式不合法密码格式为任意6-18位的可见字符"
"gf.gvalid.password2" = ":attribute密码格式不合法密码格式为任意6-18位的可见字符必须包含大小写字母和数字"
"gf.gvalid.password3" = ":attribute密码格式不合法密码格式为任意6-18位的可见字符必须包含大小写字母、数字和特殊字符"
"gf.gvalid.postcode" = ":attribute邮政编码不正确"
"gf.gvalid.resident-id" = ":attribute身份证号码格式不正确"
"gf.gvalid.bank-card" = ":attribute银行卡号格式不正确"
"gf.gvalid.qq" = ":attributeQQ号码格式不正确"
"gf.gvalid.ip" = ":attributeIP地址格式不正确"
"gf.gvalid.ipv4" = ":attributeIPv4地址格式不正确"
"gf.gvalid.ipv6" = ":attributeIPv6地址格式不正确"
"gf.gvalid.mac" = ":attributeMAC地址格式不正确"
"gf.gvalid.url" = ":attributeURL地址格式不正确"
"gf.gvalid.domain" = ":attribute域名格式不正确"
"gf.gvalid.length" = ":attribute字段长度为:min到:max个字符"
"gf.gvalid.min-length" = ":attribute字段最小长度为:min"
"gf.gvalid.max-length" = ":attribute字段最大长度为:max"
"gf.gvalid.between" = ":attribute字段大小为:min到:max"
"gf.gvalid.min" = ":attribute字段最小值为:min"
"gf.gvalid.max" = ":attribute字段最大值为:max"
"gf.gvalid.json" = ":attribute字段应当为JSON格式"
"gf.gvalid.xml" = ":attribute字段应当为XML格式"
"gf.gvalid.array" = ":attribute字段应当为数组"
"gf.gvalid.integer" = ":attribute字段应当为整数"
"gf.gvalid.float" = ":attribute字段应当为浮点数"
"gf.gvalid.boolean" = ":attribute字段应当为布尔值"
"gf.gvalid.same" = ":attribute字段值必须和:field相同"
"gf.gvalid.different" = ":attribute字段值不能与:field相同"
"gf.gvalid.in" = ":attribute字段值不合法"
"gf.gvalid.not-in" = ":attribute字段值不合法"
"gf.gvalid.regex" = ":attribute字段值不合法"
"gf.gvalid.rule.required" = ":attribute字段不能为空"
"gf.gvalid.rule.required-if" = ":attribute字段不能为空"
"gf.gvalid.rule.required-unless" = ":attribute字段不能为空"
"gf.gvalid.rule.required-with" = ":attribute字段不能为空"
"gf.gvalid.rule.required-with-all" = ":attribute字段不能为空"
"gf.gvalid.rule.required-without" = ":attribute字段不能为空"
"gf.gvalid.rule.required-without-all" = ":attribute字段不能为空"
"gf.gvalid.rule.date" = ":attribute日期格式不正确"
"gf.gvalid.rule.date-format" = ":attribute日期格式不满足:format"
"gf.gvalid.rule.email" = ":attribute邮箱地址格式不正确"
"gf.gvalid.rule.phone" = ":attribute手机号码格式不正确"
"gf.gvalid.rule.telephone" = ":attribute电话号码格式不正确"
"gf.gvalid.rule.passport" = ":attribute账号格式不合法必需以字母开头只能包含字母、数字和下划线长度在6~18之间"
"gf.gvalid.rule.password" = ":attribute密码格式不合法密码格式为任意6-18位的可见字符"
"gf.gvalid.rule.password2" = ":attribute密码格式不合法密码格式为任意6-18位的可见字符必须包含大小写字母和数字"
"gf.gvalid.rule.password3" = ":attribute密码格式不合法密码格式为任意6-18位的可见字符必须包含大小写字母、数字和特殊字符"
"gf.gvalid.rule.postcode" = ":attribute邮政编码不正确"
"gf.gvalid.rule.resident-id" = ":attribute身份证号码格式不正确"
"gf.gvalid.rule.bank-card" = ":attribute银行卡号格式不正确"
"gf.gvalid.rule.qq" = ":attributeQQ号码格式不正确"
"gf.gvalid.rule.ip" = ":attributeIP地址格式不正确"
"gf.gvalid.rule.ipv4" = ":attributeIPv4地址格式不正确"
"gf.gvalid.rule.ipv6" = ":attributeIPv6地址格式不正确"
"gf.gvalid.rule.mac" = ":attributeMAC地址格式不正确"
"gf.gvalid.rule.url" = ":attributeURL地址格式不正确"
"gf.gvalid.rule.domain" = ":attribute域名格式不正确"
"gf.gvalid.rule.length" = ":attribute字段长度为:min到:max个字符"
"gf.gvalid.rule.min-length" = ":attribute字段最小长度为:min"
"gf.gvalid.rule.max-length" = ":attribute字段最大长度为:max"
"gf.gvalid.rule.between" = ":attribute字段大小为:min到:max"
"gf.gvalid.rule.min" = ":attribute字段最小值为:min"
"gf.gvalid.rule.max" = ":attribute字段最大值为:max"
"gf.gvalid.rule.json" = ":attribute字段应当为JSON格式"
"gf.gvalid.rule.xml" = ":attribute字段应当为XML格式"
"gf.gvalid.rule.array" = ":attribute字段应当为数组"
"gf.gvalid.rule.integer" = ":attribute字段应当为整数"
"gf.gvalid.rule.float" = ":attribute字段应当为浮点数"
"gf.gvalid.rule.boolean" = ":attribute字段应当为布尔值"
"gf.gvalid.rule.same" = ":attribute字段值必须和:field相同"
"gf.gvalid.rule.different" = ":attribute字段值不能与:field相同"
"gf.gvalid.rule.in" = ":attribute字段值不合法"
"gf.gvalid.rule.not-in" = ":attribute字段值不合法"
"gf.gvalid.rule.regex" = ":attribute字段值不合法"

View File

@ -1,43 +1,43 @@
"gf.gvalid.required" = "The :attribute field is required"
"gf.gvalid.required-if" = "The :attribute field is required"
"gf.gvalid.required-unless" = "The :attribute field is required"
"gf.gvalid.required-with" = "The :attribute field is required"
"gf.gvalid.required-with-all" = "The :attribute field is required"
"gf.gvalid.required-without" = "The :attribute field is required"
"gf.gvalid.required-without-all" = "The :attribute field is required"
"gf.gvalid.date" = "The :attribute value is not a valid date"
"gf.gvalid.date-format" = "The :attribute value does not match the format :format"
"gf.gvalid.email" = "The :attribute value must be a valid email address"
"gf.gvalid.phone" = "The :attribute value must be a valid phone number"
"gf.gvalid.telephone" = "The :attribute value must be a valid telephone number"
"gf.gvalid.passport" = "The :attribute value is not a valid passport format"
"gf.gvalid.password" = "The :attribute value is not a valid passport format"
"gf.gvalid.password2" = "The :attribute value is not a valid passport format"
"gf.gvalid.password3" = "The :attribute value is not a valid passport format"
"gf.gvalid.postcode" = "The :attribute value is not a valid passport format"
"gf.gvalid.resident-id" = "The :attribute value is not a valid resident id number"
"gf.gvalid.bank-card" = "The :attribute value must be a valid bank card number"
"gf.gvalid.qq" = "The :attribute value must be a valid QQ number"
"gf.gvalid.ip" = "The :attribute value must be a valid IP address"
"gf.gvalid.ipv4" = "The :attribute value must be a valid IPv4 address"
"gf.gvalid.ipv6" = "The :attribute value must be a valid IPv6 address"
"gf.gvalid.mac" = "The :attribute value must be a valid MAC address"
"gf.gvalid.url" = "The :attribute value must be a valid URL address"
"gf.gvalid.domain" = "The :attribute value must be a valid domain format"
"gf.gvalid.length" = "The :attribute value length must be between :min and :max"
"gf.gvalid.min-length" = "The :attribute value length must be equal or greater than :min"
"gf.gvalid.max-length" = "The :attribute value length must be equal or lesser than :max"
"gf.gvalid.between" = "The :attribute value must be between :min and :max"
"gf.gvalid.min" = "The :attribute value must be equal or greater than :min"
"gf.gvalid.max" = "The :attribute value must be equal or lesser than :max"
"gf.gvalid.json" = "The :attribute value must be a valid JSON string"
"gf.gvalid.xml" = "The :attribute value must be a valid XML string"
"gf.gvalid.array" = "The :attribute value must be an array"
"gf.gvalid.integer" = "The :attribute value must be an integer"
"gf.gvalid.float" = "The :attribute value must be a float"
"gf.gvalid.boolean" = "The :attribute value field must be true or false"
"gf.gvalid.same" = "The :attribute value must be the same as field :field"
"gf.gvalid.different" = "The :attribute value must be different from field :field"
"gf.gvalid.in" = "The :attribute value is not in acceptable range"
"gf.gvalid.not-in" = "The :attribute value is not in acceptable range"
"gf.gvalid.regex" = "The :attribute value is invalid"
"gf.gvalid.rule.required" = "The :attribute field is required"
"gf.gvalid.rule.required-if" = "The :attribute field is required"
"gf.gvalid.rule.required-unless" = "The :attribute field is required"
"gf.gvalid.rule.required-with" = "The :attribute field is required"
"gf.gvalid.rule.required-with-all" = "The :attribute field is required"
"gf.gvalid.rule.required-without" = "The :attribute field is required"
"gf.gvalid.rule.required-without-all" = "The :attribute field is required"
"gf.gvalid.rule.date" = "The :attribute value is not a valid date"
"gf.gvalid.rule.date-format" = "The :attribute value does not match the format :format"
"gf.gvalid.rule.email" = "The :attribute value must be a valid email address"
"gf.gvalid.rule.phone" = "The :attribute value must be a valid phone number"
"gf.gvalid.rule.telephone" = "The :attribute value must be a valid telephone number"
"gf.gvalid.rule.passport" = "The :attribute value is not a valid passport format"
"gf.gvalid.rule.password" = "The :attribute value is not a valid passport format"
"gf.gvalid.rule.password2" = "The :attribute value is not a valid passport format"
"gf.gvalid.rule.password3" = "The :attribute value is not a valid passport format"
"gf.gvalid.rule.postcode" = "The :attribute value is not a valid passport format"
"gf.gvalid.rule.resident-id" = "The :attribute value is not a valid resident id number"
"gf.gvalid.rule.bank-card" = "The :attribute value must be a valid bank card number"
"gf.gvalid.rule.qq" = "The :attribute value must be a valid QQ number"
"gf.gvalid.rule.ip" = "The :attribute value must be a valid IP address"
"gf.gvalid.rule.ipv4" = "The :attribute value must be a valid IPv4 address"
"gf.gvalid.rule.ipv6" = "The :attribute value must be a valid IPv6 address"
"gf.gvalid.rule.mac" = "The :attribute value must be a valid MAC address"
"gf.gvalid.rule.url" = "The :attribute value must be a valid URL address"
"gf.gvalid.rule.domain" = "The :attribute value must be a valid domain format"
"gf.gvalid.rule.length" = "The :attribute value length must be between :min and :max"
"gf.gvalid.rule.min-length" = "The :attribute value length must be equal or greater than :min"
"gf.gvalid.rule.max-length" = "The :attribute value length must be equal or lesser than :max"
"gf.gvalid.rule.between" = "The :attribute value must be between :min and :max"
"gf.gvalid.rule.min" = "The :attribute value must be equal or greater than :min"
"gf.gvalid.rule.max" = "The :attribute value must be equal or lesser than :max"
"gf.gvalid.rule.json" = "The :attribute value must be a valid JSON string"
"gf.gvalid.rule.xml" = "The :attribute value must be a valid XML string"
"gf.gvalid.rule.array" = "The :attribute value must be an array"
"gf.gvalid.rule.integer" = "The :attribute value must be an integer"
"gf.gvalid.rule.float" = "The :attribute value must be a float"
"gf.gvalid.rule.boolean" = "The :attribute value field must be true or false"
"gf.gvalid.rule.same" = "The :attribute value must be the same as field :field"
"gf.gvalid.rule.different" = "The :attribute value must be different from field :field"
"gf.gvalid.rule.in" = "The :attribute value is not in acceptable range"
"gf.gvalid.rule.not-in" = "The :attribute value is not in acceptable range"
"gf.gvalid.rule.regex" = "The :attribute value is invalid"