My team is currently working on a web project where the front end uses json api provided by the back end. The technology that we use is Spring Boot and AngularJS. The api has th
If I had to do this, I would have done it on the back end, primarily because since the backend has the locale, and is also generating the errors, it does make sense to expect localized errors from it. It would also de-couple the systems, such that, if there is any new feature/change done on the back end, and a new error is added, you do not need to release the front end piece just for the error.
Also, once this scales up, and you have multiple backend systems, the above approach just works well, since all the error generators are responsible for taking care of their respective localizations.