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
90437fa5
Commit
90437fa5
authored
Mar 27, 2014
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display transcript translations for student in their source language.
parent
1bd0bcb8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
CHANGELOG.rst
+2
-0
common/lib/xmodule/xmodule/video_module/video_module.py
+2
-1
lms/djangoapps/courseware/tests/test_video_mongo.py
+5
-3
No files found.
CHANGELOG.rst
View file @
90437fa5
...
...
@@ -5,6 +5,8 @@ These are notable changes in edx-platform. This is a rolling list of changes,
in roughly chronological order, most recent first. Add your entries at or near
the top. Include a label indicating the component affected.
Blades: Transcript translations should be displayed in their source language (BLD-935).
Blades: Create an upload modal for video transcript translations (BLD-751).
Studio: Add ability to reorder Pages and hide the Wiki page. STUD-1375
...
...
common/lib/xmodule/xmodule/video_module/video_module.py
View file @
90437fa5
...
...
@@ -124,8 +124,9 @@ class VideoModule(VideoFields, VideoStudentViewHandlers, XModule):
else
:
transcript_language
=
sorted
(
self
.
transcripts
.
keys
())[
0
]
native_languages
=
{
lang
:
label
for
lang
,
label
in
settings
.
LANGUAGES
if
len
(
lang
)
==
2
}
languages
=
{
lang
:
display
lang
:
native_languages
.
get
(
lang
,
display
)
for
lang
,
display
in
settings
.
ALL_LANGUAGES
if
lang
in
self
.
transcripts
}
...
...
lms/djangoapps/courseware/tests/test_video_mongo.py
View file @
90437fa5
# -*- coding: utf-8 -*-
"""Video xmodule tests in mongo."""
import
json
import
unittest
from
collections
import
OrderedDict
from
mock
import
patch
,
PropertyMock
,
MagicMock
from
django.conf
import
settings
...
...
@@ -53,7 +55,7 @@ class TestVideoYouTube(TestVideo):
'transcript_download_format'
:
'srt'
,
'transcript_download_formats_list'
:
[{
'display_name'
:
'SubRip (.srt) file'
,
'value'
:
'srt'
},
{
'display_name'
:
'Text (.txt) file'
,
'value'
:
'txt'
}],
'transcript_language'
:
u'en'
,
'transcript_languages'
:
'{"en": "English", "uk": "Ukrainian"}'
,
'transcript_languages'
:
json
.
dumps
(
OrderedDict
({
"en"
:
"English"
,
"uk"
:
u"Українська"
}))
,
'transcript_translation_url'
:
self
.
item_descriptor
.
xmodule_runtime
.
handler_url
(
self
.
item_descriptor
,
'transcript'
,
'translation'
)
.
rstrip
(
'/?'
),
...
...
@@ -97,6 +99,7 @@ class TestVideoNonYouTube(TestVideo):
}
context
=
self
.
item_descriptor
.
render
(
'student_view'
)
.
content
expected_context
=
{
'ajax_url'
:
self
.
item_descriptor
.
xmodule_runtime
.
ajax_url
+
'/save_user_state'
,
'data_dir'
:
getattr
(
self
,
'data_dir'
,
None
),
...
...
@@ -239,7 +242,7 @@ class TestGetHtmlMethod(BaseTestXmodule):
expected_context
.
update
({
'transcript_download_format'
:
None
if
self
.
item_descriptor
.
track
and
self
.
item_descriptor
.
download_track
else
'srt'
,
'transcript_languages'
:
'{"en": "English"}'
if
not
data
[
'transcripts'
]
else
'{"uk": "Ukrainian"}'
,
'transcript_languages'
:
'{"en": "English"}'
if
not
data
[
'transcripts'
]
else
json
.
dumps
({
"uk"
:
u'Українська'
})
,
'transcript_language'
:
u'en'
if
not
data
[
'transcripts'
]
or
data
.
get
(
'sub'
)
else
u'uk'
,
'transcript_translation_url'
:
self
.
item_descriptor
.
xmodule_runtime
.
handler_url
(
self
.
item_descriptor
,
'transcript'
,
'translation'
...
...
@@ -252,7 +255,6 @@ class TestGetHtmlMethod(BaseTestXmodule):
'sub'
:
data
[
'sub'
],
'id'
:
self
.
item_descriptor
.
location
.
html_id
(),
})
self
.
assertEqual
(
context
,
self
.
item_descriptor
.
xmodule_runtime
.
render_template
(
'video.html'
,
expected_context
),
...
...
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