diff --git a/translations/ru/ru.go b/translations/ru/ru.go index 6f9d41b..7a12bd8 100644 --- a/translations/ru/ru.go +++ b/translations/ru/ru.go @@ -41,6 +41,14 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er return } + if err = ut.AddCardinal("len-string-character", "{0} символа", locales.PluralRuleFew, false); err != nil { + return + } + + if err = ut.AddCardinal("len-string-character", "{0} символов", locales.PluralRuleMany, false); err != nil { + return + } + if err = ut.AddCardinal("len-string-character", "{0} символы", locales.PluralRuleOther, false); err != nil { return } @@ -52,10 +60,19 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er if err = ut.Add("len-items", "{0} должен содержать {1}", false); err != nil { return } + if err = ut.AddCardinal("len-items-item", "{0} элемент", locales.PluralRuleOne, false); err != nil { return } + if err = ut.AddCardinal("len-items-item", "{0} элемента", locales.PluralRuleFew, false); err != nil { + return + } + + if err = ut.AddCardinal("len-items-item", "{0} элементов", locales.PluralRuleMany, false); err != nil { + return + } + if err = ut.AddCardinal("len-items-item", "{0} элементы", locales.PluralRuleOther, false); err != nil { return } @@ -132,6 +149,14 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er return } + if err = ut.AddCardinal("min-string-character", "{0} символа", locales.PluralRuleFew, false); err != nil { + return + } + + if err = ut.AddCardinal("min-string-character", "{0} символов", locales.PluralRuleMany, false); err != nil { + return + } + if err = ut.AddCardinal("min-string-character", "{0} символы", locales.PluralRuleOther, false); err != nil { return } @@ -147,6 +172,14 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er return } + if err = ut.AddCardinal("min-items-item", "{0} элемента", locales.PluralRuleFew, false); err != nil { + return + } + + if err = ut.AddCardinal("min-items-item", "{0} элементов", locales.PluralRuleMany, false); err != nil { + return + } + if err = ut.AddCardinal("min-items-item", "{0} элементы", locales.PluralRuleOther, false); err != nil { return } @@ -223,6 +256,14 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er return } + if err = ut.AddCardinal("max-string-character", "{0} символа", locales.PluralRuleFew, false); err != nil { + return + } + + if err = ut.AddCardinal("max-string-character", "{0} символов", locales.PluralRuleMany, false); err != nil { + return + } + if err = ut.AddCardinal("max-string-character", "{0} символы", locales.PluralRuleOther, false); err != nil { return } @@ -238,6 +279,14 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er return } + if err = ut.AddCardinal("max-items-item", "{0} элемента", locales.PluralRuleFew, false); err != nil { + return + } + + if err = ut.AddCardinal("max-items-item", "{0} элементов", locales.PluralRuleMany, false); err != nil { + return + } + if err = ut.AddCardinal("max-items-item", "{0} элементы", locales.PluralRuleOther, false); err != nil { return } @@ -344,6 +393,14 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er return } + if err = ut.AddCardinal("lt-string-character", "{0} символов", locales.PluralRuleFew, false); err != nil { + return + } + + if err = ut.AddCardinal("lt-string-character", "{0} символов", locales.PluralRuleMany, false); err != nil { + return + } + if err = ut.AddCardinal("lt-string-character", "{0} символы", locales.PluralRuleOther, false); err != nil { return } @@ -360,6 +417,14 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er return } + if err = ut.AddCardinal("lt-items-item", "{0} элементов", locales.PluralRuleFew, false); err != nil { + return + } + + if err = ut.AddCardinal("lt-items-item", "{0} элементов", locales.PluralRuleMany, false); err != nil { + return + } + if err = ut.AddCardinal("lt-items-item", "{0} элементы", locales.PluralRuleOther, false); err != nil { return } @@ -465,6 +530,14 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er return } + if err = ut.AddCardinal("lte-string-character", "{0} символа", locales.PluralRuleFew, false); err != nil { + return + } + + if err = ut.AddCardinal("lte-string-character", "{0} символов", locales.PluralRuleMany, false); err != nil { + return + } + if err = ut.AddCardinal("lte-string-character", "{0} символы", locales.PluralRuleOther, false); err != nil { return } @@ -481,6 +554,14 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er return } + if err = ut.AddCardinal("lte-items-item", "{0} элемента", locales.PluralRuleFew, false); err != nil { + return + } + + if err = ut.AddCardinal("lte-items-item", "{0} элементов", locales.PluralRuleMany, false); err != nil { + return + } + if err = ut.AddCardinal("lte-items-item", "{0} элементы", locales.PluralRuleOther, false); err != nil { return } @@ -585,6 +666,14 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er return } + if err = ut.AddCardinal("gt-string-character", "{0} символов", locales.PluralRuleFew, false); err != nil { + return + } + + if err = ut.AddCardinal("gt-string-character", "{0} символов", locales.PluralRuleMany, false); err != nil { + return + } + if err = ut.AddCardinal("gt-string-character", "{0} символы", locales.PluralRuleOther, false); err != nil { return } @@ -601,6 +690,14 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er return } + if err = ut.AddCardinal("gt-items-item", "{0} элементов", locales.PluralRuleFew, false); err != nil { + return + } + + if err = ut.AddCardinal("gt-items-item", "{0} элементов", locales.PluralRuleMany, false); err != nil { + return + } + if err = ut.AddCardinal("gt-items-item", "{0} элементы", locales.PluralRuleOther, false); err != nil { return } @@ -705,6 +802,14 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er return } + if err = ut.AddCardinal("gte-string-character", "{0} символа", locales.PluralRuleFew, false); err != nil { + return + } + + if err = ut.AddCardinal("gte-string-character", "{0} символов", locales.PluralRuleMany, false); err != nil { + return + } + if err = ut.AddCardinal("gte-string-character", "{0} символы", locales.PluralRuleOther, false); err != nil { return } @@ -721,6 +826,14 @@ func RegisterDefaultTranslations(v *validator.Validate, trans ut.Translator) (er return } + if err = ut.AddCardinal("gte-items-item", "{0} элемента", locales.PluralRuleFew, false); err != nil { + return + } + + if err = ut.AddCardinal("gte-items-item", "{0} элементов", locales.PluralRuleMany, false); err != nil { + return + } + if err = ut.AddCardinal("gte-items-item", "{0} элементы", locales.PluralRuleOther, false); err != nil { return } diff --git a/translations/ru/ru_test.go b/translations/ru/ru_test.go index aa5beb7..e1a1069 100644 --- a/translations/ru/ru_test.go +++ b/translations/ru/ru_test.go @@ -7,7 +7,7 @@ import ( "time" . "github.com/go-playground/assert/v2" - russian "github.com/go-playground/locales/en" + russian "github.com/go-playground/locales/ru" ut "github.com/go-playground/universal-translator" "github.com/go-playground/validator/v10" ) @@ -33,116 +33,136 @@ func TestTranslations(t *testing.T) { } type Test struct { - Inner Inner - RequiredString string `validate:"required"` - RequiredNumber int `validate:"required"` - RequiredMultiple []string `validate:"required"` - 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"` - 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"` + Inner Inner + RequiredString string `validate:"required"` + RequiredNumber int `validate:"required"` + RequiredMultiple []string `validate:"required"` + LenString string `validate:"len=1"` + LenNumber float64 `validate:"len=1113.00"` + LenMultiple []string `validate:"len=7"` + LenMultipleSecond []string `validate:"len=2"` + MinString string `validate:"min=1"` + MinStringMultiple string `validate:"min=2"` + MinStringMultipleSecond string `validate:"min=7"` + MinNumber float64 `validate:"min=1113.00"` + MinMultiple []string `validate:"min=7"` + MinMultipleSecond []string `validate:"min=2"` + MaxString string `validate:"max=3"` + MaxStringSecond string `validate:"max=7"` + MaxNumber float64 `validate:"max=1113.00"` + MaxMultiple []string `validate:"max=7"` + MaxMultipleSecond []string `validate:"max=2"` + 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"` + LtStringSecond string `validate:"lt=7"` + LtNumber float64 `validate:"lt=5.56"` + LtMultiple []string `validate:"lt=2"` + LtMultipleSecond []string `validate:"lt=7"` + LtTime time.Time `validate:"lt"` + LteString string `validate:"lte=3"` + LteStringSecond string `validate:"lte=7"` + LteNumber float64 `validate:"lte=5.56"` + LteMultiple []string `validate:"lte=2"` + LteMultipleSecond []string `validate:"lte=7"` + LteTime time.Time `validate:"lte"` + GtString string `validate:"gt=3"` + GtStringSecond string `validate:"gt=7"` + GtNumber float64 `validate:"gt=5.56"` + GtMultiple []string `validate:"gt=2"` + GtMultipleSecond []string `validate:"gt=7"` + GtTime time.Time `validate:"gt"` + GteString string `validate:"gte=3"` + GteStringSecond string `validate:"gte=7"` + GteNumber float64 `validate:"gte=5.56"` + GteMultiple []string `validate:"gte=2"` + GteMultipleSecond []string `validate:"gte=7"` + 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"` + 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"` + StrPtrMinLenSecond *string `validate:"min=2"` + StrPtrMaxLen *string `validate:"max=1"` + StrPtrLen *string `validate:"len=2"` + StrPtrLenSecond *string `validate:"len=7"` + StrPtrLt *string `validate:"lt=1"` + StrPtrLte *string `validate:"lte=1"` + StrPtrLteMultiple *string `validate:"lte=2"` + StrPtrLteMultipleSecond *string `validate:"lte=7"` + StrPtrGt *string `validate:"gt=10"` + StrPtrGte *string `validate:"gte=10"` + StrPtrGtSecond *string `validate:"gt=2"` + StrPtrGteSecond *string `validate:"gte=2"` + 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"` } var test Test @@ -152,17 +172,23 @@ func TestTranslations(t *testing.T) { test.Inner.GteCSFieldString = "1234" test.MaxString = "1234" + test.MaxStringSecond = "12345678" test.MaxNumber = 2000 test.MaxMultiple = make([]string, 9) + test.MaxMultipleSecond = make([]string, 3) test.LtString = "1234" + test.LtStringSecond = "12345678" test.LtNumber = 6 test.LtMultiple = make([]string, 3) + test.LtMultipleSecond = make([]string, 8) test.LtTime = time.Now().Add(time.Hour * 24) test.LteString = "1234" + test.LteStringSecond = "12345678" test.LteNumber = 6 test.LteMultiple = make([]string, 3) + test.LteMultipleSecond = make([]string, 8) test.LteTime = time.Now().Add(time.Hour * 24) test.LtFieldString = "12345" @@ -452,15 +478,23 @@ func TestTranslations(t *testing.T) { }, { ns: "Test.GteString", - expected: "GteString должен содержать минимум 3 символы", + expected: "GteString должен содержать минимум 3 символа", + }, + { + ns: "Test.GteStringSecond", + expected: "GteStringSecond должен содержать минимум 7 символов", }, { ns: "Test.GteNumber", - expected: "GteNumber должен быть больше или равно 5.56", + expected: "GteNumber должен быть больше или равно 5,56", }, { ns: "Test.GteMultiple", - expected: "GteMultiple должен содержать минимум 2 элементы", + expected: "GteMultiple должен содержать минимум 2 элемента", + }, + { + ns: "Test.GteMultipleSecond", + expected: "GteMultipleSecond должен содержать минимум 7 элементов", }, { ns: "Test.GteTime", @@ -468,15 +502,23 @@ func TestTranslations(t *testing.T) { }, { ns: "Test.GtString", - expected: "GtString должен быть длиннее 3 символы", + expected: "GtString должен быть длиннее 3 символов", + }, + { + ns: "Test.GtStringSecond", + expected: "GtStringSecond должен быть длиннее 7 символов", }, { ns: "Test.GtNumber", - expected: "GtNumber должен быть больше 5.56", + expected: "GtNumber должен быть больше 5,56", }, { ns: "Test.GtMultiple", - expected: "GtMultiple должен содержать более 2 элементы", + expected: "GtMultiple должен содержать более 2 элементов", + }, + { + ns: "Test.GtMultipleSecond", + expected: "GtMultipleSecond должен содержать более 7 элементов", }, { ns: "Test.GtTime", @@ -484,15 +526,23 @@ func TestTranslations(t *testing.T) { }, { ns: "Test.LteString", - expected: "LteString должен содержать максимум 3 символы", + expected: "LteString должен содержать максимум 3 символа", + }, + { + ns: "Test.LteStringSecond", + expected: "LteStringSecond должен содержать максимум 7 символов", }, { ns: "Test.LteNumber", - expected: "LteNumber должен быть менее или равен 5.56", + expected: "LteNumber должен быть менее или равен 5,56", }, { ns: "Test.LteMultiple", - expected: "LteMultiple должен содержать максимум 2 элементы", + expected: "LteMultiple должен содержать максимум 2 элемента", + }, + { + ns: "Test.LteMultipleSecond", + expected: "LteMultipleSecond должен содержать максимум 7 элементов", }, { ns: "Test.LteTime", @@ -500,15 +550,23 @@ func TestTranslations(t *testing.T) { }, { ns: "Test.LtString", - expected: "LtString должен иметь менее 3 символы", + expected: "LtString должен иметь менее 3 символов", + }, + { + ns: "Test.LtStringSecond", + expected: "LtStringSecond должен иметь менее 7 символов", }, { ns: "Test.LtNumber", - expected: "LtNumber должен быть менее 5.56", + expected: "LtNumber должен быть менее 5,56", }, { ns: "Test.LtMultiple", - expected: "LtMultiple должен содержать менее 2 элементы", + expected: "LtMultiple должен содержать менее 2 элементов", + }, + { + ns: "Test.LtMultipleSecond", + expected: "LtMultipleSecond должен содержать менее 7 элементов", }, { ns: "Test.LtTime", @@ -540,27 +598,47 @@ func TestTranslations(t *testing.T) { }, { ns: "Test.MaxString", - expected: "MaxString должен содержать максимум 3 символы", + expected: "MaxString должен содержать максимум 3 символа", + }, + { + ns: "Test.MaxStringSecond", + expected: "MaxStringSecond должен содержать максимум 7 символов", }, { ns: "Test.MaxNumber", - expected: "MaxNumber должен быть меньше или равно 1,113.00", + expected: "MaxNumber должен быть меньше или равно 1 113,00", }, { ns: "Test.MaxMultiple", - expected: "MaxMultiple должен содержать максимум 7 элементы", + expected: "MaxMultiple должен содержать максимум 7 элементов", + }, + { + ns: "Test.MaxMultipleSecond", + expected: "MaxMultipleSecond должен содержать максимум 2 элемента", }, { ns: "Test.MinString", expected: "MinString должен содержать минимум 1 символ", }, + { + ns: "Test.MinStringMultiple", + expected: "MinStringMultiple должен содержать минимум 2 символа", + }, + { + ns: "Test.MinStringMultipleSecond", + expected: "MinStringMultipleSecond должен содержать минимум 7 символов", + }, { ns: "Test.MinNumber", - expected: "MinNumber должен быть больше или равно 1,113.00", + expected: "MinNumber должен быть больше или равно 1 113,00", }, { ns: "Test.MinMultiple", - expected: "MinMultiple должен содержать минимум 7 элементы", + expected: "MinMultiple должен содержать минимум 7 элементов", + }, + { + ns: "Test.MinMultipleSecond", + expected: "MinMultipleSecond должен содержать минимум 2 элемента", }, { ns: "Test.LenString", @@ -568,11 +646,15 @@ func TestTranslations(t *testing.T) { }, { ns: "Test.LenNumber", - expected: "LenNumber должен быть равен 1,113.00", + expected: "LenNumber должен быть равен 1 113,00", }, { ns: "Test.LenMultiple", - expected: "LenMultiple должен содержать 7 элементы", + expected: "LenMultiple должен содержать 7 элементов", + }, + { + ns: "Test.LenMultipleSecond", + expected: "LenMultipleSecond должен содержать 2 элемента", }, { ns: "Test.RequiredString", @@ -588,7 +670,11 @@ func TestTranslations(t *testing.T) { }, { ns: "Test.StrPtrMinLen", - expected: "StrPtrMinLen должен содержать минимум 10 символы", + expected: "StrPtrMinLen должен содержать минимум 10 символов", + }, + { + ns: "Test.StrPtrMinLenSecond", + expected: "StrPtrMinLenSecond должен содержать минимум 2 символа", }, { ns: "Test.StrPtrMaxLen", @@ -596,7 +682,11 @@ func TestTranslations(t *testing.T) { }, { ns: "Test.StrPtrLen", - expected: "StrPtrLen должен быть длиной в 2 символы", + expected: "StrPtrLen должен быть длиной в 2 символа", + }, + { + ns: "Test.StrPtrLenSecond", + expected: "StrPtrLenSecond должен быть длиной в 7 символов", }, { ns: "Test.StrPtrLt", @@ -606,13 +696,29 @@ func TestTranslations(t *testing.T) { ns: "Test.StrPtrLte", expected: "StrPtrLte должен содержать максимум 1 символ", }, + { + ns: "Test.StrPtrLteMultiple", + expected: "StrPtrLteMultiple должен содержать максимум 2 символа", + }, + { + ns: "Test.StrPtrLteMultipleSecond", + expected: "StrPtrLteMultipleSecond должен содержать максимум 7 символов", + }, { ns: "Test.StrPtrGt", - expected: "StrPtrGt должен быть длиннее 10 символы", + expected: "StrPtrGt должен быть длиннее 10 символов", + }, + { + ns: "Test.StrPtrGtSecond", + expected: "StrPtrGtSecond должен быть длиннее 2 символов", }, { ns: "Test.StrPtrGte", - expected: "StrPtrGte должен содержать минимум 10 символы", + expected: "StrPtrGte должен содержать минимум 10 символов", + }, + { + ns: "Test.StrPtrGteSecond", + expected: "StrPtrGteSecond должен содержать минимум 2 символа", }, { ns: "Test.OneOfString",