Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
287d84ba
Commit
287d84ba
authored
Feb 27, 2014
by
Calen Pennington
Committed by
Adam Palay
Feb 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix youtube captions that disappeared with multi-language caption support
[BLD-889]
parent
4db78853
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
common/lib/xmodule/xmodule/video_module/video_module.py
+15
-13
No files found.
common/lib/xmodule/xmodule/video_module/video_module.py
View file @
287d84ba
...
@@ -245,21 +245,23 @@ class VideoModule(VideoFields, XModule):
...
@@ -245,21 +245,23 @@ class VideoModule(VideoFields, XModule):
elif
self
.
sub
:
elif
self
.
sub
:
track_url
=
self
.
runtime
.
handler_url
(
self
,
'transcript'
)
.
rstrip
(
'/?'
)
+
'/download'
track_url
=
self
.
runtime
.
handler_url
(
self
,
'transcript'
)
.
rstrip
(
'/?'
)
+
'/download'
if
self
.
transcript_language
in
self
.
transcripts
:
if
not
self
.
transcripts
:
transcript_language
=
self
.
transcript_language
elif
self
.
sub
:
transcript_language
=
'en'
transcript_language
=
'en'
elif
self
.
transcripts
:
languages
=
{
'en'
:
'English'
}
transcript_language
=
self
.
transcripts
.
keys
()[
0
]
else
:
else
:
# this for the case, when for currently selected video,
if
self
.
transcript_language
in
self
.
transcripts
:
# there are no translations and English subtitles are not set by instructor.
transcript_language
=
self
.
transcript_language
transcript_language
=
'null'
else
:
transcript_language
=
self
.
transcripts
.
keys
()[
0
]
all_languages
=
{
i
[
0
]:
i
[
1
]
for
i
in
settings
.
ALL_LANGUAGES
}
languages
=
{
lang
:
all_languages
[
lang
]
for
lang
in
self
.
transcripts
}
languages
=
{
if
self
.
sub
:
lang
:
display
languages
.
update
({
'en'
:
'English'
})
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
# OrderedDict for easy testing of rendered context in tests
transcript_languages
=
OrderedDict
(
sorted
(
languages
.
items
(),
key
=
itemgetter
(
1
)))
transcript_languages
=
OrderedDict
(
sorted
(
languages
.
items
(),
key
=
itemgetter
(
1
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment