It would be nice if the transcript language selector only appeared if there was >1 language available for the page. I put in some slightly hacky code to handle this.
comic.tpl:
{% if transcripts.keys()|length > 1 %}
<td id="language-list">
<label for="language-select">Languages</label>
<select id="language-select" size="7">
{% for language in transcripts.keys() %}
<option>{{ language }}</option>
{% endfor %}
</select>
</td>
{% endif %}
transcript.js:
export function init() {
let languageList = document.getElementById("language-select");
let transcriptList = document.getElementById("active-transcript");
let transcripts = transcriptList.children;
// handle having only one language
if (!languageList) {
transcripts[0].style.display = "block";
return;
}
It would be nice if the transcript language selector only appeared if there was >1 language available for the page. I put in some slightly hacky code to handle this.
comic.tpl:
transcript.js:
Let me know your thoughts!