Multilanguage express app

I wonder what would be the best way to implement multiple versions / languages of the same content in the same layout in express.

Should I just do this?

app.get("/", function(req, res) {
    res.render(language + "/index");
});

Or is there a smarter / better way?

I would suggest to keep only one template, as if you use one template per language it will get out of hand very quickly, let alone duplicate much content (and the small amount of "logic" you would put in a template too). Many applications use a tool called gettext to do the internationalization thing. There is a node.js library for it at https://github.com/DanielBaulig/node-gettext

Alternatively there is also i18n-node. It appears to have a bit more integration with express js.

i thought that we can define json objects in lang folder like , en.js , fr.js and this json files contains key value pairs than render to template according to user's language setting , lang settings can be into database.

And we can save this fr.js or anything else into res.locals for calling every template .

Is this suitable?