Put back automatic language redirection with a small delay

(This allows to use this feature without triggering Google Chrome issue #130)
This commit is contained in:
Saivann 2013-04-14 00:31:21 -04:00
parent 244c6d14df
commit 150056919a

View file

@ -3,6 +3,14 @@ layout: base-en
id: index id: index
title: Bitcoin title: Bitcoin
--- ---
<script>
//Auto redirect to the appropriate language
var langs={};{% for lang in site.langs %}{% if lang[0] != page.lang %}langs['{{ lang[0] }}']=true;{% endif %}{% endfor %}
var lang=(navigator.language)?navigator.language:navigator.userLanguage;
lang=lang.split('_')[0];
if(!langs[lang])lang='en';
setTimeout(function(){window.location.href='/'+lang+'/';},200);
</script>
<h1>An open source P2P digital currency</h1> <h1>An open source P2P digital currency</h1>
<p style="font-size:125%;">Bitcoin is a digital currency, a protocol, and a software that enables <p style="font-size:125%;">Bitcoin is a digital currency, a protocol, and a software that enables
<ul style="font-size:125%"> <ul style="font-size:125%">