github.com/System-Glitch/goyave/v2@v2.10.3-0.20200819142921-51011e75d504/lang/defaults.go (about)

     1  package lang
     2  
     3  var enUS language = language{
     4  	lines: map[string]string{
     5  		"disallow-non-validated-fields": "Non-validated fields are forbidden.",
     6  		"malformed-request":             "Malformed request",
     7  		"malformed-json":                "Malformed JSON",
     8  		"auth.invalid-credentials":      "These credentials don't match our records.",
     9  		"auth.no-credentials-provided":  "Invalid or missing authentication header.",
    10  		"auth.jwt-invalid":              "Your authentication token is invalid.",
    11  		"auth.jwt-not-valid-yet":        "Your authentication token is not valid yet.",
    12  		"auth.jwt-expired":              "Your authentication token is expired.",
    13  	},
    14  	validation: validationLines{
    15  		rules: map[string]string{
    16  			"required":                         "The :field is required.",
    17  			"required.array":                   "The :field values are required.",
    18  			"numeric":                          "The :field must be numeric.",
    19  			"numeric.array":                    "The :field values must be numeric.",
    20  			"integer":                          "The :field must be an integer.",
    21  			"integer.array":                    "The :field values must be integers.",
    22  			"string":                           "The :field must be a string.",
    23  			"string.array":                     "The :field values must be strings.",
    24  			"array":                            "The :field must be an array.", // TODO add type of values in array if provided
    25  			"array.array":                      "The :field values must be arrays.",
    26  			"min.string":                       "The :field must be at least :min characters.",
    27  			"min.numeric":                      "The :field must be at least :min.",
    28  			"min.array":                        "The :field must have at least :min items.",
    29  			"min.file":                         "The :field must be at least :min KiB.",
    30  			"min.string.array":                 "The :field values must be at least :min characters.",
    31  			"min.numeric.array":                "The :field values must be at least :min.",
    32  			"min.array.array":                  "The :field values must have at least :min items.",
    33  			"max.string":                       "The :field may not have more than :max characters.",
    34  			"max.numeric":                      "The :field may not be greater than :max.",
    35  			"max.array":                        "The :field may not have more than :max items.",
    36  			"max.string.array":                 "The :field values may not have more than :max characters.",
    37  			"max.numeric.array":                "The :field values may not be greater than :max.",
    38  			"max.array.array":                  "The :field values may not have more than :max items.",
    39  			"max.file":                         "The :field may not be greater than :max KiB.",
    40  			"between.string":                   "The :field must be between :min and :max characters.",
    41  			"between.numeric":                  "The :field must be between :min and :max.",
    42  			"between.array":                    "The :field must have between :min and :max items.",
    43  			"between.string.array":             "The :field values must be between :min and :max characters.",
    44  			"between.numeric.array":            "The :field values must be between :min and :max.",
    45  			"between.array.array":              "The :field values must have between :min and :max items.",
    46  			"between.file":                     "The :field must be between :min and :max KiB.",
    47  			"greater_than.string":              "The :field must be longer than the :other.",
    48  			"greater_than.numeric":             "The :field must be greater than the :other.",
    49  			"greater_than.array":               "The :field must have more items than the :other.",
    50  			"greater_than.string.array":        "The :field values must be longer than the :other.",
    51  			"greater_than.numeric.array":       "The :field values must be greater than the :other.",
    52  			"greater_than.array.array":         "The :field values must have more items than the :other.",
    53  			"greater_than.file":                "The :field must be larger than the :other.",
    54  			"greater_than_equal.string":        "The :field must be longer or have the same length as the :other.",
    55  			"greater_than_equal.numeric":       "The :field must be greater or equal to the :other.",
    56  			"greater_than_equal.array":         "The :field must have more or the same amount of items as the :other.",
    57  			"greater_than_equal.string.array":  "The :field values must be longer or have the same length as the :other.",
    58  			"greater_than_equal.numeric.array": "The :field values must be greater or equal to the :other.",
    59  			"greater_than_equal.array.array":   "The :field values must have more or the same amount of items as the :other.",
    60  			"greater_than_equal.file":          "The :field must be the same size or larger than the :other.",
    61  			"lower_than.string":                "The :field must be shorter than the :other.",
    62  			"lower_than.numeric":               "The :field must be lower than the :other.",
    63  			"lower_than.array":                 "The :field must have less items than the :other.",
    64  			"lower_than.string.array":          "The :field values must be shorter than the :other.",
    65  			"lower_than.numeric.array":         "The :field values must be lower than the :other.",
    66  			"lower_than.array.array":           "The :field values must have less items than the :other.",
    67  			"lower_than.file":                  "The :field must be smaller than the :other.",
    68  			"lower_than_equal.string":          "The :field must be shorter or have the same length as the :other.",
    69  			"lower_than_equal.numeric":         "The :field must be lower or equal to the :other.",
    70  			"lower_than_equal.array":           "The :field must have less or the same amount of items as the :other.",
    71  			"lower_than_equal.string.array":    "The :field values must be shorter or have the same length as the :other.",
    72  			"lower_than_equal.numeric.array":   "The :field values must be lower or equal to the :other.",
    73  			"lower_than_equal.array.array":     "The :field values must have less or the same amount of items as the :other.",
    74  			"lower_than_equal.file":            "The :field must be the same size or smaller than the :other.",
    75  			"distinct":                         "The :field must have only distinct values.",
    76  			"distinct.array":                   "The :field values must have only distinct values.",
    77  			"digits":                           "The :field must be digits only.",
    78  			"digits.array":                     "The :field values must be digits only.",
    79  			"regex":                            "The :field format is invalid.",
    80  			"regex.array":                      "The :field values format is invalid.",
    81  			"email":                            "The :field must be a valid email address.",
    82  			"email.array":                      "The :field values must be valid email addresses.",
    83  			"size.string":                      "The :field must be exactly :value characters-long.",
    84  			"size.numeric":                     "The :field must be exactly :value.",
    85  			"size.array":                       "The :field must contain exactly :value items.",
    86  			"size.string.array":                "The :field values must be exactly :value characters-long.",
    87  			"size.numeric.array":               "The :field values must be exactly :value.",
    88  			"size.array.array":                 "The :field values must contain exactly :value items.",
    89  			"size.file":                        "The :field must be exactly :value KiB.",
    90  			"alpha":                            "The :field may only contain letters.",
    91  			"alpha.array":                      "The :field values may only contain letters.",
    92  			"alpha_dash":                       "The :field may only contain letters, numbers, dashes and underscores.",
    93  			"alpha_dash.array":                 "The :field values may only contain letters, numbers, dashes and underscores.",
    94  			"alpha_num":                        "The :field may only contain letters and numbers.",
    95  			"alpha_num.array":                  "The :field values may only contain letters and numbers.",
    96  			"starts_with":                      "The :field must start with one of the following values: :values.",
    97  			"starts_with.array":                "The :field values must start with one of the following values: :values.",
    98  			"ends_with":                        "The :field must end with one of the following values: :values.",
    99  			"ends_with.array":                  "The :field values must end with one of the following values: :values.",
   100  			"in":                               "The :field must have one of the following values: :values.",
   101  			"in.values":                        "The :field values must have one of the following values: :values.",
   102  			"not_in":                           "The :field must not have one of the following values: :values.",
   103  			"not_in.array":                     "The :field values must not have one of the following values: :values.",
   104  			"in_array":                         "The :field doesn't exist in the :other.",
   105  			"in_array.array":                   "The :field values don't exist in the :other.",
   106  			"not_in_array":                     "The :field exists in the :other.",
   107  			"not_in_array.array":               "The :field values exist in the :other.",
   108  			"timezone":                         "The :field must be a valid time zone.",
   109  			"timezone.array":                   "The :field values must be valid time zones.",
   110  			"ip":                               "The :field must be a valid IP address.",
   111  			"ip.array":                         "The :field values must be valid IP addresses.",
   112  			"ipv4":                             "The :field must be a valid IPv4 address.",
   113  			"ipv4.array":                       "The :field values must be valid IPv4 addresses.",
   114  			"ipv6":                             "The :field must be a valid IPv6 address.",
   115  			"ipv6.array":                       "The :field values must be valid IPv6 addresses.",
   116  			"json":                             "The :field must be a valid JSON string.",
   117  			"json.array":                       "The :field values must be valid JSON strings.",
   118  			"url":                              "The :field must be a valid URL.",
   119  			"url.array":                        "The :field values must be valid URLs.",
   120  			"uuid":                             "The :field must be a valid UUID:version.",
   121  			"uuid.array":                       "The :field values must be valid UUID:version.",
   122  			"bool":                             "The :field must be a boolean.",
   123  			"bool.array":                       "The :field values must be booleans.",
   124  			"same":                             "The :field and the :other must match.",
   125  			"same.array":                       "The :field values and the :other must match.",
   126  			"different":                        "The :field and the :other must be different.",
   127  			"different.array":                  "The :field values and the :other must be different.",
   128  			"confirmed":                        "The :field confirmation doesn't match.",
   129  			"file":                             "The :field must be a file.",
   130  			"mime":                             "The :field must be a file of type: :values.",
   131  			"image":                            "The :field must be an image.",
   132  			"extension":                        "The :field must be a file with one of the following extensions: :values.",
   133  			"count":                            "The :field must have exactly :value file(s).",
   134  			"count_min":                        "The :field must have at least :value file(s).",
   135  			"count_max":                        "The :field may not have more than :value file(s).",
   136  			"count_between":                    "The :field must have between :min and :max files.",
   137  			"date":                             "The :field is not a valid date.",
   138  			"date.array":                       "The :field values are not valid dates.",
   139  			"before":                           "The :field must be a date before :date.",
   140  			"before.array":                     "The :field values must be dates before :date.",
   141  			"before_equal":                     "The :field must be a date before or equal to :date.",
   142  			"before_equal.array":               "The :field must be dates before or equal to :date.",
   143  			"after":                            "The :field must be a date after :date.",
   144  			"after.array":                      "The :field values must be dates after :date.",
   145  			"after_equal":                      "The :field must be a date after or equal to :date.",
   146  			"after_equal.array":                "The :field values must be dates after or equal to :date.",
   147  			"date_equals":                      "The :field must be a date equal to :date.",
   148  			"date_equals.array":                "The :field values must be dates equal to :date.",
   149  			"date_between":                     "The :field must be a date between :date and :max_date.",
   150  			"date_between.array":               "The :field must be dates between :date and :max_date.",
   151  		},
   152  		fields: map[string]attribute{
   153  			"email": {
   154  				Name: "email address",
   155  			},
   156  		},
   157  	},
   158  }