Skip to content

Commit

Permalink
Merge pull request #53 from aiji42/update-example
Browse files Browse the repository at this point in the history
Update example
  • Loading branch information
aiji42 authored Jan 25, 2023
2 parents 89cb63f + 83a0abb commit 9d6ca67
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ z.setErrorMap(zodI18nMap({
`zod-i18n-map` contains translation files for several locales.

- [Arabic(ar)](https://github.com/aiji42/zod-i18n/blob/main/packages/core/locales/ar/zod.json)
- [German(de)](https://github.com/aiji42/zod-i18n/blob/main/packages/core/locales/de/zod.json)
- [English(en)](https://github.com/aiji42/zod-i18n/blob/main/packages/core/locales/en/zod.json)
- [Spanish(es)](https://github.com/aiji42/zod-i18n/blob/main/packages/core/locales/es/zod.json)
- [French(fr)](https://github.com/aiji42/zod-i18n/blob/main/packages/core/locales/fr/zod.json)
Expand Down
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", "es", "nl"],
locales: ["en", "ja", "fr", "ar", "pt", "zh-CN", "is", "es", "nl", "de"],
},
localePath: path.resolve("./public/locales"),
reloadOnPrerender: true,
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 @@ -76,6 +76,7 @@ export default function HookForm() {
borderLeftRadius={0}
>
<option value="ar">العربية</option>
<option value="de">Deutsch</option>
<option value="en">English</option>
<option value="es">español</option>
<option value="fr">Français</option>
Expand Down
7 changes: 7 additions & 0 deletions examples/with-next-i18next/public/locales/de/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"username": "Nutzername",
"username_placeholder": "John Doe",
"email": "E-Mail",
"favoriteNumber": "Lieblingsnummer",
"submit": "Absenden"
}
112 changes: 112 additions & 0 deletions examples/with-next-i18next/public/locales/de/zod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"errors": {
"invalid_type": "{{expected}} erwartet, {{received}} erhalten",
"invalid_type_received_undefined": "Darf nicht leer sein",
"invalid_literal": "Ungültiger Literalwert, {{expected}} erwartet",
"unrecognized_keys": "Unbekannte Schlüssel im Objekt: {{- keys}}",
"invalid_union": "Ungültige Eingabe",
"invalid_union_discriminator": "Ungültiger Diskriminatorwert, {{- options}} erwartet",
"invalid_enum_value": "Ungültiger Enum-Wert. {{- options}} erwartet, '{{received}}' erhalten",
"invalid_arguments": "Ungültige Funktionsargumente",
"invalid_return_type": "Ungültiger Funktionsrückgabewert",
"invalid_date": "Ungültiges Datum",
"custom": "Ungültige Eingabe",
"invalid_intersection_types": "Schnittmengenergebnisse konnten nicht zusammengeführt werden",
"not_multiple_of": "Zahl muss ein Vielfaches von {{multipleOf}} sein",
"not_finite": "Zahl muss endlich sein",
"invalid_string": {
"email": "Ungültige {{validation}}",
"url": "Ungültige {{validation}}",
"uuid": "Ungültige {{validation}}",
"cuid": "Ungültige {{validation}}",
"regex": "Ungültig",
"datetime": "Ungültiger {{validation}}",
"startsWith": "Ungültige Eingabe: muss mit \"{{startsWith}}\" beginnen",
"endsWith": "Ungültige Eingabe: muss mit \"{{endsWith}}\" enden"
},
"too_small": {
"array": {
"exact": "Array muss genau {{minimum}} Element(e) enthalten",
"inclusive": "Array muss mindestens {{minimum}} Element(e) enthalten",
"not_inclusive": "Array muss mehr als {{minimum}} Element(e) enthalten"
},
"string": {
"exact": "String muss genau {{minimum}} Zeichen enthalten",
"inclusive": "String muss mindestens {{minimum}} Zeichen enthalten",
"not_inclusive": "String muss mehr als {{minimum}} Zeichen enthalten"
},
"number": {
"exact": "Zahl muss genau {{minimum}} sein",
"inclusive": "Zahl muss größer oder gleich {{minimum}} sein",
"not_inclusive": "Zahl muss größer als {{minimum}} sein"
},
"set": {
"exact": "Ungültige Eingabe",
"inclusive": "Ungültige Eingabe",
"not_inclusive": "Ungültige Eingabe"
},
"date": {
"exact": "Datum muss genau {{- minimum, datetime}} sein",
"inclusive": "Datum muss größer oder gleich {{- minimum, datetime}} sein",
"not_inclusive": "Datum muss größer als {{- minimum, datetime}} sein"
}
},
"too_big": {
"array": {
"exact": "Array muss genau {{maximum}} Element(e) enthalten",
"inclusive": "Array darf höchstens {{maximum}} Element(e) enthalten",
"not_inclusive": "Array muss weniger als {{maximum}} Element(e) enthalten"
},
"string": {
"exact": "String muss genau {{maximum}} Zeichen enthalten",
"inclusive": "String darf höchstens {{maximum}} Zeichen enthalten",
"not_inclusive": "String muss weniger als {{maximum}} Zeichen enthalten"
},
"number": {
"exact": "Zahl muss genau {{maximum}} sein",
"inclusive": "Zahl muss kleiner oder gleich {{maximum}} sein",
"not_inclusive": "Zahl muss kleiner als {{maximum}} sein"
},
"set": {
"exact": "Ungültige Eingabe",
"inclusive": "Ungültige Eingabe",
"not_inclusive": "Ungültige Eingabe"
},
"date": {
"exact": "Datum muss genau {{- maximum, datetime}} sein",
"inclusive": "Datum muss kleiner oder gleich {{- maximum, datetime}} sein",
"not_inclusive": "Datum muss kleiner als {{- maximum, datetime}} sein"
}
}
},
"validations": {
"email": "E-Mail-Adresse",
"url": "URL",
"uuid": "UUID",
"cuid": "CUID",
"regex": "Regex",
"datetime": "Datums- und Uhrzeitwert"
},
"types": {
"function": "Funktion",
"number": "Zahl",
"string": "String",
"nan": "NaN",
"integer": "Ganzzahl",
"float": "Gleitkommazahl",
"boolean": "Boolean",
"date": "Datum",
"bigint": "Bigint",
"undefined": "Undefined",
"symbol": "Symbol",
"null": "Nullwert",
"array": "Array",
"object": "Objekt",
"unknown": "Unknown",
"promise": "Promise",
"void": "Void",
"never": "Never",
"map": "Map",
"set": "Set"
}
}
1 change: 1 addition & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ z.setErrorMap(zodI18nMap({
`zod-i18n-map` contains translation files for several locales.

- [Arabic(ar)](https://github.com/aiji42/zod-i18n/blob/main/packages/core/locales/ar/zod.json)
- [German(de)](https://github.com/aiji42/zod-i18n/blob/main/packages/core/locales/de/zod.json)
- [English(en)](https://github.com/aiji42/zod-i18n/blob/main/packages/core/locales/en/zod.json)
- [Spanish(es)](https://github.com/aiji42/zod-i18n/blob/main/packages/core/locales/es/zod.json)
- [French(fr)](https://github.com/aiji42/zod-i18n/blob/main/packages/core/locales/fr/zod.json)
Expand Down

1 comment on commit 9d6ca67

@vercel
Copy link

@vercel vercel bot commented on 9d6ca67 Jan 25, 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-git-main-aiji42.vercel.app
zod-i18n.vercel.app
zod-i18n-aiji42.vercel.app

Please sign in to comment.