Skip to content

Instantly share code, notes, and snippets.

@max10rogerio
Last active August 23, 2023 17:43
Show Gist options
  • Star 30 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save max10rogerio/23a74006a1c1c91443b543979d4377fc to your computer and use it in GitHub Desktop.
Save max10rogerio/23a74006a1c1c91443b543979d4377fc to your computer and use it in GitHub Desktop.
Translation of the main messages from the Yup library into the Pt-Br language.
/* eslint-disable */
// For more infos, see: https://github.com/jquense/yup/blob/master/src/locale.js
import { setLocale } from 'yup'
const translation = {
mixed: {
default: '${path} é inválido',
required: '${path} é um campo obrigatório',
oneOf: '${path} deve ser um dos seguintes valores: ${values}',
notOneOf: '${path} não pode ser um dos seguintes valores: ${values}',
},
string: {
length: '${path} deve ter exatamente ${length} caracteres',
min: '${path} deve ter pelo menos ${min} caracteres',
max: '${path} deve ter no máximo ${max} caracteres',
email: '${path} tem o formato de e-mail inválido',
url: '${path} deve ter um formato de URL válida',
trim: '${path} não deve conter espaços no início ou no fim.',
lowercase: '${path} deve estar em maiúsculo',
uppercase: '${path} deve estar em minúsculo',
},
number: {
min: '${path} deve ser no mínimo ${min}',
max: '${path} deve ser no máximo ${max}',
lessThan: '${path} deve ser menor que ${less}',
moreThan: '${path} deve ser maior que ${more}',
notEqual: '${path} não pode ser igual à ${notEqual}',
positive: '${path} deve ser um número positivo',
negative: '${path} deve ser um número negativo',
integer: '${path} deve ser um número inteiro',
},
date: {
min: '${path} deve ser maior que a data ${min}',
max: '${path} deve ser menor que a data ${max}',
},
array: {
min: '${path} deve ter no mínimo ${min} itens',
max: '${path} deve ter no máximo ${max} itens',
},
}
setLocale(translation)
@ReynaldoMaciel
Copy link

change data to date

@max10rogerio
Copy link
Author

Thanks man! kkk

@vitorcominato
Copy link

'${path} deve ser um número posítivo'
positivo sem acento 😄

@max10rogerio
Copy link
Author

Opa! Valeu!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment