-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[i18n] Request for internationalization (locales) #4168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Adding portuguese + fix spanish |
Adding french |
This looks good. I'm fluent in Spanish, I'll have a look, but the locales shouldn't live in a separate package? Maybe I'm wrong but it looks like we're increasing the bundle size |
Added Arabic #4176. |
Added Japanese #4170 . |
Added Hebrew #4183. |
Added Polish #4184 |
Added Ukrainian #4185 |
Added Hungarian #4186 |
Added Finnish #4188
|
Add Simplified Chinese #4189 |
@colinhacks |
Added Czech language in #4192. Hope it helps! |
Added Bahasa Indonesia #4195 |
Added italian #4194 |
Added Russian #4197 |
Added Belarusian #4199 |
Added Ottoman Turkish #4200 |
Added Malay #4204 |
Added Korean #4205 |
Added Farsi(persian) #4207 |
No problem, thank you for your help! Your version has a great natural translation. Could you take a look at my PR (#4176) and leave comments with any changes you'd suggest? That way, we can discuss them, and you can be a collaborator on this PR. |
Added Macedonian 🇲🇰 #4214 |
Added Traditional Chinese 🇹🇼🧋 #4226 |
Added Norwegian 🇳🇴 #4229 |
Added Thai 🇹🇭 #4230 |
Added Tamil #4237 |
Adding Catalan #4287 |
Adds Dutch (NL): #4425 |
Added Khmer (KH) 🇰🇭 : #4447 |
Zod 4 has a more mature system for internationalizaton. Here is an example of loading the Spanish locale:
I'm putting out an open call for locales to the Zod ecosystem. I think a human touch is important to make error messages friendly and useful.
Instructions
Refer to this pull request for an example of creating a locale: https://github.com/colinhacks/zod/pull/4158/files
To summarize:
1 Create a new file under
packages/core/src/locales/<code>.ts
Use the language code for your language. Dialects (
pt-BR
) are also encouraged.Using the English locale as a starting point, translate all error messages: https://github.com/colinhacks/zod/blob/v4/packages/core/src/locales/en.ts
2 Export your dialect from
packages/core/locales.ts
3 Add to docs
Add your new language variant to the
Error customization
page under the "Locales" section. Keep the list in alphabetical order.4 Submit the PR
Once you submit a PR, add a comment below so others can quickly see which languages are already covered.
Thank you for your help on this!
The text was updated successfully, but these errors were encountered: