Added language detection based on cookie (named 'language')
This commit is contained in:
parent
c3e9636ed9
commit
b39914e478
15
player.js
15
player.js
@ -38,6 +38,21 @@ function init() {
|
||||
defaultres = cookies.resolution
|
||||
}
|
||||
|
||||
if('language' in cookies) {
|
||||
var lang = cookies['language']
|
||||
if (lang != 'se') {
|
||||
document.querySelector('html').lang = lang
|
||||
var dataname = 'title_' + lang
|
||||
document.querySelectorAll('[data-' + dataname + ']').forEach(
|
||||
function(tag) {
|
||||
tag.title = tag.dataset[dataname]})
|
||||
var altname = 'title_alt_' + lang
|
||||
document.querySelectorAll('[data-' + altname + ']').forEach(
|
||||
function(tag) {
|
||||
tag.dataset['title_alt'] = tag.dataset[altname]})
|
||||
}
|
||||
}
|
||||
|
||||
body.dataset.id = presentation.id
|
||||
|
||||
if(playlist) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user