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
d6acfa67
Commit
d6acfa67
authored
Oct 10, 2017
by
Qubad786
Committed by
muzaffaryousaf
Oct 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add video source language support for Cielo24 - EDUCATOR-1491
parent
c0b5932d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
12 deletions
+53
-12
cms/djangoapps/contentstore/views/tests/test_videos.py
+15
-1
cms/djangoapps/contentstore/views/videos.py
+6
-1
cms/static/js/spec/views/course_video_settings_spec.js
+0
-0
cms/static/js/views/course_video_settings.js
+29
-7
cms/static/sass/views/_video-upload.scss
+3
-3
No files found.
cms/djangoapps/contentstore/views/tests/test_videos.py
View file @
d6acfa67
...
...
@@ -953,7 +953,8 @@ class TranscriptPreferencesTestCase(VideoUploadTestBase, CourseTestCase):
{
'provider'
:
TranscriptProvider
.
CIELO24
,
'cielo24_fidelity'
:
'PROFESSIONAL'
,
'cielo24_turnaround'
:
'STANDARD'
'cielo24_turnaround'
:
'STANDARD'
,
'video_source_language'
:
'en'
},
True
,
u"Invalid languages []."
,
...
...
@@ -962,8 +963,20 @@ class TranscriptPreferencesTestCase(VideoUploadTestBase, CourseTestCase):
(
{
'provider'
:
TranscriptProvider
.
CIELO24
,
'cielo24_fidelity'
:
'PREMIUM'
,
'cielo24_turnaround'
:
'STANDARD'
,
'video_source_language'
:
'es'
},
True
,
u"Unsupported source language es."
,
400
),
(
{
'provider'
:
TranscriptProvider
.
CIELO24
,
'cielo24_fidelity'
:
'PROFESSIONAL'
,
'cielo24_turnaround'
:
'STANDARD'
,
'video_source_language'
:
'en'
,
'preferred_languages'
:
[
'es'
,
'ur'
]
},
True
,
...
...
@@ -1016,6 +1029,7 @@ class TranscriptPreferencesTestCase(VideoUploadTestBase, CourseTestCase):
'provider'
:
TranscriptProvider
.
CIELO24
,
'cielo24_fidelity'
:
'PROFESSIONAL'
,
'cielo24_turnaround'
:
'STANDARD'
,
'video_source_language'
:
'es'
,
'preferred_languages'
:
[
'en'
]
},
True
,
...
...
cms/djangoapps/contentstore/views/videos.py
View file @
d6acfa67
...
...
@@ -266,7 +266,7 @@ def validate_transcript_preferences(provider, cielo24_fidelity, cielo24_turnarou
cielo24_fidelity: Cielo24 transcription fidelity.
cielo24_turnaround: Cielo24 transcription turnaround.
three_play_turnaround: 3PlayMedia transcription turnaround.
video_source_language: Source/Speech language of the videos that are going to be submitted to
3PlayMedia
.
video_source_language: Source/Speech language of the videos that are going to be submitted to
the Providers
.
preferred_languages: list of language codes.
Returns:
...
...
@@ -291,12 +291,17 @@ def validate_transcript_preferences(provider, cielo24_fidelity, cielo24_turnarou
# Validate transcription languages
supported_languages
=
transcription_plans
[
provider
][
'fidelity'
][
cielo24_fidelity
][
'languages'
]
if
video_source_language
not
in
supported_languages
:
error
=
'Unsupported source language {}.'
.
format
(
video_source_language
)
return
error
,
preferences
if
not
len
(
preferred_languages
)
or
not
(
set
(
preferred_languages
)
<=
set
(
supported_languages
.
keys
())):
error
=
'Invalid languages {}.'
.
format
(
preferred_languages
)
return
error
,
preferences
# Validated Cielo24 preferences
preferences
=
{
'video_source_language'
:
video_source_language
,
'cielo24_fidelity'
:
cielo24_fidelity
,
'cielo24_turnaround'
:
cielo24_turnaround
,
'preferred_languages'
:
preferred_languages
,
...
...
cms/static/js/spec/views/course_video_settings_spec.js
View file @
d6acfa67
This diff is collapsed.
Click to expand it.
cms/static/js/views/course_video_settings.js
View file @
d6acfa67
...
...
@@ -101,6 +101,13 @@ function($, Backbone, _, gettext, moment, HtmlUtils, StringUtils, TranscriptSett
if
(
selectedPlan
)
{
if
(
this
.
selectedProvider
===
CIELO24
&&
this
.
selectedFidelityPlan
)
{
availableLanguages
=
selectedPlan
.
fidelity
[
this
.
selectedFidelityPlan
].
languages
;
// If fidelity is mechanical then target language would be same as source language.
if
(
this
.
selectedFidelityPlan
===
'MECHANICAL'
&&
this
.
selectedVideoSourceLanguage
)
{
availableLanguages
=
_
.
pick
(
availableLanguages
,
this
.
selectedVideoSourceLanguage
);
}
}
else
if
(
this
.
selectedProvider
===
THREE_PLAY_MEDIA
)
{
availableLanguages
=
selectedPlan
.
languages
;
}
...
...
@@ -108,6 +115,16 @@ function($, Backbone, _, gettext, moment, HtmlUtils, StringUtils, TranscriptSett
return
availableLanguages
;
},
getSourceLanguages
:
function
()
{
var
sourceLanguages
=
[];
if
(
this
.
selectedProvider
===
THREE_PLAY_MEDIA
)
{
sourceLanguages
=
this
.
availableTranscriptionPlans
[
this
.
selectedProvider
].
translations
;
}
else
{
sourceLanguages
=
this
.
getTargetLanguages
();
}
return
sourceLanguages
;
},
fidelitySelected
:
function
(
event
)
{
var
$fidelityContainer
=
this
.
$el
.
find
(
'.transcript-fidelity-wrapper'
);
this
.
selectedFidelityPlan
=
event
.
target
.
value
;
...
...
@@ -116,6 +133,9 @@ function($, Backbone, _, gettext, moment, HtmlUtils, StringUtils, TranscriptSett
// Clear active and selected languages.
this
.
selectedLanguages
=
this
.
activeLanguages
=
[];
// Also clear selected language.
this
.
selectedVideoSourceLanguage
=
''
;
this
.
renderSourceLanguages
();
this
.
renderTargetLanguages
();
},
...
...
@@ -272,8 +292,8 @@ function($, Backbone, _, gettext, moment, HtmlUtils, StringUtils, TranscriptSett
$languagesContainer
.
empty
();
// Show language container if
fidelity or
source language is selected .
if
(
self
.
selectedVideoSourceLanguage
||
self
.
selectedFidelityPlan
)
{
// Show language container if source language is selected .
if
(
self
.
selectedVideoSourceLanguage
)
{
_
.
each
(
self
.
activeLanguages
,
function
(
language
)
{
// Only add if not in the list already.
if
(
_
.
indexOf
(
self
.
selectedLanguages
,
language
)
===
-
1
)
{
...
...
@@ -289,16 +309,18 @@ function($, Backbone, _, gettext, moment, HtmlUtils, StringUtils, TranscriptSett
}
},
render
VideoSourceLanguageMenu
:
function
()
{
render
SourceLanguages
:
function
()
{
var
self
=
this
,
availableTranslations
,
availableLanguages
=
self
.
getTargetLanguages
(),
availableTranslations
=
self
.
getSourceLanguages
(),
$videoSourceLanguageContainer
=
self
.
$el
.
find
(
'.video-source-language-wrapper'
),
$languageMenuEl
=
self
.
$el
.
find
(
'.video-source-language'
),
selectOptionEl
=
new
Option
(
gettext
(
'Select language'
),
''
);
if
(
this
.
selectedProvider
===
THREE_PLAY_MEDIA
)
{
availableTranslations
=
self
.
availableTranscriptionPlans
[
this
.
selectedProvider
].
translations
;
// Clear error state if present any.
self
.
clearPreferenceErrorState
(
$videoSourceLanguageContainer
);
if
(
!
_
.
isEmpty
(
availableTranslations
))
{
$videoSourceLanguageContainer
.
show
();
// We need to set id due to a11y aria-labelledby
...
...
@@ -368,7 +390,7 @@ function($, Backbone, _, gettext, moment, HtmlUtils, StringUtils, TranscriptSett
this
.
renderProviders
();
this
.
renderTurnaround
();
this
.
renderFidelity
();
this
.
render
VideoSourceLanguageMenu
();
this
.
render
SourceLanguages
();
this
.
renderTargetLanguages
();
},
...
...
cms/static/sass/views/_video-upload.scss
View file @
d6acfa67
...
...
@@ -143,9 +143,6 @@
}
.transcript-language-menu-container
{
margin-top
:
(
$baseline
*
0
.8
);
.transcript-language-menu
{
width
:
60%
;
}
.add-language-action
{
display
:
inline-block
;
.action-add-language
{
...
...
@@ -153,6 +150,9 @@
}
}
}
.transcript-language-menu
,
.video-source-language
{
width
:
60%
;
}
}
.course-video-settings-footer
{
...
...
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