Skip to content

Commit

Permalink
feat: add es (spanish) locale
Browse files Browse the repository at this point in the history
* feat: add es (spanish) locale

* feat: updated es locale and added tests

* feat: updated es locale, es test and added es locale to with-next-i18next
  • Loading branch information
Arturo-Lopez authored Dec 18, 2022
1 parent 53d3ca9 commit 83afe58
Show file tree
Hide file tree
Showing 6 changed files with 432 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/with-next-i18next/next-i18next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require("path");
module.exports = {
i18n: {
defaultLocale: "en",
locales: ["en", "ja", "fr", "ar", "pt", "zh-CN", "is"],
locales: ["en", "ja", "fr", "ar", "pt", "zh-CN", "is", "es"],
},
localePath: path.resolve("./public/locales"),
interpolation: {
Expand Down
1 change: 1 addition & 0 deletions examples/with-next-i18next/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export default function HookForm() {
borderLeftRadius={0}
>
<option value="ar">العربية</option>
<option value="es">Spanish</option>
<option value="en">English</option>
<option value="fr">Français</option>
<option value="is">Icelandic</option>
Expand Down
7 changes: 7 additions & 0 deletions examples/with-next-i18next/public/locales/es/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"User name": "Nombre de usuario",
"John Doe": "John Doe",
"Email": "Correo",
"Favorite number": "Número favorito",
"Submit": "Enviar"
}
112 changes: 112 additions & 0 deletions examples/with-next-i18next/public/locales/es/zod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"errors": {
"invalid_type": "Esperado {{expected}}, recibido {{received}}",
"invalid_type_received_undefined": "Requerido",
"invalid_literal": "Valor literal inválido, era esperado {{expected}}",
"unrecognized_keys": "Llave(s) no reconocida(s) en el objeto: {{- keys}}",
"invalid_union": "Entrada inválida",
"invalid_union_discriminator": "Valor discriminador inválido. Era esperado {{- options}}",
"invalid_enum_value": "Valor de enum inválido. Era esperado {{- options}}, fue recibido '{{received}}'",
"invalid_arguments": "Argumentos de función inválido",
"invalid_return_type": "Tipo de retorno de función inválido",
"invalid_date": "Fecha inválida",
"custom": "Entrada inválida",
"invalid_intersection_types": "Valores de intersección no pudieron ser mezclados",
"not_multiple_of": "Número debe ser multiplo de {{multipleOf}}",
"not_finite": "Número no puede ser infinito",
"invalid_string": {
"email": "{{validation}} inválido",
"url": "{{validation}} inválida",
"uuid": "{{validation}} inválido",
"cuid": "{{validation}} inválido",
"regex": "Inválido",
"datetime": "{{validation}} inválido",
"startsWith": "Entrada inválida: debe comenzar con \"{{startsWith}}\"",
"endsWith": "Entrada inválida: debe finalizar con \"{{endsWith}}\""
},
"too_small": {
"array": {
"exact": "El array debe contener exactamente {{minimum}} elemento(s)",
"inclusive": "El array debe contener al menos {{minimum}} elemento(s)",
"not_inclusive": "El array debe contener más de {{minimum}} elemento(s)"
},
"string": {
"exact": "El texto debe contener exactamente {{minimum}} carácter(es)",
"inclusive": "El texto debe contener al menos {{minimum}} carácter(es)",
"not_inclusive": "El texto debe contener más de {{minimum}} carácter(es)"
},
"number": {
"exact": "El número debe ser exactamente {{minimum}}",
"inclusive": "El número debe ser mayor o igual a {{minimum}}",
"not_inclusive": "El número debe ser mayor a {{minimum}}"
},
"set": {
"exact": "Entrada inválida",
"inclusive": "Entrada inválida",
"not_inclusive": "Entrada inválida"
},
"date": {
"exact": "La fecha debe ser exactamente {{- minimum, datetime}}",
"inclusive": "La fecha debe ser mayor o igual a {{- minimum, datetime}}",
"not_inclusive": "La fecha debe ser mayor a {{- minimum, datetime}}"
}
},
"too_big": {
"array": {
"exact": "El array debe contener exactamente {{maximum}} elemento(s)",
"inclusive": "El array debe contener como máximo {{maximum}} elemento(s)",
"not_inclusive": "El array debe contener menos que {{maximum}} elemento(s)"
},
"string": {
"exact": "El texto debe contener exactamente {{maximum}} carácter(es)",
"inclusive": "El texto debe contener como máximo {{maximum}} carácter(es)",
"not_inclusive": "El texto debe contener menos que {{maximum}} carácter(es)"
},
"number": {
"exact": "El número debe ser exactamente {{maximum}}",
"inclusive": "El número debe ser menor o igual a {{maximum}}",
"not_inclusive": "El número debe ser menor a {{maximum}}"
},
"set": {
"exact": "Entrada inválida",
"inclusive": "Entrada inválida",
"not_inclusive": "Entrada inválida"
},
"date": {
"exact": "La fecha debe ser exactamente {{- maximum, datetime}}",
"inclusive": "La fecha debe ser menor o igual a {{- maximum, datetime}}",
"not_inclusive": "La fecha debe ser menor a {{- maximum, datetime}}"
}
}
},
"validations": {
"email": "correo",
"url": "url",
"uuid": "uuid",
"cuid": "cuid",
"regex": "expresión regular",
"datetime": "datetime"
},
"types": {
"function": "function",
"number": "number",
"string": "string",
"nan": "nan",
"integer": "integer",
"float": "float",
"boolean": "boolean",
"date": "date",
"bigint": "bigint",
"undefined": "undefined",
"symbol": "symbol",
"null": "null",
"array": "array",
"object": "object",
"unknown": "unknown",
"promise": "promise",
"void": "void",
"never": "never",
"map": "map",
"set": "set"
}
}
112 changes: 112 additions & 0 deletions packages/core/locales/es/zod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"errors": {
"invalid_type": "Esperado {{expected}}, recibido {{received}}",
"invalid_type_received_undefined": "Requerido",
"invalid_literal": "Valor literal inválido, era esperado {{expected}}",
"unrecognized_keys": "Llave(s) no reconocida(s) en el objeto: {{- keys}}",
"invalid_union": "Entrada inválida",
"invalid_union_discriminator": "Valor discriminador inválido. Era esperado {{- options}}",
"invalid_enum_value": "Valor de enum inválido. Era esperado {{- options}}, fue recibido '{{received}}'",
"invalid_arguments": "Argumentos de función inválido",
"invalid_return_type": "Tipo de retorno de función inválido",
"invalid_date": "Fecha inválida",
"custom": "Entrada inválida",
"invalid_intersection_types": "Valores de intersección no pudieron ser mezclados",
"not_multiple_of": "Número debe ser multiplo de {{multipleOf}}",
"not_finite": "Número no puede ser infinito",
"invalid_string": {
"email": "{{validation}} inválido",
"url": "{{validation}} inválida",
"uuid": "{{validation}} inválido",
"cuid": "{{validation}} inválido",
"regex": "Inválido",
"datetime": "{{validation}} inválido",
"startsWith": "Entrada inválida: debe comenzar con \"{{startsWith}}\"",
"endsWith": "Entrada inválida: debe finalizar con \"{{endsWith}}\""
},
"too_small": {
"array": {
"exact": "El array debe contener exactamente {{minimum}} elemento(s)",
"inclusive": "El array debe contener al menos {{minimum}} elemento(s)",
"not_inclusive": "El array debe contener más de {{minimum}} elemento(s)"
},
"string": {
"exact": "El texto debe contener exactamente {{minimum}} carácter(es)",
"inclusive": "El texto debe contener al menos {{minimum}} carácter(es)",
"not_inclusive": "El texto debe contener más de {{minimum}} carácter(es)"
},
"number": {
"exact": "El número debe ser exactamente {{minimum}}",
"inclusive": "El número debe ser mayor o igual a {{minimum}}",
"not_inclusive": "El número debe ser mayor a {{minimum}}"
},
"set": {
"exact": "Entrada inválida",
"inclusive": "Entrada inválida",
"not_inclusive": "Entrada inválida"
},
"date": {
"exact": "La fecha debe ser exactamente {{- minimum, datetime}}",
"inclusive": "La fecha debe ser mayor o igual a {{- minimum, datetime}}",
"not_inclusive": "La fecha debe ser mayor a {{- minimum, datetime}}"
}
},
"too_big": {
"array": {
"exact": "El array debe contener exactamente {{maximum}} elemento(s)",
"inclusive": "El array debe contener como máximo {{maximum}} elemento(s)",
"not_inclusive": "El array debe contener menos que {{maximum}} elemento(s)"
},
"string": {
"exact": "El texto debe contener exactamente {{maximum}} carácter(es)",
"inclusive": "El texto debe contener como máximo {{maximum}} carácter(es)",
"not_inclusive": "El texto debe contener menos que {{maximum}} carácter(es)"
},
"number": {
"exact": "El número debe ser exactamente {{maximum}}",
"inclusive": "El número debe ser menor o igual a {{maximum}}",
"not_inclusive": "El número debe ser menor a {{maximum}}"
},
"set": {
"exact": "Entrada inválida",
"inclusive": "Entrada inválida",
"not_inclusive": "Entrada inválida"
},
"date": {
"exact": "La fecha debe ser exactamente {{- maximum, datetime}}",
"inclusive": "La fecha debe ser menor o igual a {{- maximum, datetime}}",
"not_inclusive": "La fecha debe ser menor a {{- maximum, datetime}}"
}
}
},
"validations": {
"email": "correo",
"url": "url",
"uuid": "uuid",
"cuid": "cuid",
"regex": "expresión regular",
"datetime": "datetime"
},
"types": {
"function": "function",
"number": "number",
"string": "string",
"nan": "nan",
"integer": "integer",
"float": "float",
"boolean": "boolean",
"date": "date",
"bigint": "bigint",
"undefined": "undefined",
"symbol": "symbol",
"null": "null",
"array": "array",
"object": "object",
"unknown": "unknown",
"promise": "promise",
"void": "void",
"never": "never",
"map": "map",
"set": "set"
}
}
Loading

1 comment on commit 83afe58

@vercel
Copy link

@vercel vercel bot commented on 83afe58 Dec 18, 2022

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.vercel.app
zod-i18n-aiji42.vercel.app
zod-i18n-git-main-aiji42.vercel.app

Please sign in to comment.