summaryrefslogtreecommitdiff
path: root/scripts/localStorage.js
blob: c5eb43d7cff8f4df8f5bce72606bb0eeb1f0f59c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function langIndonesia() {
	localStorage.setItem("lang", "id");
	window.location.reload();
}

function langEnglish() {
	localStorage.setItem("lang", "en");
	window.location.reload();
}

function switchLang() {
	switchLangStorage();
	window.location.reload();
}

function switchLangStorage() {
	if (localStorage.getItem("lang") == "id") {
		localStorage.setItem("lang", "en");
	} else {
		localStorage.setItem("lang", "id");
	}
}

function switchLangHref(destination) {
	switchLangStorage();
	window.location.href = destination;
}