yup-locale-pt
v0.0.9
Published
Brazilian Portuguese Localization for Yup
Readme
Brazilian Portuguese Localization for Yup
Flavors
There are three "flavors" of translation:
ptis the default translation of Yup'slocale.jsfile. Example: 'name must be exactly 20 characters'.ptFormis optimized to be shown in form fields. It does not repeat the field name and is formatted like a sentence. Example: 'The field must be exactly 20 characters.'.ptShortis likeptForm, but shorter. Example: 'Must be exactly 20 characters.' .
Usage
Install with npm ...
npm install yup-locale-pt... or with yarn ...
yarn add yup-locale-pt... and set locale with Yup's setLocale...
import * as Yup from 'yup';
import { pt } from 'yup-locale-pt';
Yup.setLocale(pt);...or...
import * as Yup from 'yup';
import { ptForm } from 'yup-locale-pt';
Yup.setLocale(ptForm);...or...
import * as Yup from 'yup';
import { ptShort } from 'yup-locale-pt';
Yup.setLocale(ptShort);