I18n in input?
#546
-
Valibot supports internationalization, and I want to support that, from the headers, i can set the locale for the schema so that I can get locale-tuned errors. Is there a way (via middlewares maybe) to do it? |
Beta Was this translation helpful? Give feedback.
Answered by
unnoq
May 26, 2025
Replies: 1 comment
-
Unfortunately, there isn't currently an efficient way to do that (I think we'll have to wait until the standard schema supports it). However, maybe middleware can handle it - though it's could be incorrect if requests are handled in parallel. const base = os.use(({ next }) => {
v.setGlobalConfig({ lang: 'de' });
return next()
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
naquiroz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately, there isn't currently an efficient way to do that (I think we'll have to wait until the standard schema supports it). However, maybe middleware can handle it - though it's could be incorrect if requests are handled in parallel.