mirror of
https://github.com/mehotkhan/BandersnatchInteractive.git
synced 2025-07-27 17:23:22 +00:00
Added a choices translation selector
Added the ability to select a translation of choices
This commit is contained in:
parent
d84fa0fd06
commit
a4f6d03137
2 changed files with 37 additions and 13 deletions
|
@ -35,9 +35,11 @@ var segmentGroups = bv.segmentGroups;
|
|||
// Transation of choices
|
||||
var moments = JSON.parse(JSON.stringify(momentsBySegment));
|
||||
|
||||
var translated_choices = ru;
|
||||
var translated_choices = en;
|
||||
|
||||
for (var key in translated_choices) {
|
||||
function switch_choices() {
|
||||
|
||||
for (var key in translated_choices) {
|
||||
|
||||
for (var i = 0; i < Object.keys(moments[key]).length; i++) {
|
||||
|
||||
|
@ -56,9 +58,12 @@ for (var key in translated_choices) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return moments;
|
||||
}
|
||||
|
||||
momentsBySegment = moments;
|
||||
// momentsBySegment = moments;
|
||||
|
||||
// Get translations from bandersnatch.js
|
||||
|
||||
|
|
25
index.html
25
index.html
|
@ -38,6 +38,7 @@
|
|||
<meta name="keywords" content="Bandersnatch,Bandersnatch Interactive Player,Interactive Player,watch," />
|
||||
<script src="assets/bandersnatch.js"></script>
|
||||
<script src="assets/choices/ru.js"></script>
|
||||
<script src="assets/choices/en.js"></script>
|
||||
<script src="assets/SegmentMap.js"></script>
|
||||
<script src="assets/scripts.js"></script>
|
||||
<script>
|
||||
|
@ -47,6 +48,7 @@
|
|||
reset();
|
||||
}
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="assets/styles.css">
|
||||
</head>
|
||||
|
||||
|
@ -57,6 +59,16 @@
|
|||
<div id="file-selector">
|
||||
<div class="file-area">
|
||||
<div class="contact">
|
||||
<div>
|
||||
<span class="default">You can select translation of choices: </span>
|
||||
<select id="choice-translation">
|
||||
<option value="ru">Russian</option>
|
||||
<option value="en" selected>English</option>
|
||||
</select>
|
||||
<br>
|
||||
This player remembers your choices and watch history: <a
|
||||
href="javascript:askReset()">Reset all</a>
|
||||
</div>
|
||||
<p>
|
||||
Authors:
|
||||
<a href="https://github.com/joric/bandersnatch/">Original version</a> - <a
|
||||
|
@ -64,9 +76,6 @@
|
|||
Web page, subtitles - <a href="https://github.com/mehotkhan">Mehotkhan</a> |
|
||||
Many fixes, improvements, and everything else - <a
|
||||
href="https://github.com/CyberShadow">CyberShadow</a>
|
||||
<br>
|
||||
This player remembers your choices and watch history. <a
|
||||
href="javascript:askReset()">Click here to reset and start from scratch.</a>
|
||||
</p>
|
||||
</div>
|
||||
<input id="fileinput" type="file">
|
||||
|
@ -163,4 +172,14 @@
|
|||
</div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
var select = document.getElementById('choice-translation');
|
||||
select.addEventListener('change',(e)=>{
|
||||
translated_choices = window[select.value];
|
||||
console.log(select.value);
|
||||
// console.log(translated_choices);
|
||||
momentsBySegment = switch_choices();
|
||||
})
|
||||
</script>
|
||||
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue