Is it possible to translate standard error messages?

Hi everyone, I’m already using i18n to translate content.

But my question is the following, is it possible to translate the standard error messages?

For example, auth error messages, content not found, etc.

I did some searches and didn’t find anything similar.

I thought about maybe creating a global middleware, and using the error api to create custom messages, but I don’t know if that was the best solution. Thank you all.

1 Like

I continued my research, and there really isn’t a native way.

I found this issue:

And to really clear the doubt I went to investigate the core, and the error messages are written in English:

...
      if (!user) {
        throw new ValidationError('Invalid identifier or password');
      }

      if (!user.password) {
        throw new ValidationError('Invalid identifier or password');
      }
...

This implementation in the future would be very interesting, or perhaps some solution that does not require much effort.

1 Like