Skip to content

Commit

Permalink
Add translation of requiredXXX and excludedXXX in English/Chinese/Chi…
Browse files Browse the repository at this point in the history
…nese Taiwan (#1170)

## Fixes Or Enhances

Add translation of below in English/Chinese/Chinese Taiwan :
    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

**Make sure that you've checked the boxes below before you submit PR:**
- [x] Tests exist or have been written that cover this particular
change.

@go-playground/validator-maintainers
  • Loading branch information
violin0622 committed Jan 14, 2024
1 parent add493f commit 37a1071
Show file tree
Hide file tree
Showing 6 changed files with 549 additions and 140 deletions.
60 changes: 60 additions & 0 deletions translations/en/en.go
Expand Up @@ -34,6 +34,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) {
Expand Down

0 comments on commit 37a1071

Please sign in to comment.