diff --git a/index.html b/index.html
index 0bb44e4..e87a09f 100644
--- a/index.html
+++ b/index.html
@@ -10,27 +10,24 @@ layout: none
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];
- console.log(lang.code + " vs " + userLang);
-
if (userLang.indexOf(lang.code) == 0) {
return lang;
}
}
-
return null;
}
var language = getLanguage() || languages[0];
- console.log('Redirecting to the ' + language.name +
+ var url = language.code + "/index.html";
+ console.log('Redirecting to the ' + language.name +
' version...')
- document.write('Redirecting to the ' + language.name +
' version...');
+ window.location.replace(url);