Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
287d84ba
Commit
287d84ba
authored
11 years ago
by
Calen Pennington
Committed by
Adam Palay
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix youtube captions that disappeared with multi-language caption support
[BLD-889]
parent
4db78853
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/lib/xmodule/xmodule/video_module/video_module.py
+15
-13
15 additions, 13 deletions
common/lib/xmodule/xmodule/video_module/video_module.py
with
15 additions
and
13 deletions
common/lib/xmodule/xmodule/video_module/video_module.py
+
15
−
13
View file @
287d84ba
...
...
@@ -245,21 +245,23 @@ class VideoModule(VideoFields, XModule):
elif
self
.
sub
:
track_url
=
self
.
runtime
.
handler_url
(
self
,
'
transcript
'
).
rstrip
(
'
/?
'
)
+
'
/download
'
if
self
.
transcript_language
in
self
.
transcripts
:
transcript_language
=
self
.
transcript_language
elif
self
.
sub
:
if
not
self
.
transcripts
:
transcript_language
=
'
en
'
elif
self
.
transcripts
:
transcript_language
=
self
.
transcripts
.
keys
()[
0
]
languages
=
{
'
en
'
:
'
English
'
}
else
:
# this for the case, when for currently selected video,
# there are no translations and English subtitles are not set by instructor.
transcript_language
=
'
null
'
all_languages
=
{
i
[
0
]:
i
[
1
]
for
i
in
settings
.
ALL_LANGUAGES
}
languages
=
{
lang
:
all_languages
[
lang
]
for
lang
in
self
.
transcripts
}
if
self
.
sub
:
languages
.
update
({
'
en
'
:
'
English
'
})
if
self
.
transcript_language
in
self
.
transcripts
:
transcript_language
=
self
.
transcript_language
else
:
transcript_language
=
self
.
transcripts
.
keys
()[
0
]
languages
=
{
lang
:
display
for
lang
,
display
in
settings
.
ALL_LANGUAGES
if
lang
in
self
.
transcripts
}
if
self
.
sub
:
languages
[
'
en
'
]
=
'
English
'
# OrderedDict for easy testing of rendered context in tests
transcript_languages
=
OrderedDict
(
sorted
(
languages
.
items
(),
key
=
itemgetter
(
1
)))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment