Skip to content

Commit

Permalink
Merge pull request #178 from andersonba/main
Browse files Browse the repository at this point in the history
feat: improve "pt" terms for clarity
  • Loading branch information
aiji42 authored Oct 24, 2023
2 parents 3332601 + 7c8ab80 commit 31bff8b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
24 changes: 12 additions & 12 deletions packages/core/locales/pt/zod.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
},
"too_small": {
"array": {
"exact": "Array deve conter exatamente {{minimum}} elemento(s)",
"inclusive": "Array deve conter no mínimo {{minimum}} elemento(s)",
"not_inclusive": "Array deve conter mais de {{minimum}} elemento(s)"
"exact": "Lista deve conter exatamente {{minimum}} elemento(s)",
"inclusive": "Lista deve conter no mínimo {{minimum}} elemento(s)",
"not_inclusive": "Lista deve conter mais de {{minimum}} elemento(s)"
},
"string": {
"exact": "String deve conter exatamente {{minimum}} caracter(es)",
"inclusive": "String deve conter pelo menos {{minimum}} caracter(es)",
"not_inclusive": "String deve conter mais de {{minimum}} caracter(es)"
"exact": "Texto deve conter exatamente {{minimum}} caracter(es)",
"inclusive": "Texto deve conter pelo menos {{minimum}} caracter(es)",
"not_inclusive": "Texto deve conter mais de {{minimum}} caracter(es)"
},
"number": {
"exact": "Número deve conter exatamente {{minimum}} caracter(es)",
Expand All @@ -53,14 +53,14 @@
},
"too_big": {
"array": {
"exact": "Array deve conter exatamente {{maximum}} elemento(s)",
"inclusive": "Array deve conter no máximo {{maximum}} elemento(s)",
"not_inclusive": "Array deve conter menos de {{maximum}} elemento(s)"
"exact": "Lista deve conter exatamente {{maximum}} elemento(s)",
"inclusive": "Lista deve conter no máximo {{maximum}} elemento(s)",
"not_inclusive": "Lista deve conter menos de {{maximum}} elemento(s)"
},
"string": {
"exact": "String deve conter exatamente {{maximum}} caracter(es)",
"inclusive": "String pode conter no máximo {{maximum}} caracter(es)",
"not_inclusive": "String deve conter menos que {{maximum}} caracter(es)"
"exact": "Texto deve conter exatamente {{maximum}} caracter(es)",
"inclusive": "Texto pode conter no máximo {{maximum}} caracter(es)",
"not_inclusive": "Texto deve conter menos que {{maximum}} caracter(es)"
},
"number": {
"exact": "Número deve conter exatamente {{maximum}} caracter(es)",
Expand Down
14 changes: 7 additions & 7 deletions packages/core/tests/integrations/pt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ test("string parser error messages", () => {
'Entrada inválida: deve terminar com "bar"'
);
expect(getErrorMessage(schema.length(5).safeParse("abcdef"))).toEqual(
"String deve conter exatamente 5 caracter(es)"
"Texto deve conter exatamente 5 caracter(es)"
);
expect(getErrorMessage(schema.min(5).safeParse("a"))).toEqual(
"String deve conter pelo menos 5 caracter(es)"
"Texto deve conter pelo menos 5 caracter(es)"
);
expect(getErrorMessage(schema.max(5).safeParse("abcdef"))).toEqual(
"String pode conter no máximo 5 caracter(es)"
"Texto pode conter no máximo 5 caracter(es)"
);
// TODO: translation `datetime` (zod:validations.datetime and zod:errors.invalid_string.datetime)
expect(
Expand Down Expand Up @@ -134,16 +134,16 @@ test("array parser error messages", () => {
"O dado deve ser do tipo array, porém foi enviado string"
);
expect(getErrorMessage(schema.length(2).safeParse([]))).toEqual(
"Array deve conter exatamente 2 elemento(s)"
"Lista deve conter exatamente 2 elemento(s)"
);
expect(getErrorMessage(schema.min(5).safeParse([""]))).toEqual(
"Array deve conter no mínimo 5 elemento(s)"
"Lista deve conter no mínimo 5 elemento(s)"
);
expect(getErrorMessage(schema.max(2).safeParse(["", "", ""]))).toEqual(
"Array deve conter no máximo 2 elemento(s)"
"Lista deve conter no máximo 2 elemento(s)"
);
expect(getErrorMessage(schema.nonempty().safeParse([]))).toEqual(
"Array deve conter no mínimo 1 elemento(s)"
"Lista deve conter no mínimo 1 elemento(s)"
);
});

Expand Down

1 comment on commit 31bff8b

@vercel
Copy link

@vercel vercel bot commented on 31bff8b Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zod-i18n – ./

zod-i18n-aiji42.vercel.app
zod-i18n.vercel.app
zod-i18n-git-main-aiji42.vercel.app

Please sign in to comment.