Skip to content
Snippets Groups Projects
Commit 693236e8 authored by ERKEN EFE's avatar ERKEN EFE
Browse files

:sparkles: NEW: Add translation on button click

Added a way to change site language via buttons on the navbar.
parent 2cb0440a
Branches
Tags
No related merge requests found
......@@ -4,14 +4,10 @@ document
.forEach((currentButton) => {
currentButton
.addEventListener("click", function () {
const d = new Date();
d.setTime(d.getTime() + 24 * 60 * 60 * 1000);
let expires = "expires=" + d.toUTCString();
if (this.value == "fr") {
document.cookie = "lang=fr;" + expires + ";path=/";
} else if (this.value == "en") {
document.cookie = "lang=en;" + expires + ";path=/";
}
location.reload();
const d = new Date()
d.setTime(d.getTime() + 24 * 60 * 60 * 1000)
let expires = "expires=" + d.toUTCString()
document.cookie = "lang=" + this.value + ";" + expires + ";path=/"
location.reload()
})
})
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment