Skip to content

Commit

Permalink
Fix/au 2128 (#35124)
Browse files Browse the repository at this point in the history
* fix: update condition to always return a value

* feat: add comments on logic
  • Loading branch information
Rodra authored Jul 16, 2024
1 parent 8b1e647 commit 60719bd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions xmodule/video_block/transcripts_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,11 +866,12 @@ def get_default_transcript_language(self, transcripts, dest_lang=None):
"""
sub, other_lang = transcripts["sub"], transcripts["transcripts"]

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'
# language in plugin selector exists as transcript
if dest_lang and dest_lang in other_lang.keys():
transcript_language = dest_lang
# language in plugin selector is english and empty transcripts or transcripts and sub exists
elif dest_lang and 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:
Expand Down

0 comments on commit 60719bd

Please sign in to comment.