From e618c3f52c1c4ae161650679cda24eecbba579bb Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 4 Dec 2021 10:58:59 +0100 Subject: Code is now more cute! --- htdocs/public/archive/index.ejs | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'htdocs/public/archive/index.ejs') diff --git a/htdocs/public/archive/index.ejs b/htdocs/public/archive/index.ejs index 3fdda40..24af393 100644 --- a/htdocs/public/archive/index.ejs +++ b/htdocs/public/archive/index.ejs @@ -1,37 +1,32 @@ -<% global.title = "Archives"; %> +<% global.title = lang.archives.title; %> <%- include(`${private}/header.ejs`) %> ← Go back home
-

Archives

- - - +

<%- lang.archives.title %>

<% - const monthNames = ["January", "February", "March", "April", "May", "June", - "July", "August", "September", "October", "November", "December" - ]; + const monthNames = lang.archives.months; archives = []; - for (let archive of fs.readdirSync(serverRoot + "/archives")) { + for (let archive of fs.readdirSync(serverRoot + "/data/archives")) { data = {}; if (archive.endsWith(".json")) { - json = JSON.parse(fs.readFileSync(serverRoot + "/archives/" + archive).toString()) + json = JSON.parse(fs.readFileSync(serverRoot + "/data/archives/" + archive).toString()) data.id = archive.substr(0, archive.length - 5); data.name = json.title; - data.description = json.description.en; + data.description = json.description[slang] ?? json.description.en; data.date = (json.date.substr(3) + json.date.substr(0, 2)) - 1 + 1; if (json.unreleased) { let date = new Date(json.date.substr(3) + "-" + json.date.substr(0, 2) + "-01"); - data.info = "Never released · " + monthNames[date.getMonth()] + " " + date.getFullYear(); + data.info = "" + lang.archives.never + " · " + monthNames[date.getMonth()] + " " + date.getFullYear(); } else { let date = new Date(json.date.substr(3) + "-" + json.date.substr(0, 2) + "-01"); - data.info = "Officially released · " + monthNames[date.getMonth()] + " " + date.getFullYear(); + data.info = lang.archives.released + " · " + monthNames[date.getMonth()] + " " + date.getFullYear(); } archives.push(data); @@ -49,7 +44,7 @@ Download + class="big-button big-button-bg3"><%- lang.archives.download %>

<%- archive.info %>

-- cgit