34 lines
767 B
HTML
34 lines
767 B
HTML
---
|
|
layout: none
|
|
---
|
|
<html>
|
|
<head>
|
|
<title>Redirecting...</title>
|
|
</head>
|
|
<body>
|
|
<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";
|
|
console.log('<a href="' + url + '">Redirecting to the ' + language.name +
|
|
' version...</a>')
|
|
document.write('<a href="' + language.code +
|
|
'/index.html">Redirecting to the ' + language.name +
|
|
' version...</a>');
|
|
|
|
window.location.replace(url);
|
|
</script>
|
|
</body>
|
|
</html>
|