mirror of https://github.com/mue/mue.git
Add french translations
This commit is contained in:
parent
a31a12e8d4
commit
a769391b13
|
@ -30,9 +30,10 @@
|
||||||
// https://eloquentjavascript.net/05_higher_order.html
|
// https://eloquentjavascript.net/05_higher_order.html
|
||||||
|
|
||||||
function setDaytimeMessage () {
|
function setDaytimeMessage () {
|
||||||
if (window.browser.language === 'it' || window.browser.language === 'it-ch') itaMessageSet();
|
if (window.browser.language === 'it' || window.browser.language === 'it-ch') itaMessageSet(); //Italian
|
||||||
if (window.browser.language === 'de') nlMessageSet();
|
if (window.browser.language === 'de') nlMessageSet(); //Dutch
|
||||||
else engMessageSet();
|
if (window.browser.language === 'fr') frMessageSet(); //French
|
||||||
|
else engMessageSet(); //English
|
||||||
};
|
};
|
||||||
|
|
||||||
function setRandomBackground () {
|
function setRandomBackground () {
|
||||||
|
@ -273,3 +274,15 @@ function nlMessageSet() {
|
||||||
|
|
||||||
setHTMLContent('.greeting', time); // Write the string contents to the HTML
|
setHTMLContent('.greeting', time); // Write the string contents to the HTML
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// French
|
||||||
|
function frMessageSet() {
|
||||||
|
let hour = new Date().getHours(); // Get the current hour
|
||||||
|
let time = 'Goedemiddag'; // Set the default time string to "Good evening"
|
||||||
|
|
||||||
|
if (hour < 12) time = 'Bonjour'; // If it's before 12am, set the time string to "Good morning"
|
||||||
|
else if (hour > 18) time = 'Bonne après-midi'; // If it's after 6pm, set the time string to "Good afternoon"
|
||||||
|
else time = 'Bonsoir'; // If It's unknown, set the time stirng to "Good evening"
|
||||||
|
|
||||||
|
setHTMLContent('.greeting', time); // Write the string contents to the HTML
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue