dom-validator
Version:
Validator similar to vee-validator for vuetify Applications
144 lines (140 loc) • 9.44 kB
JavaScript
let en = {
_default: (field) => `The ${field} value is not valid.`,
alpha_dash: (field) => `The ${field} field may contain alpha-numeric characters as well as dashes and underscores.`,
alpha_num: (field) => `The ${field} field may only contain alpha-numeric characters.`,
alpha_spaces: (field) => `The ${field} field may only contain alphabetic characters as well as spaces.`,
alpha: (field) => `The ${field} field may only contain alphabetic characters.`,
between: (field, [min, max]) => `The ${field} field must be between ${min} and ${max}.`,
confirmed: (field) => `The ${field} confirmation does not match.`,
credit_card: (field) => `The ${field} field is invalid.`,
date: (field) => `The date the ${field} field is invalid`,
decimal: (field, [decimals] = ['*']) => `The ${field} field must be numeric and may contain ${!decimals || decimals === '*' ? '' : decimals} decimal points.`,
digits: (field, [length]) => `The ${field} field must be numeric and exactly contain ${length} digits.`,
dimensions: (field, [width, height]) => `The ${field} field must be ${width} pixels by ${height} pixels.`,
email: (field) => `The ${field} field must be a valid email.`,
ext: (field) => `The ${field} field must be a valid file.`,
image: (field) => `The ${field} field must be an image.`,
in: (field) => `The ${field} field must be a valid value.`,
ip: (field) => `The ${field} field must be a valid ip address.`,
max: (field, [length]) => `The ${field} field may not be greater than ${length} characters.`,
max_value: (field, [max]) => `The ${field} field must be ${max} or less.`,
mimes: (field) => `The ${field} field must have a valid file type.`,
min: (field, [length]) => `The ${field} field must be at least ${length} characters.`,
min_value: (field, [min]) => `The ${field} field must be ${min} or more.`,
not_in: (field) => `The ${field} field must be a valid value.`,
numeric: (field) => `The ${field} field may only contain numeric characters.`,
regex: (field) => `The ${field} field format is invalid.`,
required: (field) => `The ${field} field is required.`,
size: (field, [size]) => `The ${field} field must be less than ${size} KB.`,
tax_code: (field) => `The ${field} field format is invalid.`,
url: (field) => `The ${field} field is not a valid URL.`
};
let it = {
_default: (field) => `Il valore del campo ${field} è invalido.`,
alpha_dash: (field) => `Il campo ${field} deve contenere caratteri alfanumerici, - e _`,
alpha_num: (field) => `Il campo ${field} deve contenere solo caratteri alfanumerici.`,
alpha_spaces: (field) => `Il campo ${field} deve contenere solo lettere e spazi.`,
alpha: (field) => `Il campo ${field} deve contenere solo lettere.`,
between: (field, [min, max]) => `Il campo ${field} deve avere un valore tra ${min} e ${max}.`,
confirmed: (field) => `Il campo ${field} di conferma non corrisponde.`,
credit_card: (field) => `Il campo ${field} non è valido.`,
date: (field) => `La data del campo ${field} è invalida`,
decimal: (field, [decimals] = ['*']) => `Il campo ${field} deve essere numerico e contenere ${!decimals || decimals === '*' ? '' : decimals} decimali.`,
digits: (field, [length]) => `Il campo ${field} deve essere numerico ed avere ${length} cifre.`,
dimensions: (field, [width, height]) => `Il campo ${field} deve essere ${width} pixel per ${height} pixel.`,
email: (field) => `Il campo ${field} deve essere un'email valida.`,
ext: (field) => `Il campo ${field} deve essere un file valido.`,
image: (field) => `Il campo ${field} deve essere un'immagine.`,
in: (field) => `Il campo ${field} deve avere un valore valido.`,
ip: (field) => `Il campo ${field} deve essere un indirizzo IP valido.`,
max: (field, [length]) => `Il campo ${field} deve essere inferiore di ${length} caratteri.`,
max_value: (field, [max]) => `Il campo ${field} deve essere ${max} o minore.`,
mimes: (field) => `Il campo ${field} deve avere un nome file valido.`,
min: (field, [length]) => `Il campo ${field} deve essere almeno ${length} caratteri.`,
min_value: (field, [min]) => `Il campo ${field} deve essere ${min} o maggiore.`,
not_in: (field) => `Il campo ${field} deve avere un valore valido.`,
numeric: (field) => `Il campo ${field} deve contenere solo numeri.`,
regex: (field) => `Il campo ${field} deve avere un formato valido.`,
required: (field) => `Il campo ${field} è obbligatorio.`,
size: (field, [size]) => `Il campo ${field} deve essere inferiore a ${size} KB.`,
tax_code: (field) => `Il campo ${field} ha un formato errato.`,
url: (field) => `Il campo ${field} non è un URL valido.`
};
let en_xs = {
_default: (field) => `The value is not valid.`,
alpha_dash: (field) => `The field may contain alpha-numeric characters as well as dashes and underscores.`,
alpha_num: (field) => `The field may only contain alpha-numeric characters.`,
alpha_spaces: (field) => `The field may only contain alphabetic characters as well as spaces.`,
alpha: (field) => `The field may only contain alphabetic characters.`,
between: (field, [min, max]) => `The field must be between ${min} and ${max}.`,
confirmed: (field) => `The confirmation does not match.`,
credit_card: (field) => `The field is invalid.`,
date: (field) => `Invalid date`,
decimal: (field, [decimals] = ['*']) => `The field must be numeric and may contain ${!decimals || decimals === '*' ? '' : decimals} decimal points.`,
digits: (field, [length]) => `The field must be numeric and exactly contain ${length} digits.`,
dimensions: (field, [width, height]) => `The field must be ${width} pixels by ${height} pixels.`,
email: (field) => `The field must be a valid email.`,
ext: (field) => `The field must be a valid file.`,
image: (field) => `The field must be an image.`,
in: (field) => `The field must be a valid value.`,
ip: (field) => `The field must be a valid ip address.`,
max: (field, [length]) => `The field may not be greater than ${length} characters.`,
max_value: (field, [max]) => `The field must be ${max} or less.`,
mimes: (field) => `The field must have a valid file type.`,
min: (field, [length]) => `The field must be at least ${length} characters.`,
min_value: (field, [min]) => `The field must be ${min} or more.`,
not_in: (field) => `The field must be a valid value.`,
numeric: (field) => `The field may only contain numeric characters.`,
regex: (field) => `The field format is invalid.`,
required: (field) => `The field is required.`,
size: (field, [size]) => `The field must be less than ${size} KB.`,
tax_code: (field) => `The field format is invalid.`,
url: (field) => `The field is not a valid URL.`
};
let it_xs = {
_default: (field) => `Valore non valido.`,
alpha_dash: (field) => `Solo caratteri alfanumerici, - e _`,
alpha_num: (field) => `Solo caratteri alfanumerici.`,
alpha_spaces: (field) => `Solo lettere e spazi.`,
alpha: (field) => `Solo lettere.`,
between: (field, [min, max]) => `Deve essere un valore tra ${min} e ${max}.`,
between_number_of: (field, [min, max]) => `Devi selezionare tra ${min} e ${max} elementi.`,
confirmed: (field) => `Il campo di conferma non corrisponde.`,
credit_card: (field) => `Numero carta non valido.`,
date: (field) => `Data non valida`,
decimal: (field, [decimals] = ['*']) => `Deve essere un numero valido.`,
digits: (field, [length]) => `Deve essere numerico ed avere ${length} cifre.`,
dimensions: (field, [width, height]) => `Deve essere ${width} pixel per ${height} pixel.`,
email: (field) => `Deve essere un'email valida.`,
ext: (field) => `Deve essere un file valido.`,
image: (field) => `Deve essere un'immagine.`,
in: (field) => `Deve avere un valore valido.`,
in_values: (field) => `Deve essere una selezione valida.`,
ip: (field) => `Deve essere un indirizzo IP valido.`,
less_than_float: (field, [param]) => `Valore non valido.`,
match: (field, [length]) => `I campi devono essere uguali.`,
max: (field, [length]) => `Deve essere inferiore o uguale a ${length} caratteri.`,
max_number_of: (field, [length]) => `Deve selezionare minimo ${length} element.`,
max_value: (field, [max]) => `Deve essere ${max} o minore.`,
mimes: (field) => `Deve avere un nome file valido.`,
min: (field, [length]) => `Deve essere almeno ${length} caratteri.`,
min_number_of: (field, [length]) => `Deve selezionare almeni ${length} elementi.`,
min_value: (field, [min]) => `Deve essere ${min} o maggiore.`,
more_than_float: (field, [param]) => `Valore non valido.`,
not_in: (field) => `Deve avere un valore valido.`,
number_of: (field, [length]) => `Seleziona ${length} elementi.`,
numeric: (field) => `Deve contenere solo numeri.`,
password: (field) => `La password non è valida.`,
regex: (field) => `Deve avere un formato valido.`,
required: (field) => `Il campo è obbligatorio.`,
size: (field, [size]) => `Deve essere inferiore a ${size} KB.`,
tax_code: (field) => `Formato errato.`,
telephone: (field) => `Formato errato.`,
uppercase: (field) => `Il campo deve essere maiuscolo`,
url: (field) => `Non è un URL valido.`,
};
export default {
en,
it,
it_xs,
}