fabian-hiller / valibot

The modular and type safe schema library for validating structural data 🤖

Home Page:https://valibot.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not correct lang after set globally lang

ncodealex opened this issue · comments

Hello ! Thanks for you package!

I have problem when i set globally lang in valibot.

Expected behavior: after using shema._parse issues have validation message in set globally lang
Actual behavior: language validation messages is "EN"

Reproducing the problem:

https://stackblitz.com/edit/vitejs-vite-scmsnl?file=src%2FApp.vue

._parse is an internal API and should not be used directly. If you parse your schema with parse or safeParse, it should work as expected: https://valibot.dev/guides/parse-data/

Thanks for answer!

I use valibot in nuxt ui forms

https://ui.nuxt.com/components/form#valibot

Under the hood they use ._parse

#https://github.com/nuxt/ui/blob/main/src/runtime/components/forms/Form.vue

Please see string 263.

Should i create issue in nuxt/ui ?

Yes, please create an issue at nuxt/ui. Feel free to link me so I can help if there are any questions.