I am using a MEAN stack (mongodb, express, angular, nodejs) to develop an application. To render HTML in different languages I am using the i18n-2 node module.
But, I have some front end error messages (like validation errors - eg. Invalid Email). These messages appear based on user actions. How can these messages be internationalized?
One approach I can think of is to use hidden elements in jade / html and then pull out the same in angular / javascript. Alternatively, I can pass some ng-init variables in the jade file and then pull out the appropriate message at runtime in the angular controller.
Is the above approach ok? Or is there any other best practice for this?