node.js - MEAN Stack: How to handle internationalization in front end error messages? -


i using mean stack (mongodb, express, angular, nodejs) develop application. render html in different languages using i18n-2 node module.

but, have front end error messages (like validation errors - eg. invalid email). these messages appear based on user actions. how can these messages internationalized?

one approach can think of use hidden elements in jade / html , pull out same in angular / javascript. alternatively, can pass ng-init variables in jade file , pull out appropriate message @ runtime in angular controller.

is above approach ok? or there other best practice this?

take @ angular translate module:

http://angular-translate.github.io/


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -