nuxt-zod-i18n
Nuxt ZodI18n
A Nuxt Module for localizing zod error messages.
Check the playground for usage doc and test will come later
Features
- This library depends on @nuxtjs/i18n .
- Provide a Global error map for zod see Zod ERROR_HANDLING
- Translation for zod errors based on ZodIssueCode
- A way to translate custom errors
Quick Setup
- Add
nuxt-zod-i18ndependency to your project
npx nuxi@latest module add nuxt-zod-i18n
- Add
nuxt-zod-i18nto themodulessection ofnuxt.config.tsbefore@nuxtjs/i18nmodule
export default defineNuxtConfig({
modules: ['nuxt-zod-i18n', '@nuxtjs/i18n']
})
That's it! You can now use Nuxt ZodI18n in your Nuxt app ✨
Development
# Install dependencies
npm install
# Generate type stubs
npm run dev:prepare
# Develop with the playground
npm run dev
# Build the playground
npm run dev:build
# Run ESLint
npm run lint
# Run Vitest
npm run test
npm run test:watch
# Release new version
npm run release
Version History
| Version | Released | License |
|---|---|---|
| 1.12.1 | MIT | |
| 1.12.0 | MIT | |
| 1.11.5 | MIT | |
| 1.11.4 | MIT | |
| 1.11.3 | MIT | |
| 1.11.2 | MIT | |
| 1.11.1 | MIT | |
| 1.11.0 | MIT | |
| 1.10.0 | MIT | |
| 1.9.0 | MIT | |
| 1.8.1 | MIT | |
| 1.8.0 | MIT | |
| 1.7.0 | MIT | |
| 1.6.0 | MIT | |
| 1.5.0 | MIT | |
| 1.4.0 | MIT | |
| 1.3.0 | MIT | |
| 1.2.0 | MIT | |
| 1.1.0 | MIT | |
| 1.0.4 | MIT | |
| 1.0.3 | MIT | |
| 1.0.2 | MIT | |
| 1.0.1 | MIT |