From 2d336e25a682b7438ccd2c3781827fe0873399ee Mon Sep 17 00:00:00 2001 From: violin0622 Date: Wed, 17 Aug 2022 14:56:55 +0800 Subject: [PATCH] feat(translations/en): add English translations for requriedXXX and excludeXXX tags Add English translations and tests for these tags: required_unless required_with required_with_all required_without required_without_all excluded_if excluded_unless excluded_with excluded_with_all excluded_without excluded_without_all --- translations/en/.en.go.swp | Bin 0 -> 53248 bytes translations/en/.en_test.go.swp | Bin 0 -> 36864 bytes translations/en/en.go | 60 ++++++ translations/en/en_test.go | 337 ++++++++++++++++++++------------ 4 files changed, 269 insertions(+), 128 deletions(-) create mode 100644 translations/en/.en.go.swp create mode 100644 translations/en/.en_test.go.swp diff --git a/translations/en/.en.go.swp b/translations/en/.en.go.swp new file mode 100644 index 0000000000000000000000000000000000000000..e066ff775be5188b70ded6aa1b7c47301f311ad4 GIT binary patch literal 53248 zcmeI*349dg-N5n1;*pB2R;6BrF^D9REJR||C@Qz%lKT|tWOuR*Y<9!$Y#;)Pw)Lp` z3Md|^_3i78ilP-StQMszRX|0mws^Ew`+DF_JzDMWKgV9|ZjRlAY9}ARlI+aRGxN;# z{GWNAXKMRSsu`sm=RMlP&%Ped`Lq97yKLc9&mp&YJdJudsE1@i?w_#}rW`+fO4a0w zvAO3v%UWQc$>GSHXoKq0`UJv3H5BO6s0MYvYJ?+wjEEYF23123hoXJ75dV1t;oM7g zr@A@d=0LMK5Hsq^kK1QrzoRSq%Dg>_4_Eg8(ZpuI=FZ^efSUtu4!Aks=75_6ZVtFP z;O2mv1K*t-FdDje&SrCVvo~q5{coqVe|NY49%=tOG;R8hZ>*nX_UB8}rhjHnzsUZ) zhn;|v&ZqYD>+I>P(x!i6PhVkAA7QVs^Zk$Q=}x+TOPl_YJ$g$D+#GOoz|Dbn$pO{x@hscR4z)&#y2Dz3>BkwvWg2DsICfG$Dqm@Z!h#5q^LVx_CTK;7;6%8*vUM z;bc^!3J2nyy*-{6un`+@6V8MWXJ8ttus1&aKFh|tcpO*Z94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00K{L#}O}p4LJzSTT>21Ck zCt4+>rJ_d@liK=N-zho8Li*g8S$iMTXuY}f72ld6uWfSDat_>40|w=~$JDEBZb6VZ zMYw^5gNS4 zwj*igwdLmZ*g1W3T`ly6!ll#PB|p!-nX*ldIro{~(3syIOG<0}_|Z9{vS>8DnAy4# zPx_$|42J@`L2WY40K*Z#9%4x9j3tx!jCt)pCwc2okpg#%(zfR-NYYNZXs~LiN|tH_ zs$|rBs}h_|t&ar_y|#&W%Ot9g%?(K_XU69%$X1#yI~yW8O*^Gjrbd0b-pmSEbIXi{ NTZ5LQYtBQG{|4tDgroof literal 0 HcmV?d00001 diff --git a/translations/en/.en_test.go.swp b/translations/en/.en_test.go.swp new file mode 100644 index 0000000000000000000000000000000000000000..81050915527bb5c9fa38be131a8bbab64b6086e9 GIT binary patch literal 36864 zcmeI5dz2hinZP^BV+TZ5z!#`nG)NMhOy-dUhzyWSCX19Qe#Kktdxdhf zRPc+Ha&@s==HFJ|t@>Tl6}#&8(RK^8Tfo)=HGgW+*~jJjdV9J>vD5OWIwzj6(I(M8 z)^34z3$$CH-2&|vXtzMS1==mpZh>|S{2yxpfA;9yTdC9YbiKy(&v~(*N9f-j~<45V=KdgT~6FYvi{{0I5^W9p|$p4xCe82vAoOak8f4=_w&HCpJ zvE%yV_K$W8v|FIv0__%Pw?MlE+AYv-fp!bDTcF(n?G|Xa!2in@C`{&Zucqc#i$I$7 ze-r;ddweeU8~6o03J<}*!e`)ZFamjS;4k10FU;kB3g3jA;U;(|Tm=_HKb#Bm;aGV3 zxLoc5xEnqSZ-ogMg4e+D@XQOa35Vcga5+rF>tHc-!fW8A@Z7Pv+`aG)7=)*f$>rV; z=fbx-aybwF$Rxr|up0h@35O5Ca(IZziI2cGaNtQMGwy&A^uq6%{P-fg1qPu5zQcsW zb#N)122U~Ha1d&69vlJxK%0toy$Y@r?VI}5(J|t?>uUN($uG{9Tt|Oxxvc7Y#qzZI z-Ep?*di9DLGo38F#&Uxv5g6;4fQJ{~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5jtDCc~d(_2k zCSv!px^B6RIz>% literal 0 HcmV?d00001 diff --git a/translations/en/en.go b/translations/en/en.go index ee05f91..89cecab 100644 --- a/translations/en/en.go +++ b/translations/en/en.go @@ -33,6 +33,66 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er translation: "{0} is a required field", override: false, }, + { + tag: "required_unless", + translation: "{0} is a required field", + override: false, + }, + { + tag: "required_with", + translation: "{0} is a required field", + override: false, + }, + { + tag: "required_with_all", + translation: "{0} is a required field", + override: false, + }, + { + tag: "required_without", + translation: "{0} is a required field", + override: false, + }, + { + tag: "required_without_all", + translation: "{0} is a required field", + override: false, + }, + { + tag: "excluded_if", + translation: "{0} is an excluded field", + override: false, + }, + { + tag: "excluded_unless", + translation: "{0} is an excluded field", + override: false, + }, + { + tag: "excluded_with", + translation: "{0} is an excluded field", + override: false, + }, + { + tag: "excluded_with_all", + translation: "{0} is an excluded field", + override: false, + }, + { + tag: "excluded_without", + translation: "{0} is an excluded field", + override: false, + }, + { + tag: "excluded_without_all", + translation: "{0} is an excluded field", + override: false, + }, + { + tag: "isdefault", + translation: "{0} must be default value", + override: false, + }, { tag: "len", customRegisFunc: func(ut ut.Translator) (err error) { diff --git a/translations/en/en_test.go b/translations/en/en_test.go index 9cb6deb..7cc16e5 100644 --- a/translations/en/en_test.go +++ b/translations/en/en_test.go @@ -21,137 +21,160 @@ func TestTranslations(t *testing.T) { Equal(t, err, nil) type Inner struct { - EqCSFieldString string - NeCSFieldString string - GtCSFieldString string - GteCSFieldString string - LtCSFieldString string - LteCSFieldString string - RequiredIf string + EqCSFieldString string + NeCSFieldString string + GtCSFieldString string + GteCSFieldString string + LtCSFieldString string + LteCSFieldString string + RequiredIf string + RequiredUnless string + RequiredWith string + RequiredWithAll string + RequiredWithout string + RequiredWithoutAll string + ExcludedIf string + ExcludedUnless string + ExcludedWith string + ExcludedWithAll string + ExcludedWithout string + ExcludedWithoutAll string } type Test struct { - Inner Inner - RequiredString string `validate:"required"` - RequiredNumber int `validate:"required"` - RequiredMultiple []string `validate:"required"` - RequiredIf string `validate:"required_if=Inner.RequiredIf abcd"` - LenString string `validate:"len=1"` - LenNumber float64 `validate:"len=1113.00"` - LenMultiple []string `validate:"len=7"` - MinString string `validate:"min=1"` - MinNumber float64 `validate:"min=1113.00"` - MinMultiple []string `validate:"min=7"` - MaxString string `validate:"max=3"` - MaxNumber float64 `validate:"max=1113.00"` - MaxMultiple []string `validate:"max=7"` - EqString string `validate:"eq=3"` - EqNumber float64 `validate:"eq=2.33"` - EqMultiple []string `validate:"eq=7"` - NeString string `validate:"ne="` - NeNumber float64 `validate:"ne=0.00"` - NeMultiple []string `validate:"ne=0"` - LtString string `validate:"lt=3"` - LtNumber float64 `validate:"lt=5.56"` - LtMultiple []string `validate:"lt=2"` - LtTime time.Time `validate:"lt"` - LteString string `validate:"lte=3"` - LteNumber float64 `validate:"lte=5.56"` - LteMultiple []string `validate:"lte=2"` - LteTime time.Time `validate:"lte"` - GtString string `validate:"gt=3"` - GtNumber float64 `validate:"gt=5.56"` - GtMultiple []string `validate:"gt=2"` - GtTime time.Time `validate:"gt"` - GteString string `validate:"gte=3"` - GteNumber float64 `validate:"gte=5.56"` - GteMultiple []string `validate:"gte=2"` - GteTime time.Time `validate:"gte"` - EqFieldString string `validate:"eqfield=MaxString"` - EqCSFieldString string `validate:"eqcsfield=Inner.EqCSFieldString"` - NeCSFieldString string `validate:"necsfield=Inner.NeCSFieldString"` - GtCSFieldString string `validate:"gtcsfield=Inner.GtCSFieldString"` - GteCSFieldString string `validate:"gtecsfield=Inner.GteCSFieldString"` - LtCSFieldString string `validate:"ltcsfield=Inner.LtCSFieldString"` - LteCSFieldString string `validate:"ltecsfield=Inner.LteCSFieldString"` - NeFieldString string `validate:"nefield=EqFieldString"` - GtFieldString string `validate:"gtfield=MaxString"` - GteFieldString string `validate:"gtefield=MaxString"` - LtFieldString string `validate:"ltfield=MaxString"` - LteFieldString string `validate:"ltefield=MaxString"` - AlphaString string `validate:"alpha"` - AlphanumString string `validate:"alphanum"` - NumericString string `validate:"numeric"` - NumberString string `validate:"number"` - HexadecimalString string `validate:"hexadecimal"` - HexColorString string `validate:"hexcolor"` - RGBColorString string `validate:"rgb"` - RGBAColorString string `validate:"rgba"` - HSLColorString string `validate:"hsl"` - HSLAColorString string `validate:"hsla"` - Email string `validate:"email"` - URL string `validate:"url"` - URI string `validate:"uri"` - Base64 string `validate:"base64"` - Contains string `validate:"contains=purpose"` - ContainsAny string `validate:"containsany=!@#$"` - Excludes string `validate:"excludes=text"` - ExcludesAll string `validate:"excludesall=!@#$"` - ExcludesRune string `validate:"excludesrune=☻"` - ISBN string `validate:"isbn"` - ISBN10 string `validate:"isbn10"` - ISBN13 string `validate:"isbn13"` - UUID string `validate:"uuid"` - UUID3 string `validate:"uuid3"` - UUID4 string `validate:"uuid4"` - UUID5 string `validate:"uuid5"` - ULID string `validate:"ulid"` - ASCII string `validate:"ascii"` - PrintableASCII string `validate:"printascii"` - MultiByte string `validate:"multibyte"` - DataURI string `validate:"datauri"` - Latitude string `validate:"latitude"` - Longitude string `validate:"longitude"` - SSN string `validate:"ssn"` - IP string `validate:"ip"` - IPv4 string `validate:"ipv4"` - IPv6 string `validate:"ipv6"` - CIDR string `validate:"cidr"` - CIDRv4 string `validate:"cidrv4"` - CIDRv6 string `validate:"cidrv6"` - TCPAddr string `validate:"tcp_addr"` - TCPAddrv4 string `validate:"tcp4_addr"` - TCPAddrv6 string `validate:"tcp6_addr"` - UDPAddr string `validate:"udp_addr"` - UDPAddrv4 string `validate:"udp4_addr"` - UDPAddrv6 string `validate:"udp6_addr"` - IPAddr string `validate:"ip_addr"` - IPAddrv4 string `validate:"ip4_addr"` - IPAddrv6 string `validate:"ip6_addr"` - UinxAddr string `validate:"unix_addr"` // can't fail from within Go's net package currently, but maybe in the future - MAC string `validate:"mac"` - IsColor string `validate:"iscolor"` - StrPtrMinLen *string `validate:"min=10"` - StrPtrMaxLen *string `validate:"max=1"` - StrPtrLen *string `validate:"len=2"` - StrPtrLt *string `validate:"lt=1"` - StrPtrLte *string `validate:"lte=1"` - StrPtrGt *string `validate:"gt=10"` - StrPtrGte *string `validate:"gte=10"` - OneOfString string `validate:"oneof=red green"` - OneOfInt int `validate:"oneof=5 63"` - UniqueSlice []string `validate:"unique"` - UniqueArray [3]string `validate:"unique"` - UniqueMap map[string]string `validate:"unique"` - JSONString string `validate:"json"` - JWTString string `validate:"jwt"` - LowercaseString string `validate:"lowercase"` - UppercaseString string `validate:"uppercase"` - Datetime string `validate:"datetime=2006-01-02"` - PostCode string `validate:"postcode_iso3166_alpha2=SG"` - PostCodeCountry string - PostCodeByField string `validate:"postcode_iso3166_alpha2_field=PostCodeCountry"` - BooleanString string `validate:"boolean"` + Inner Inner + RequiredString string `validate:"required"` + RequiredNumber int `validate:"required"` + RequiredMultiple []string `validate:"required"` + RequiredIf string `validate:"required_if=Inner.RequiredIf abcd"` + RequiredUnless string `validate:"required_unless=Inner.RequiredUnless abcd"` + RequiredWith string `validate:"required_with=Inner.RequiredWith"` + RequiredWithAll string `validate:"required_with_all=Inner.RequiredWith Inner.RequiredWithAll"` + RequiredWithout string `validate:"required_without=Inner.RequiredWithout"` + RequiredWithoutAll string `validate:"required_without_all=Inner.RequiredWithout Inner.RequiredWithoutAll"` + ExcludedIf string `validate:"excluded_if=Inner.ExcludedIf abcd"` + ExcludedUnless string `validate:"excluded_unless=Inner.ExcludedUnless abcd"` + ExcludedWith string `validate:"excluded_with=Inner.ExcludedWith"` + ExcludedWithout string `validate:"excluded_with_all=Inner.ExcludedWithAll"` + ExcludedWithAll string `validate:"excluded_without=Inner.ExcludedWithout"` + ExcludedWithoutAll string `validate:"excluded_without_all=Inner.ExcludedWithoutAll"` + IsDefault string `validate:"isdefault"` + LenString string `validate:"len=1"` + LenNumber float64 `validate:"len=1113.00"` + LenMultiple []string `validate:"len=7"` + MinString string `validate:"min=1"` + MinNumber float64 `validate:"min=1113.00"` + MinMultiple []string `validate:"min=7"` + MaxString string `validate:"max=3"` + MaxNumber float64 `validate:"max=1113.00"` + MaxMultiple []string `validate:"max=7"` + EqString string `validate:"eq=3"` + EqNumber float64 `validate:"eq=2.33"` + EqMultiple []string `validate:"eq=7"` + NeString string `validate:"ne="` + NeNumber float64 `validate:"ne=0.00"` + NeMultiple []string `validate:"ne=0"` + LtString string `validate:"lt=3"` + LtNumber float64 `validate:"lt=5.56"` + LtMultiple []string `validate:"lt=2"` + LtTime time.Time `validate:"lt"` + LteString string `validate:"lte=3"` + LteNumber float64 `validate:"lte=5.56"` + LteMultiple []string `validate:"lte=2"` + LteTime time.Time `validate:"lte"` + GtString string `validate:"gt=3"` + GtNumber float64 `validate:"gt=5.56"` + GtMultiple []string `validate:"gt=2"` + GtTime time.Time `validate:"gt"` + GteString string `validate:"gte=3"` + GteNumber float64 `validate:"gte=5.56"` + GteMultiple []string `validate:"gte=2"` + GteTime time.Time `validate:"gte"` + EqFieldString string `validate:"eqfield=MaxString"` + EqCSFieldString string `validate:"eqcsfield=Inner.EqCSFieldString"` + NeCSFieldString string `validate:"necsfield=Inner.NeCSFieldString"` + GtCSFieldString string `validate:"gtcsfield=Inner.GtCSFieldString"` + GteCSFieldString string `validate:"gtecsfield=Inner.GteCSFieldString"` + LtCSFieldString string `validate:"ltcsfield=Inner.LtCSFieldString"` + LteCSFieldString string `validate:"ltecsfield=Inner.LteCSFieldString"` + NeFieldString string `validate:"nefield=EqFieldString"` + GtFieldString string `validate:"gtfield=MaxString"` + GteFieldString string `validate:"gtefield=MaxString"` + LtFieldString string `validate:"ltfield=MaxString"` + LteFieldString string `validate:"ltefield=MaxString"` + AlphaString string `validate:"alpha"` + AlphanumString string `validate:"alphanum"` + NumericString string `validate:"numeric"` + NumberString string `validate:"number"` + HexadecimalString string `validate:"hexadecimal"` + HexColorString string `validate:"hexcolor"` + RGBColorString string `validate:"rgb"` + RGBAColorString string `validate:"rgba"` + HSLColorString string `validate:"hsl"` + HSLAColorString string `validate:"hsla"` + Email string `validate:"email"` + URL string `validate:"url"` + URI string `validate:"uri"` + Base64 string `validate:"base64"` + Contains string `validate:"contains=purpose"` + ContainsAny string `validate:"containsany=!@#$"` + Excludes string `validate:"excludes=text"` + ExcludesAll string `validate:"excludesall=!@#$"` + ExcludesRune string `validate:"excludesrune=☻"` + ISBN string `validate:"isbn"` + ISBN10 string `validate:"isbn10"` + ISBN13 string `validate:"isbn13"` + UUID string `validate:"uuid"` + UUID3 string `validate:"uuid3"` + UUID4 string `validate:"uuid4"` + UUID5 string `validate:"uuid5"` + ULID string `validate:"ulid"` + ASCII string `validate:"ascii"` + PrintableASCII string `validate:"printascii"` + MultiByte string `validate:"multibyte"` + DataURI string `validate:"datauri"` + Latitude string `validate:"latitude"` + Longitude string `validate:"longitude"` + SSN string `validate:"ssn"` + IP string `validate:"ip"` + IPv4 string `validate:"ipv4"` + IPv6 string `validate:"ipv6"` + CIDR string `validate:"cidr"` + CIDRv4 string `validate:"cidrv4"` + CIDRv6 string `validate:"cidrv6"` + TCPAddr string `validate:"tcp_addr"` + TCPAddrv4 string `validate:"tcp4_addr"` + TCPAddrv6 string `validate:"tcp6_addr"` + UDPAddr string `validate:"udp_addr"` + UDPAddrv4 string `validate:"udp4_addr"` + UDPAddrv6 string `validate:"udp6_addr"` + IPAddr string `validate:"ip_addr"` + IPAddrv4 string `validate:"ip4_addr"` + IPAddrv6 string `validate:"ip6_addr"` + UinxAddr string `validate:"unix_addr"` // can't fail from within Go's net package currently, but maybe in the future + MAC string `validate:"mac"` + IsColor string `validate:"iscolor"` + StrPtrMinLen *string `validate:"min=10"` + StrPtrMaxLen *string `validate:"max=1"` + StrPtrLen *string `validate:"len=2"` + StrPtrLt *string `validate:"lt=1"` + StrPtrLte *string `validate:"lte=1"` + StrPtrGt *string `validate:"gt=10"` + StrPtrGte *string `validate:"gte=10"` + OneOfString string `validate:"oneof=red green"` + OneOfInt int `validate:"oneof=5 63"` + UniqueSlice []string `validate:"unique"` + UniqueArray [3]string `validate:"unique"` + UniqueMap map[string]string `validate:"unique"` + JSONString string `validate:"json"` + JWTString string `validate:"jwt"` + LowercaseString string `validate:"lowercase"` + UppercaseString string `validate:"uppercase"` + Datetime string `validate:"datetime=2006-01-02"` + PostCode string `validate:"postcode_iso3166_alpha2=SG"` + PostCodeCountry string + PostCodeByField string `validate:"postcode_iso3166_alpha2_field=PostCodeCountry"` + BooleanString string `validate:"boolean"` } var test Test @@ -159,6 +182,20 @@ func TestTranslations(t *testing.T) { test.Inner.EqCSFieldString = "1234" test.Inner.GtCSFieldString = "1234" test.Inner.GteCSFieldString = "1234" + test.Inner.RequiredUnless = "1234" + test.Inner.RequiredWith = "1234" + test.Inner.RequiredWithAll = "1234" + test.Inner.ExcludedIf = "abcd" + test.Inner.ExcludedUnless = "1234" + test.Inner.ExcludedWith = "1234" + test.Inner.ExcludedWithAll = "1234" + + test.ExcludedIf = "1234" + test.ExcludedUnless = "1234" + test.ExcludedWith = "1234" + test.ExcludedWithAll = "1234" + test.ExcludedWithout = "1234" + test.ExcludedWithoutAll = "1234" test.MaxString = "1234" test.MaxNumber = 2000 @@ -610,6 +647,50 @@ func TestTranslations(t *testing.T) { ns: "Test.RequiredMultiple", expected: "RequiredMultiple is a required field", }, + { + ns: "Test.RequiredUnless", + expected: "RequiredUnless is a required field", + }, + { + ns: "Test.RequiredWith", + expected: "RequiredWith is a required field", + }, + { + ns: "Test.RequiredWithAll", + expected: "RequiredWithAll is a required field", + }, + { + ns: "Test.RequiredWithout", + expected: "RequiredWithout is a required field", + }, + { + ns: "Test.RequiredWithoutAll", + expected: "RequiredWithoutAll is a required field", + }, + { + ns: "Test.ExcludedIf", + expected: "ExcludedIf is an excluded field", + }, + { + ns: "Test.ExcludedUnless", + expected: "ExcludedUnless is an excluded field", + }, + { + ns: "Test.ExcludedWith", + expected: "ExcludedWith is an excluded field", + }, + { + ns: "Test.ExcludedWithAll", + expected: "ExcludedWithAll is an excluded field", + }, + { + ns: "Test.ExcludedWithout", + expected: "ExcludedWithout is an excluded field", + }, + { + ns: "Test.ExcludedWithoutAll", + expected: "ExcludedWithoutAll is an excluded field", + }, { ns: "Test.StrPtrMinLen", expected: "StrPtrMinLen must be at least 10 characters in length",