-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
🐛 bugUnintended behaviorUnintended behavior
Description
What happened?
In my main.ts I did the following, according to the Valibot docs:
import * as v from 'valibot'
import '@valibot/i18n/de'
v.setGlobalConfig({ lang: 'de' })If I call v.parse() manually, the localized messages do work, but when I do the validation with vee-validate, by submitting a form, the destructured errors property from useForm() does not include the localized messages.
Reproduction steps
- Install the required npm packages, and make sure to lock the Valibot package to
1.0.0-beta.1,1.0.0-beta.2or1.0.0-beta.3, as at least1.0.0-beta.1is required for@valibot/i18n, but anything above1.0.0-beta.3breakstoTypedSchema - Import the Valibot i18n package and set the language as described above
- Create a schema
- Call
const { handleSubmit } = useForm({ validationSchema: toTypedSchema(Schema) }) - Call
const onSubmit = handleSubmit(() => {}) - Create a form
<form @submit.prevent="onSubmit">...</form>with elements rendering theerrors - Start the dev server and input any data into the form that leads to a validation error
- Observe the messages still being in English
Version
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
- Firefox
- Chrome
- Safari
- Microsoft Edge
Relevant log output
No response
Demo link
None
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
🐛 bugUnintended behaviorUnintended behavior