Skip to content

Commit 3a9c9c5

Browse files
Change youtube subtitle depending on preferred language (#230)
1 parent b3dcebc commit 3a9c9c5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/pages/Homepage.svelte

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import { gestures } from '../script/stores/Stores';
3434
import StandardDialog from '../components/dialogs/StandardDialog.svelte';
3535
import { clearGestures } from '../script/stores/mlStore';
36+
import { locale as currentLocale } from 'svelte-i18n';
3637
import { get } from 'svelte/store';
3738
3839
const playgroundSurveyUrl =
@@ -78,15 +79,12 @@
7879
<h1 class="sr-only">{$t('content.index.title')}</h1>
7980
<div class="mb-8">
8081
<div class="flex flex-col items-center justify-center m-10 gap-5">
81-
<!-- Avoid youtube cookie. rel=0 should limit related videos to youtube channel.
82-
Once we have translated videos we can try e.g. cc_lang_pref=fr
83-
but we'll need to check our codes match theirs.
84-
-->
82+
<!-- Avoid youtube cookie. rel=0 should limit related videos to youtube channel.-->
8583
<iframe
8684
class="w-38rem h-auto aspect-video"
8785
style="aspect-ratio: 16/9"
8886
title={$t('homepage.introVideo')}
89-
src="https://www.youtube-nocookie.com/embed/ZhUtuuQemFc?rel=0&cc_load_policy=1"
87+
src={`https://www.youtube-nocookie.com/embed/ZhUtuuQemFc?rel=0&cc_lang_pref=${$currentLocale}&cc_load_policy=1`}
9088
allow="encrypted-media"
9189
frameBorder="0"
9290
allowFullScreen>

0 commit comments

Comments
 (0)