You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically the title. I couldn't find any info/docs on this so I'm assuming it's not possible but I'm asking here just in the hopes of a savior! 😁
I think my use case is a fairly common one (?), I like having my errors translated in the backend so the frontend team does not return ugly/unformatted messages when the backend adds a new error that they have not yet written code to cover.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Basically the title. I couldn't find any info/docs on this so I'm assuming it's not possible but I'm asking here just in the hopes of a savior! 😁
I think my use case is a fairly common one (?), I like having my errors translated in the backend so the frontend team does not return ugly/unformatted messages when the backend adds a new error that they have not yet written code to cover.
So take this schema for example:
Assuming I'm using elysia-i18next which allows me access to the translator function (
t
) on requests and detects locale automatically, like this:What I would love to be able to do is instead of:
Doing this:
I know the
error
field already accepts a function but these are the only arguments available:Maybe it's possible to decorate the error function with additional parameters through a plugin?
Please let me know if something like this can be done right now or if it can even be possibly implemented in the future!
Beta Was this translation helpful? Give feedback.
All reactions