@tmlmobilidade/go-utils-validation 0.0.0-stage → 20261109.1101.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +720 -0
- package/dist/index.js +127 -0
- package/dist/locales/en.json +226 -0
- package/dist/locales/es.json +226 -0
- package/dist/locales/pt.json +226 -0
- package/package.json +62 -5
- package/README.md +0 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { createInstance } from 'i18next';
|
|
2
|
+
import ICU from 'i18next-icu';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { makeZodI18nMap } from 'zod-i18n-map';
|
|
5
|
+
import en from './locales/en.json' with { type: 'json' };
|
|
6
|
+
import es from './locales/es.json' with { type: 'json' };
|
|
7
|
+
import pt from './locales/pt.json' with { type: 'json' };
|
|
8
|
+
export const validationResources = { en: { validation: en }, es: { validation: es }, pt: { validation: pt } };
|
|
9
|
+
const instance = createInstance();
|
|
10
|
+
instance.use(new ICU({ parseErrorHandler: () => '' }));
|
|
11
|
+
void instance.init({
|
|
12
|
+
defaultNS: 'validation',
|
|
13
|
+
fallbackLng: 'pt',
|
|
14
|
+
initAsync: false,
|
|
15
|
+
interpolation: { escapeValue: false },
|
|
16
|
+
lng: 'pt',
|
|
17
|
+
resources: validationResources,
|
|
18
|
+
});
|
|
19
|
+
function getLocale(locale) {
|
|
20
|
+
const language = locale.toLowerCase().split(/[-_]/)[0];
|
|
21
|
+
return Object.hasOwn(validationResources, language) ? language : 'pt';
|
|
22
|
+
}
|
|
23
|
+
function getUnionTypeLabel(branches, locale) {
|
|
24
|
+
if (!branches.length)
|
|
25
|
+
return undefined;
|
|
26
|
+
const expected = branches.map(branch => branch.length === 1 && branch[0].code === 'invalid_type' && !branch[0].path?.length ? branch[0].expected : undefined);
|
|
27
|
+
if (!expected.every(value => value !== undefined))
|
|
28
|
+
return undefined;
|
|
29
|
+
const t = instance.getFixedT(locale, 'validation');
|
|
30
|
+
return [...new Set(expected)].map((type) => {
|
|
31
|
+
const key = `types.${type}`;
|
|
32
|
+
const label = t(key);
|
|
33
|
+
return label === key ? type : label;
|
|
34
|
+
}).join(' / ');
|
|
35
|
+
}
|
|
36
|
+
/** Translate a rule outside parsing, for example a password requirement checklist. */
|
|
37
|
+
export function translateValidationMessage(key, values = {}, locale = 'pt') {
|
|
38
|
+
const message = instance.getFixedT(getLocale(locale), 'validation')(key, values);
|
|
39
|
+
return typeof message === 'string' && message.length > 0 && message !== key
|
|
40
|
+
? message
|
|
41
|
+
: instance.getFixedT('pt', 'validation')('errors.custom');
|
|
42
|
+
}
|
|
43
|
+
/** Locale-neutral custom issue options for refine(), superRefine() and addIssue(). */
|
|
44
|
+
export function validationParams(key, values = {}) {
|
|
45
|
+
return { params: { i18n: { key, values } } };
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Custom wording for a built-in check such as min() or regex(). Leave translation
|
|
49
|
+
* to the per-parse map: a schema-level string would override the caller's locale.
|
|
50
|
+
*/
|
|
51
|
+
export function validationMessage(key, values = {}) {
|
|
52
|
+
return (issue) => {
|
|
53
|
+
Object.assign(issue, { validation: { key, values } });
|
|
54
|
+
return undefined;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** Adapt an existing throwing validator to the Zod issue protocol. */
|
|
58
|
+
export function validationTransform(validate, key, values = {}) {
|
|
59
|
+
return (value, context) => {
|
|
60
|
+
try {
|
|
61
|
+
return validate(value);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
context.addIssue({ code: 'custom', ...validationParams(key, values) });
|
|
65
|
+
return z.NEVER;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** A fixed-language map. Safe to use concurrently without changing global language. */
|
|
70
|
+
export function createValidationErrorMap(locale = 'pt') {
|
|
71
|
+
const language = getLocale(locale);
|
|
72
|
+
const base = makeZodI18nMap({ handlePath: false, ns: 'validation', t: instance.getFixedT(language, 'validation') });
|
|
73
|
+
const resolve = (issue) => {
|
|
74
|
+
if ('validation' in issue) {
|
|
75
|
+
const metadata = issue.validation;
|
|
76
|
+
return base.key(metadata.key, metadata.values)(issue);
|
|
77
|
+
}
|
|
78
|
+
if (issue.input === undefined && ['invalid_type', 'invalid_union', 'invalid_value'].includes(issue.code)) {
|
|
79
|
+
return base.key('errors.invalid_type_received_undefined')(issue);
|
|
80
|
+
}
|
|
81
|
+
// Null is a type error unless the schema preprocesses it to undefined.
|
|
82
|
+
if (issue.code === 'invalid_type' && issue.input === null) {
|
|
83
|
+
return base.key('errors.invalid_type')(issue);
|
|
84
|
+
}
|
|
85
|
+
if (issue.code === 'invalid_union') {
|
|
86
|
+
const expected = getUnionTypeLabel(issue.errors, language);
|
|
87
|
+
if (expected) {
|
|
88
|
+
return base.key('errors.invalid_union_type', { expected })(issue);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return base(issue) || translateValidationMessage('errors.custom', {}, language);
|
|
92
|
+
};
|
|
93
|
+
const map = (issue) => {
|
|
94
|
+
const result = resolve(issue);
|
|
95
|
+
const message = typeof result === 'string' ? result : result?.message;
|
|
96
|
+
return message?.trim() ? message : translateValidationMessage('errors.custom', {}, language);
|
|
97
|
+
};
|
|
98
|
+
return Object.assign(map, {
|
|
99
|
+
translate: (issue) => {
|
|
100
|
+
const metadata = ('zodI18n' in issue ? issue.zodI18n : undefined);
|
|
101
|
+
if (issue.code === 'invalid_union' && metadata?.custom?.key === 'errors.invalid_union_type') {
|
|
102
|
+
const expected = getUnionTypeLabel(issue.errors, language);
|
|
103
|
+
if (expected) {
|
|
104
|
+
return translateValidationMessage('errors.invalid_union_type', { expected }, language);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const message = base.translate(issue);
|
|
108
|
+
return message?.trim() ? message : translateValidationMessage('errors.custom', {}, language);
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/** Format an existing Zod error for an API's error:string response or a worker log. */
|
|
113
|
+
export function formatValidationError(error, locale = 'pt') {
|
|
114
|
+
const map = createValidationErrorMap(locale);
|
|
115
|
+
return error.issues.map(issue => `${issue.path.length ? `${issue.path.map(String).join('.')}: ` : ''}${map.translate(issue)}`).join('; ');
|
|
116
|
+
}
|
|
117
|
+
/** Synchronous form resolver preserving Zod paths, including nested array fields. */
|
|
118
|
+
export function createValidationResolver(schema, locale = 'pt') {
|
|
119
|
+
const error = createValidationErrorMap(locale);
|
|
120
|
+
return (values) => {
|
|
121
|
+
const result = schema.safeParse(values, { error });
|
|
122
|
+
return result.success ? {} : Object.fromEntries(result.error.issues.map(issue => [issue.path.map(String).join('.'), issue.message]));
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
// A fixed Portuguese default for existing parse()/safeParse() callers. Forms and
|
|
126
|
+
// requests override it per parse; they never mutate this global configuration.
|
|
127
|
+
z.config({ customError: createValidationErrorMap() });
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
{
|
|
2
|
+
"custom": {
|
|
3
|
+
"banner": {
|
|
4
|
+
"link": "Banner links must use HTTP or HTTPS"
|
|
5
|
+
},
|
|
6
|
+
"dates": {
|
|
7
|
+
"event_id": "Must be uppercase letters, numbers, or underscores",
|
|
8
|
+
"overlap": "Dates cannot be added and removed in the same request: {dates}",
|
|
9
|
+
"period_name": "Enter a period name",
|
|
10
|
+
"period_required": "Select a period"
|
|
11
|
+
},
|
|
12
|
+
"documents": {
|
|
13
|
+
"changes_required": "multiple_fields requires metadata.changes array",
|
|
14
|
+
"different_values": "curr_value and prev_value must differ",
|
|
15
|
+
"null_values": "multiple_fields must have null curr_value and prev_value"
|
|
16
|
+
},
|
|
17
|
+
"feedback": {
|
|
18
|
+
"duplicate_reason": "Reason \"{reason}\" cannot be selected more than once.",
|
|
19
|
+
"reason": "Reason \"{reason}\" is not valid for {entity} feedback."
|
|
20
|
+
},
|
|
21
|
+
"formats": {
|
|
22
|
+
"date": "Expected a date in the format {format}",
|
|
23
|
+
"hex_color": "Expected a hex color in the format {format}",
|
|
24
|
+
"hhmm": "Expected a time in the format {format} between {minimum} and {maximum}",
|
|
25
|
+
"operational_date": "Expected a date in the format {format} or {alternative}",
|
|
26
|
+
"operational_time": "Expected a time in the format {format}, with minutes and seconds between 00 and 59",
|
|
27
|
+
"unix_milliseconds": "Expected a valid Unix timestamp in milliseconds, at least {minimum}",
|
|
28
|
+
"unix_seconds": "Expected a valid Unix timestamp in seconds, at least {minimum}"
|
|
29
|
+
},
|
|
30
|
+
"geo": {
|
|
31
|
+
"coordinate": "Invalid coordinate",
|
|
32
|
+
"encoded_polyline": "Invalid encoded polyline",
|
|
33
|
+
"latitude": "Latitude must be between {minimum} and {maximum}",
|
|
34
|
+
"linear_ring": "The first and last points of a linear ring must match",
|
|
35
|
+
"longitude": "Longitude must be between {minimum} and {maximum}"
|
|
36
|
+
},
|
|
37
|
+
"network": {
|
|
38
|
+
"agency_required": "At least one agency ID is required",
|
|
39
|
+
"anchor": "An anchor must identify both ends of one path segment.",
|
|
40
|
+
"default_required": "A default parameter is required.",
|
|
41
|
+
"default_unique": "Only one default parameter is allowed.",
|
|
42
|
+
"parameters_path": "Travel-time parameters must match each path occurrence in order.",
|
|
43
|
+
"path_ids": "Path occurrence IDs must be unique.",
|
|
44
|
+
"shape_distances": "Shape distances must not decrease along the path.",
|
|
45
|
+
"shape_sequences": "Shape point sequences must be unique.",
|
|
46
|
+
"stop_distances": "Stop distances must not decrease along the path.",
|
|
47
|
+
"stop_sequences": "Stop sequences must be unique.",
|
|
48
|
+
"weekdays": "Select at least one weekday.",
|
|
49
|
+
"year_periods": "Select at least one year period."
|
|
50
|
+
},
|
|
51
|
+
"password": {
|
|
52
|
+
"lowercase": "Password must contain at least one lowercase character",
|
|
53
|
+
"min_length": "Password must be at least {minimum} characters long",
|
|
54
|
+
"mismatch": "Passwords do not match",
|
|
55
|
+
"number": "Password must contain at least one number",
|
|
56
|
+
"requirements": "Password requirements",
|
|
57
|
+
"special": "Password must contain at least one special character",
|
|
58
|
+
"uppercase": "Password must contain at least one uppercase character"
|
|
59
|
+
},
|
|
60
|
+
"schedule": {
|
|
61
|
+
"active_period": "The active period end date must be on or after the start date",
|
|
62
|
+
"end_after_start": "The end must be after the start",
|
|
63
|
+
"publication": "The publication end date must be on or after the start date"
|
|
64
|
+
},
|
|
65
|
+
"unique": {
|
|
66
|
+
"changelog_items": "Change item IDs must be unique within a changelog",
|
|
67
|
+
"module_ids": "Module IDs must be unique",
|
|
68
|
+
"release_ids": "Release IDs must be unique"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"errors": {
|
|
72
|
+
"custom": "Invalid input",
|
|
73
|
+
"invalid_element": "Invalid value in {origin}",
|
|
74
|
+
"invalid_format": {
|
|
75
|
+
"default": "Invalid {format}",
|
|
76
|
+
"ends_with": "Must end with \"{suffix}\"",
|
|
77
|
+
"includes": "Must include \"{includes}\"",
|
|
78
|
+
"lowercase": "Must be lowercase",
|
|
79
|
+
"regex": "Invalid format",
|
|
80
|
+
"starts_with": "Must start with \"{prefix}\"",
|
|
81
|
+
"uppercase": "Must be uppercase"
|
|
82
|
+
},
|
|
83
|
+
"invalid_key": "Invalid key in {origin}",
|
|
84
|
+
"invalid_type": "Expected {expected}, received {received}",
|
|
85
|
+
"invalid_type_received_null": "Expected {expected}, received {received}",
|
|
86
|
+
"invalid_type_received_undefined": "Required",
|
|
87
|
+
"invalid_union": "Invalid input",
|
|
88
|
+
"invalid_union_discriminator": "Invalid discriminator value. Expected {options}",
|
|
89
|
+
"invalid_union_type": "Expected {expected}",
|
|
90
|
+
"invalid_value": "Invalid option: expected one of {options}",
|
|
91
|
+
"invalid_value_single": "Invalid input: expected {expected}",
|
|
92
|
+
"not_multiple_of": "Number must be a multiple of {divisor}",
|
|
93
|
+
"too_big": {
|
|
94
|
+
"array": {
|
|
95
|
+
"exact": "{count, plural, one {Array must contain exactly {count} element} other {Array must contain exactly {count} elements}}",
|
|
96
|
+
"inclusive": "{count, plural, one {Array must contain at most {count} element} other {Array must contain at most {count} elements}}",
|
|
97
|
+
"not_inclusive": "{count, plural, one {Array must contain fewer than {count} element} other {Array must contain fewer than {count} elements}}"
|
|
98
|
+
},
|
|
99
|
+
"date": {
|
|
100
|
+
"exact": "Date must be exactly {maximum, date}",
|
|
101
|
+
"inclusive": "Date must be on or before {maximum, date}",
|
|
102
|
+
"not_inclusive": "Date must be before {maximum, date}"
|
|
103
|
+
},
|
|
104
|
+
"file": {
|
|
105
|
+
"exact": "{count, plural, one {File must be exactly {count} byte} other {File must be exactly {count} bytes}}",
|
|
106
|
+
"inclusive": "{count, plural, one {File must be at most {count} byte} other {File must be at most {count} bytes}}",
|
|
107
|
+
"not_inclusive": "{count, plural, one {File must be smaller than {count} byte} other {File must be smaller than {count} bytes}}"
|
|
108
|
+
},
|
|
109
|
+
"map": {
|
|
110
|
+
"exact": "{count, plural, one {Map must contain exactly {count} entry} other {Map must contain exactly {count} entries}}",
|
|
111
|
+
"inclusive": "{count, plural, one {Map must contain at most {count} entry} other {Map must contain at most {count} entries}}",
|
|
112
|
+
"not_inclusive": "{count, plural, one {Map must contain fewer than {count} entry} other {Map must contain fewer than {count} entries}}"
|
|
113
|
+
},
|
|
114
|
+
"number": {
|
|
115
|
+
"exact": "Number must be exactly {maximum}",
|
|
116
|
+
"inclusive": "Number must be less than or equal to {maximum}",
|
|
117
|
+
"not_inclusive": "Number must be less than {maximum}"
|
|
118
|
+
},
|
|
119
|
+
"set": {
|
|
120
|
+
"exact": "{count, plural, one {Set must contain exactly {count} item} other {Set must contain exactly {count} items}}",
|
|
121
|
+
"inclusive": "{count, plural, one {Set must contain at most {count} item} other {Set must contain at most {count} items}}",
|
|
122
|
+
"not_inclusive": "{count, plural, one {Set must contain fewer than {count} item} other {Set must contain fewer than {count} items}}"
|
|
123
|
+
},
|
|
124
|
+
"string": {
|
|
125
|
+
"exact": "{count, plural, one {String must contain exactly {count} character} other {String must contain exactly {count} characters}}",
|
|
126
|
+
"inclusive": "{count, plural, one {String must contain at most {count} character} other {String must contain at most {count} characters}}",
|
|
127
|
+
"not_inclusive": "{count, plural, one {String must contain fewer than {count} character} other {String must contain fewer than {count} characters}}"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"too_small": {
|
|
131
|
+
"array": {
|
|
132
|
+
"exact": "{count, plural, one {Array must contain exactly {count} element} other {Array must contain exactly {count} elements}}",
|
|
133
|
+
"inclusive": "{count, plural, one {Array must contain at least {count} element} other {Array must contain at least {count} elements}}",
|
|
134
|
+
"not_inclusive": "{count, plural, one {Array must contain more than {count} element} other {Array must contain more than {count} elements}}"
|
|
135
|
+
},
|
|
136
|
+
"date": {
|
|
137
|
+
"exact": "Date must be exactly {minimum, date}",
|
|
138
|
+
"inclusive": "Date must be on or after {minimum, date}",
|
|
139
|
+
"not_inclusive": "Date must be after {minimum, date}"
|
|
140
|
+
},
|
|
141
|
+
"file": {
|
|
142
|
+
"exact": "{count, plural, one {File must be exactly {count} byte} other {File must be exactly {count} bytes}}",
|
|
143
|
+
"inclusive": "{count, plural, one {File must be at least {count} byte} other {File must be at least {count} bytes}}",
|
|
144
|
+
"not_inclusive": "{count, plural, one {File must be larger than {count} byte} other {File must be larger than {count} bytes}}"
|
|
145
|
+
},
|
|
146
|
+
"map": {
|
|
147
|
+
"exact": "{count, plural, one {Map must contain exactly {count} entry} other {Map must contain exactly {count} entries}}",
|
|
148
|
+
"inclusive": "{count, plural, one {Map must contain at least {count} entry} other {Map must contain at least {count} entries}}",
|
|
149
|
+
"not_inclusive": "{count, plural, one {Map must contain more than {count} entry} other {Map must contain more than {count} entries}}"
|
|
150
|
+
},
|
|
151
|
+
"number": {
|
|
152
|
+
"exact": "Number must be exactly {minimum}",
|
|
153
|
+
"inclusive": "Number must be greater than or equal to {minimum}",
|
|
154
|
+
"not_inclusive": "Number must be greater than {minimum}"
|
|
155
|
+
},
|
|
156
|
+
"set": {
|
|
157
|
+
"exact": "{count, plural, one {Set must contain exactly {count} item} other {Set must contain exactly {count} items}}",
|
|
158
|
+
"inclusive": "{count, plural, one {Set must contain at least {count} item} other {Set must contain at least {count} items}}",
|
|
159
|
+
"not_inclusive": "{count, plural, one {Set must contain more than {count} item} other {Set must contain more than {count} items}}"
|
|
160
|
+
},
|
|
161
|
+
"string": {
|
|
162
|
+
"exact": "{count, plural, one {String must contain exactly {count} character} other {String must contain exactly {count} characters}}",
|
|
163
|
+
"inclusive": "{count, plural, one {String must contain at least {count} character} other {String must contain at least {count} characters}}",
|
|
164
|
+
"not_inclusive": "{count, plural, one {String must contain more than {count} character} other {String must contain more than {count} characters}}"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"unrecognized_keys": "{count, plural, one {Unrecognized key in object: {keys}} other {Unrecognized keys in object: {keys}}}"
|
|
168
|
+
},
|
|
169
|
+
"formats": {
|
|
170
|
+
"base64": "base64-encoded string",
|
|
171
|
+
"base64url": "base64url-encoded string",
|
|
172
|
+
"cidrv4": "IPv4 range",
|
|
173
|
+
"cidrv6": "IPv6 range",
|
|
174
|
+
"credit_card": "credit card number",
|
|
175
|
+
"cuid": "cuid",
|
|
176
|
+
"cuid2": "cuid2",
|
|
177
|
+
"currency_code": "currency code",
|
|
178
|
+
"date": "ISO date",
|
|
179
|
+
"datetime": "ISO datetime",
|
|
180
|
+
"duration": "ISO duration",
|
|
181
|
+
"e164": "E.164 phone number",
|
|
182
|
+
"email": "email address",
|
|
183
|
+
"emoji": "emoji",
|
|
184
|
+
"guid": "GUID",
|
|
185
|
+
"hash": "hash",
|
|
186
|
+
"hex": "hexadecimal string",
|
|
187
|
+
"hostname": "hostname",
|
|
188
|
+
"iban": "IBAN",
|
|
189
|
+
"ipv4": "IPv4 address",
|
|
190
|
+
"ipv6": "IPv6 address",
|
|
191
|
+
"json_string": "JSON string",
|
|
192
|
+
"jwt": "JWT",
|
|
193
|
+
"ksuid": "KSUID",
|
|
194
|
+
"mac": "MAC address",
|
|
195
|
+
"nanoid": "nanoid",
|
|
196
|
+
"template_literal": "input",
|
|
197
|
+
"time": "ISO time",
|
|
198
|
+
"ulid": "ULID",
|
|
199
|
+
"url": "URL",
|
|
200
|
+
"uuid": "UUID",
|
|
201
|
+
"xid": "XID"
|
|
202
|
+
},
|
|
203
|
+
"types": {
|
|
204
|
+
"array": "array",
|
|
205
|
+
"bigint": "bigint",
|
|
206
|
+
"boolean": "boolean",
|
|
207
|
+
"date": "date",
|
|
208
|
+
"file": "file",
|
|
209
|
+
"function": "function",
|
|
210
|
+
"int": "integer",
|
|
211
|
+
"map": "map",
|
|
212
|
+
"nan": "NaN",
|
|
213
|
+
"never": "never",
|
|
214
|
+
"null": "null",
|
|
215
|
+
"number": "number",
|
|
216
|
+
"object": "object",
|
|
217
|
+
"promise": "promise",
|
|
218
|
+
"record": "record",
|
|
219
|
+
"set": "set",
|
|
220
|
+
"string": "string",
|
|
221
|
+
"symbol": "symbol",
|
|
222
|
+
"tuple": "tuple",
|
|
223
|
+
"undefined": "undefined",
|
|
224
|
+
"void": "void"
|
|
225
|
+
}
|
|
226
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
{
|
|
2
|
+
"custom": {
|
|
3
|
+
"banner": {
|
|
4
|
+
"link": "Los enlaces de los avisos deben usar HTTP o HTTPS"
|
|
5
|
+
},
|
|
6
|
+
"dates": {
|
|
7
|
+
"event_id": "Debe contener letras mayúsculas, números o guiones bajos",
|
|
8
|
+
"overlap": "No se pueden añadir y eliminar fechas en la misma solicitud: {dates}",
|
|
9
|
+
"period_name": "Introduzca un nombre para el período",
|
|
10
|
+
"period_required": "Seleccione un período"
|
|
11
|
+
},
|
|
12
|
+
"documents": {
|
|
13
|
+
"changes_required": "multiple_fields requiere el array metadata.changes",
|
|
14
|
+
"different_values": "curr_value y prev_value deben ser diferentes",
|
|
15
|
+
"null_values": "multiple_fields debe tener curr_value y prev_value nulos"
|
|
16
|
+
},
|
|
17
|
+
"feedback": {
|
|
18
|
+
"duplicate_reason": "El motivo «{reason}» no puede seleccionarse más de una vez.",
|
|
19
|
+
"reason": "El motivo «{reason}» no es válido para comentarios de {entity}."
|
|
20
|
+
},
|
|
21
|
+
"formats": {
|
|
22
|
+
"date": "Se esperaba una fecha con el formato {format}",
|
|
23
|
+
"hex_color": "Se esperaba un color hexadecimal con el formato {format}",
|
|
24
|
+
"hhmm": "Se esperaba una hora con el formato {format} entre {minimum} y {maximum}",
|
|
25
|
+
"operational_date": "Se esperaba una fecha con el formato {format} o {alternative}",
|
|
26
|
+
"operational_time": "Se esperaba una hora con el formato {format}, con minutos y segundos entre 00 y 59",
|
|
27
|
+
"unix_milliseconds": "Se esperaba una marca de tiempo Unix válida en milisegundos, como mínimo {minimum}",
|
|
28
|
+
"unix_seconds": "Se esperaba una marca de tiempo Unix válida en segundos, como mínimo {minimum}"
|
|
29
|
+
},
|
|
30
|
+
"geo": {
|
|
31
|
+
"coordinate": "Coordenada no válida",
|
|
32
|
+
"encoded_polyline": "Polilínea codificada no válida",
|
|
33
|
+
"latitude": "La latitud debe estar entre {minimum} y {maximum}",
|
|
34
|
+
"linear_ring": "El primer y el último punto de un anillo deben coincidir",
|
|
35
|
+
"longitude": "La longitud debe estar entre {minimum} y {maximum}"
|
|
36
|
+
},
|
|
37
|
+
"network": {
|
|
38
|
+
"agency_required": "Se requiere al menos un identificador de agencia",
|
|
39
|
+
"anchor": "Un anclaje debe identificar ambos extremos de un segmento del recorrido.",
|
|
40
|
+
"default_required": "Es obligatorio un parámetro «default».",
|
|
41
|
+
"default_unique": "Solo se permite un parámetro «default».",
|
|
42
|
+
"parameters_path": "Los parámetros de tiempo de viaje deben coincidir con cada ocurrencia del recorrido en orden.",
|
|
43
|
+
"path_ids": "Los identificadores de las ocurrencias del recorrido deben ser únicos.",
|
|
44
|
+
"shape_distances": "Las distancias del trazado no deben disminuir a lo largo del recorrido.",
|
|
45
|
+
"shape_sequences": "Las secuencias de puntos del trazado deben ser únicas.",
|
|
46
|
+
"stop_distances": "Las distancias de las paradas no deben disminuir a lo largo del recorrido.",
|
|
47
|
+
"stop_sequences": "Las secuencias de paradas deben ser únicas.",
|
|
48
|
+
"weekdays": "Seleccione al menos un día de la semana.",
|
|
49
|
+
"year_periods": "Seleccione al menos un período del año."
|
|
50
|
+
},
|
|
51
|
+
"password": {
|
|
52
|
+
"lowercase": "La contraseña debe contener al menos una letra minúscula",
|
|
53
|
+
"min_length": "La contraseña debe tener al menos {minimum} caracteres",
|
|
54
|
+
"mismatch": "Las contraseñas no coinciden",
|
|
55
|
+
"number": "La contraseña debe contener al menos un número",
|
|
56
|
+
"requirements": "Requisitos de la contraseña",
|
|
57
|
+
"special": "La contraseña debe contener al menos un carácter especial",
|
|
58
|
+
"uppercase": "La contraseña debe contener al menos una letra mayúscula"
|
|
59
|
+
},
|
|
60
|
+
"schedule": {
|
|
61
|
+
"active_period": "La fecha final del período activo debe ser igual o posterior a la inicial",
|
|
62
|
+
"end_after_start": "El final debe ser posterior al inicio",
|
|
63
|
+
"publication": "La fecha final de publicación debe ser igual o posterior a la inicial"
|
|
64
|
+
},
|
|
65
|
+
"unique": {
|
|
66
|
+
"changelog_items": "Los identificadores de cambios deben ser únicos dentro de un registro",
|
|
67
|
+
"module_ids": "Los identificadores de módulos deben ser únicos",
|
|
68
|
+
"release_ids": "Los identificadores de versión deben ser únicos"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"errors": {
|
|
72
|
+
"custom": "Valor no válido",
|
|
73
|
+
"invalid_element": "Elemento no válido en el valor de tipo {origin}",
|
|
74
|
+
"invalid_format": {
|
|
75
|
+
"default": "Formato de {format} no válido",
|
|
76
|
+
"ends_with": "Debe terminar en \"{suffix}\"",
|
|
77
|
+
"includes": "Debe incluir \"{includes}\"",
|
|
78
|
+
"lowercase": "Debe estar en minúsculas",
|
|
79
|
+
"regex": "Formato no válido",
|
|
80
|
+
"starts_with": "Debe empezar por \"{prefix}\"",
|
|
81
|
+
"uppercase": "Debe estar en mayúsculas"
|
|
82
|
+
},
|
|
83
|
+
"invalid_key": "Clave no válida en el valor de tipo {origin}",
|
|
84
|
+
"invalid_type": "El valor debe ser de tipo {expected} (tipo recibido: {received})",
|
|
85
|
+
"invalid_type_received_null": "El valor debe ser de tipo {expected} (tipo recibido: {received})",
|
|
86
|
+
"invalid_type_received_undefined": "Este campo es obligatorio",
|
|
87
|
+
"invalid_union": "Valor no válido",
|
|
88
|
+
"invalid_union_discriminator": "El valor debe ser uno de los siguientes: {options}",
|
|
89
|
+
"invalid_union_type": "Se esperaba {expected}",
|
|
90
|
+
"invalid_value": "El valor debe ser uno de los siguientes: {options}",
|
|
91
|
+
"invalid_value_single": "El valor debe ser {expected}",
|
|
92
|
+
"not_multiple_of": "El número debe ser múltiplo de {divisor}",
|
|
93
|
+
"too_big": {
|
|
94
|
+
"array": {
|
|
95
|
+
"exact": "{count, plural, one {La lista debe contener exactamente {count} elemento} many {La lista debe contener exactamente {count} elementos} other {La lista debe contener exactamente {count} elementos}}",
|
|
96
|
+
"inclusive": "{count, plural, one {La lista debe contener como máximo {count} elemento} many {La lista debe contener como máximo {count} elementos} other {La lista debe contener como máximo {count} elementos}}",
|
|
97
|
+
"not_inclusive": "{count, plural, one {La lista debe contener menos de {count} elemento} many {La lista debe contener menos de {count} elementos} other {La lista debe contener menos de {count} elementos}}"
|
|
98
|
+
},
|
|
99
|
+
"date": {
|
|
100
|
+
"exact": "La fecha debe ser el {maximum, date}",
|
|
101
|
+
"inclusive": "La fecha debe ser igual o anterior al {maximum, date}",
|
|
102
|
+
"not_inclusive": "La fecha debe ser anterior al {maximum, date}"
|
|
103
|
+
},
|
|
104
|
+
"file": {
|
|
105
|
+
"exact": "{count, plural, one {El archivo debe tener exactamente {count} byte} many {El archivo debe tener exactamente {count} bytes} other {El archivo debe tener exactamente {count} bytes}}",
|
|
106
|
+
"inclusive": "{count, plural, one {El archivo debe tener como máximo {count} byte} many {El archivo debe tener como máximo {count} bytes} other {El archivo debe tener como máximo {count} bytes}}",
|
|
107
|
+
"not_inclusive": "{count, plural, one {El archivo debe tener menos de {count} byte} many {El archivo debe tener menos de {count} bytes} other {El archivo debe tener menos de {count} bytes}}"
|
|
108
|
+
},
|
|
109
|
+
"map": {
|
|
110
|
+
"exact": "{count, plural, one {El mapa debe contener exactamente {count} entrada} many {El mapa debe contener exactamente {count} entradas} other {El mapa debe contener exactamente {count} entradas}}",
|
|
111
|
+
"inclusive": "{count, plural, one {El mapa debe contener como máximo {count} entrada} many {El mapa debe contener como máximo {count} entradas} other {El mapa debe contener como máximo {count} entradas}}",
|
|
112
|
+
"not_inclusive": "{count, plural, one {El mapa debe contener menos de {count} entrada} many {El mapa debe contener menos de {count} entradas} other {El mapa debe contener menos de {count} entradas}}"
|
|
113
|
+
},
|
|
114
|
+
"number": {
|
|
115
|
+
"exact": "El número debe ser exactamente {maximum}",
|
|
116
|
+
"inclusive": "El número debe ser menor o igual que {maximum}",
|
|
117
|
+
"not_inclusive": "El número debe ser menor que {maximum}"
|
|
118
|
+
},
|
|
119
|
+
"set": {
|
|
120
|
+
"exact": "{count, plural, one {El conjunto debe contener exactamente {count} elemento} many {El conjunto debe contener exactamente {count} elementos} other {El conjunto debe contener exactamente {count} elementos}}",
|
|
121
|
+
"inclusive": "{count, plural, one {El conjunto debe contener como máximo {count} elemento} many {El conjunto debe contener como máximo {count} elementos} other {El conjunto debe contener como máximo {count} elementos}}",
|
|
122
|
+
"not_inclusive": "{count, plural, one {El conjunto debe contener menos de {count} elemento} many {El conjunto debe contener menos de {count} elementos} other {El conjunto debe contener menos de {count} elementos}}"
|
|
123
|
+
},
|
|
124
|
+
"string": {
|
|
125
|
+
"exact": "{count, plural, one {El texto debe contener exactamente {count} carácter} many {El texto debe contener exactamente {count} caracteres} other {El texto debe contener exactamente {count} caracteres}}",
|
|
126
|
+
"inclusive": "{count, plural, one {El texto debe contener como máximo {count} carácter} many {El texto debe contener como máximo {count} caracteres} other {El texto debe contener como máximo {count} caracteres}}",
|
|
127
|
+
"not_inclusive": "{count, plural, one {El texto debe contener menos de {count} carácter} many {El texto debe contener menos de {count} caracteres} other {El texto debe contener menos de {count} caracteres}}"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"too_small": {
|
|
131
|
+
"array": {
|
|
132
|
+
"exact": "{count, plural, one {La lista debe contener exactamente {count} elemento} many {La lista debe contener exactamente {count} elementos} other {La lista debe contener exactamente {count} elementos}}",
|
|
133
|
+
"inclusive": "{count, plural, one {La lista debe contener al menos {count} elemento} many {La lista debe contener al menos {count} elementos} other {La lista debe contener al menos {count} elementos}}",
|
|
134
|
+
"not_inclusive": "{count, plural, one {La lista debe contener más de {count} elemento} many {La lista debe contener más de {count} elementos} other {La lista debe contener más de {count} elementos}}"
|
|
135
|
+
},
|
|
136
|
+
"date": {
|
|
137
|
+
"exact": "La fecha debe ser el {minimum, date}",
|
|
138
|
+
"inclusive": "La fecha debe ser igual o posterior al {minimum, date}",
|
|
139
|
+
"not_inclusive": "La fecha debe ser posterior al {minimum, date}"
|
|
140
|
+
},
|
|
141
|
+
"file": {
|
|
142
|
+
"exact": "{count, plural, one {El archivo debe tener exactamente {count} byte} many {El archivo debe tener exactamente {count} bytes} other {El archivo debe tener exactamente {count} bytes}}",
|
|
143
|
+
"inclusive": "{count, plural, one {El archivo debe tener al menos {count} byte} many {El archivo debe tener al menos {count} bytes} other {El archivo debe tener al menos {count} bytes}}",
|
|
144
|
+
"not_inclusive": "{count, plural, one {El archivo debe tener más de {count} byte} many {El archivo debe tener más de {count} bytes} other {El archivo debe tener más de {count} bytes}}"
|
|
145
|
+
},
|
|
146
|
+
"map": {
|
|
147
|
+
"exact": "{count, plural, one {El mapa debe contener exactamente {count} entrada} many {El mapa debe contener exactamente {count} entradas} other {El mapa debe contener exactamente {count} entradas}}",
|
|
148
|
+
"inclusive": "{count, plural, one {El mapa debe contener al menos {count} entrada} many {El mapa debe contener al menos {count} entradas} other {El mapa debe contener al menos {count} entradas}}",
|
|
149
|
+
"not_inclusive": "{count, plural, one {El mapa debe contener más de {count} entrada} many {El mapa debe contener más de {count} entradas} other {El mapa debe contener más de {count} entradas}}"
|
|
150
|
+
},
|
|
151
|
+
"number": {
|
|
152
|
+
"exact": "El número debe ser exactamente {minimum}",
|
|
153
|
+
"inclusive": "El número debe ser mayor o igual que {minimum}",
|
|
154
|
+
"not_inclusive": "El número debe ser mayor que {minimum}"
|
|
155
|
+
},
|
|
156
|
+
"set": {
|
|
157
|
+
"exact": "{count, plural, one {El conjunto debe contener exactamente {count} elemento} many {El conjunto debe contener exactamente {count} elementos} other {El conjunto debe contener exactamente {count} elementos}}",
|
|
158
|
+
"inclusive": "{count, plural, one {El conjunto debe contener al menos {count} elemento} many {El conjunto debe contener al menos {count} elementos} other {El conjunto debe contener al menos {count} elementos}}",
|
|
159
|
+
"not_inclusive": "{count, plural, one {El conjunto debe contener más de {count} elemento} many {El conjunto debe contener más de {count} elementos} other {El conjunto debe contener más de {count} elementos}}"
|
|
160
|
+
},
|
|
161
|
+
"string": {
|
|
162
|
+
"exact": "{count, plural, one {El texto debe contener exactamente {count} carácter} many {El texto debe contener exactamente {count} caracteres} other {El texto debe contener exactamente {count} caracteres}}",
|
|
163
|
+
"inclusive": "{count, plural, one {El texto debe contener al menos {count} carácter} many {El texto debe contener al menos {count} caracteres} other {El texto debe contener al menos {count} caracteres}}",
|
|
164
|
+
"not_inclusive": "{count, plural, one {El texto debe contener más de {count} carácter} many {El texto debe contener más de {count} caracteres} other {El texto debe contener más de {count} caracteres}}"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"unrecognized_keys": "{count, plural, one {Clave no reconocida: {keys}} many {Claves no reconocidas: {keys}} other {Claves no reconocidas: {keys}}}"
|
|
168
|
+
},
|
|
169
|
+
"formats": {
|
|
170
|
+
"base64": "texto codificado en base64",
|
|
171
|
+
"base64url": "texto codificado en base64url",
|
|
172
|
+
"cidrv4": "rango IPv4",
|
|
173
|
+
"cidrv6": "rango IPv6",
|
|
174
|
+
"credit_card": "número de tarjeta de crédito",
|
|
175
|
+
"cuid": "cuid",
|
|
176
|
+
"cuid2": "cuid2",
|
|
177
|
+
"currency_code": "código de moneda",
|
|
178
|
+
"date": "fecha ISO",
|
|
179
|
+
"datetime": "fecha y hora ISO",
|
|
180
|
+
"duration": "duración ISO",
|
|
181
|
+
"e164": "número de teléfono E.164",
|
|
182
|
+
"email": "dirección de correo electrónico",
|
|
183
|
+
"emoji": "emoji",
|
|
184
|
+
"guid": "GUID",
|
|
185
|
+
"hash": "hash",
|
|
186
|
+
"hex": "texto hexadecimal",
|
|
187
|
+
"hostname": "nombre de host",
|
|
188
|
+
"iban": "IBAN",
|
|
189
|
+
"ipv4": "dirección IPv4",
|
|
190
|
+
"ipv6": "dirección IPv6",
|
|
191
|
+
"json_string": "texto JSON",
|
|
192
|
+
"jwt": "JWT",
|
|
193
|
+
"ksuid": "KSUID",
|
|
194
|
+
"mac": "dirección MAC",
|
|
195
|
+
"nanoid": "nanoid",
|
|
196
|
+
"template_literal": "valor",
|
|
197
|
+
"time": "hora ISO",
|
|
198
|
+
"ulid": "ULID",
|
|
199
|
+
"url": "URL",
|
|
200
|
+
"uuid": "UUID",
|
|
201
|
+
"xid": "XID"
|
|
202
|
+
},
|
|
203
|
+
"types": {
|
|
204
|
+
"array": "lista",
|
|
205
|
+
"bigint": "entero grande",
|
|
206
|
+
"boolean": "booleano",
|
|
207
|
+
"date": "fecha",
|
|
208
|
+
"file": "archivo",
|
|
209
|
+
"function": "función",
|
|
210
|
+
"int": "número entero",
|
|
211
|
+
"map": "mapa",
|
|
212
|
+
"nan": "NaN",
|
|
213
|
+
"never": "never",
|
|
214
|
+
"null": "nulo",
|
|
215
|
+
"number": "número",
|
|
216
|
+
"object": "objeto",
|
|
217
|
+
"promise": "promesa",
|
|
218
|
+
"record": "objeto",
|
|
219
|
+
"set": "conjunto",
|
|
220
|
+
"string": "texto",
|
|
221
|
+
"symbol": "símbolo",
|
|
222
|
+
"tuple": "tupla",
|
|
223
|
+
"undefined": "indefinido",
|
|
224
|
+
"void": "void"
|
|
225
|
+
}
|
|
226
|
+
}
|