From 69b4f6963d5dc64177a6f707fe3f323256c5c166 Mon Sep 17 00:00:00 2001 From: Rodrigo Martin Date: Mon, 15 Jul 2024 14:00:18 -0300 Subject: [PATCH] fix(AU-2128): Let 'en' be selected as transcript by default when youtube video (#35116) --- xmodule/video_block/transcripts_utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xmodule/video_block/transcripts_utils.py b/xmodule/video_block/transcripts_utils.py index d82a5d3f4789..417c78cc3489 100644 --- a/xmodule/video_block/transcripts_utils.py +++ b/xmodule/video_block/transcripts_utils.py @@ -866,8 +866,11 @@ def get_default_transcript_language(self, transcripts, dest_lang=None): """ sub, other_lang = transcripts["sub"], transcripts["transcripts"] - if dest_lang and dest_lang in other_lang.keys(): - transcript_language = dest_lang + if dest_lang: + if dest_lang in other_lang.keys(): + transcript_language = dest_lang + elif dest_lang == 'en' and (not other_lang or (other_lang and sub)): + transcript_language = 'en' elif self.transcript_language in other_lang: transcript_language = self.transcript_language elif sub: