mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 01:36:13 +00:00
Use server-side content-negociation for language detection (thanks @harding) (fixes #478)
This commit is contained in:
parent
da5aae3ca3
commit
6458c16a66
1 changed files with 0 additions and 8 deletions
|
@ -4,14 +4,6 @@ lang: 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>
|
|
||||||
<p class="mainsummary">{% translate listintro %}</p>
|
<p class="mainsummary">{% translate listintro %}</p>
|
||||||
<div class="mainvideo"><iframe src="//www.youtube.com/embed/Gc2en3nHxA4?rel=0&showinfo=0&wmode=opaque{% if page.lang != 'en' %}&cc_load_policy=1&hl={{ page.lang }}&cc_lang_pref={{ page.lang }}{% endif %}" frameborder="0" allowfullscreen></iframe></div>
|
<div class="mainvideo"><iframe src="//www.youtube.com/embed/Gc2en3nHxA4?rel=0&showinfo=0&wmode=opaque{% if page.lang != 'en' %}&cc_load_policy=1&hl={{ page.lang }}&cc_lang_pref={{ page.lang }}{% endif %}" frameborder="0" allowfullscreen></iframe></div>
|
||||||
<div class="mainlist">
|
<div class="mainlist">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue