summaryrefslogtreecommitdiff
path: root/modules/nlen/nlen.js
blob: c98810556611eaab89681c9be6720096a1089299 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var cmn=require("../$common.js"),
    fs=require("fs");

var translations;

module.exports=function(app,io,moddir){
	translations=eval(String(fs.readFileSync(moddir+"/English-Dutch-mistranslations.json")));
	app.get("/nlen",function(req,res){
		var translation=translations[+new Date()/60000%translations.length|0]; //new translation each minute
		res.set('Content-Type', 'text/html');
		res.send(
			String(fs.readFileSync(moddir+"/nlen.html"))
			.replace("<!--DUTCHDUTCH-->",cmn.simpleHTMLescape(translation.nl))
			.replace("<!--ENGLISHENGLISH-->",cmn.simpleHTMLescape(translation.en))
		);
	});
};