From 056e34bc0298d06ee80936e1653de888bab5945f Mon Sep 17 00:00:00 2001 From: Wessel Date: Sat, 27 Oct 2018 20:54:35 +0200 Subject: [PATCH 1/2] Add dutch translation --- assets/js/index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/assets/js/index.js b/assets/js/index.js index 6c719efb..cd81bd5d 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -261,3 +261,14 @@ function itaMessageSet() { setHTMLContent(".greeting", `Buon${getDaytime()}`); } +// Dutch +function nlMessageSet() { + let hour = new Date().getHours(); // Get the current hour + let time = 'Goedemiddag'; // Set the default time string to "Good evening" + + if (hour < 12) time = 'Goedemorgen'; // If it's before 12am, set the time string to "Good morning" + else if (hour > 18) time = 'Goedenavond'; // If it's after 6pm, set the time string to "Good afternoon" + else time = 'Goedemiddag'; // If It's unknown, set the time stirng to "Good evening" + + setHTMLContent('.greeting', time); // Write the string contents to the HTML +} From 9f0a3822000160c58d77fb3dab3489d5a241bdbd Mon Sep 17 00:00:00 2001 From: Dave R Date: Sat, 27 Oct 2018 20:25:13 +0100 Subject: [PATCH 2/2] quick fix --- assets/js/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/js/index.js b/assets/js/index.js index cd81bd5d..f401403b 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -30,7 +30,8 @@ // https://eloquentjavascript.net/05_higher_order.html function setDaytimeMessage () { - if (browserlang === 'it' || broserlang === 'it-ch') itaMessageSet(); + if (window.browser.language === 'it' || window.browser.language === 'it-ch') itaMessageSet(); + if (window.browser.language === 'de') nlMessageSet(); else engMessageSet(); };