I would like to make a language module for expressjs. Something like codeigniters language class. http://codeigniter.com/user_guide/libraries/language.html
So that user can choose a language and the appropriate language file gets loaded. I am trying to figure out how to accomplish that in expressjs. Or are there any modules out there? Any thoughts or recommendations are appreciated.
There are a number of i18n modules you can use in your application, but you can create your own if you want.
For example create a folder /languages and inside it create en.js, fr.js etc
it.js
The important thing is to set a default language and make a language select bar somewhere in your site. When the user chooses another language (and not English) in your app you do something like this:
Then you can have a language helper function like so: