-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathindex.html
35 lines (31 loc) · 797 Bytes
/
index.html
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
28
29
30
31
32
33
34
35
---
layout: none
---
<html>
<head>
<title>Redirecting...</title>
</head>
<body>
Detecting and redirecting to the correct translation.<br><br>
<a href="en/index.html">View English Translation</a><br><br>
<script>
var languages = {{ site.data.languages | jsonify }};
function getLanguage() {
var userLang = navigator.language || navigator.userLanguage;
for (var i = 0; i < languages.length; i++) {
var lang = languages[i];
if (userLang.indexOf(lang.code) == 0) {
return lang;
}
}
return null;
}
var language = getLanguage() || languages[0];
var url = language.code + "/index.html";
document.write('<a href="' + language.code +
'/index.html">Redirecting to the ' + language.name +
' version...</a>');
window.location.replace(url);
</script>
</body>
</html>