I’ve been working with Node.js for a while as you might know. Now, I’m launching my first website with Node… (we’re on private beta, but if you want to try it, just register http://www.parkuik.com) and I’ll be posting some articles of how it’s been built and some tools I’ve been using.
You could use it in node with every template engine you’re using (I suppose…). Personally, I’m using it with Jade (which I should recommend).
First of all you should download it with npm. If you don’t know yet how to do it, just copy this in your terminal (within project folder)
After that, if you’re using express, first thing you must do is include its middleware and configure all.
If you’ve set default language to ‘en’, of course you’ll have to define its JSON file just like this
Now you can use it with jade
And you could define a dropdown to select language. This time I’m using bootstrap styles, just in case:
The only problem I found was… What If I’m using Backbone.js to generate views? Well, I came up with some “right” solution which fits well on my needs (of course, if you think that’s not the correct way just tell me )
And after this, you have a multilingual website! =)