summaryrefslogtreecommitdiff
path: root/modules/nlen/nlen.js
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-09-13 11:43:06 +0200
committertomsmeding <tom.smeding@gmail.com>2016-09-13 11:44:11 +0200
commitf00ba92ed2cc1a9c24ad783e83525d1b5a85b857 (patch)
tree4d1c00a47c7f3842bcf3dece83d3c00ed3ae459f /modules/nlen/nlen.js
Initial
Diffstat (limited to 'modules/nlen/nlen.js')
-rw-r--r--modules/nlen/nlen.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/nlen/nlen.js b/modules/nlen/nlen.js
new file mode 100644
index 0000000..c988105
--- /dev/null
+++ b/modules/nlen/nlen.js
@@ -0,0 +1,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))
+ );
+ });
+};