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
cec4bb31
Commit
cec4bb31
authored
Apr 15, 2015
by
muhammad-ammar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Simplified and Traditional Chinese as Transcript language options
TNL-1740
parent
b3ab7fce
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
131 additions
and
0 deletions
+131
-0
common/test/acceptance/tests/video/test_studio_video_editor.py
+43
-0
common/test/acceptance/tests/video/test_video_module.py
+30
-0
common/test/data/uploads/simplified_chinese.srt
+28
-0
common/test/data/uploads/traditional_chinese.srt
+28
-0
lms/envs/common.py
+2
-0
No files found.
common/test/acceptance/tests/video/test_studio_video_editor.py
View file @
cec4bb31
...
...
@@ -509,3 +509,46 @@ class VideoEditorTest(CMSVideoBaseTest):
self
.
assertTrue
(
self
.
video
.
is_captions_visible
())
unicode_text
=
"莎拉·佩林 (Sarah Palin)"
.
decode
(
'utf-8'
)
self
.
assertIn
(
unicode_text
,
self
.
video
.
captions_lines
())
def
test_simplified_and_traditional_chinese_transcripts_uploading
(
self
):
"""
Scenario: Translations uploading works correctly
Given I have created a Video component
And I edit the component
And I open tab "Advanced"
And I upload transcript file "simplified_chinese.srt" for "zh_HANS" language code
And I save changes
Then when I view the video it does show the captions
And I see "在线学习是革" text in the captions
And I edit the component
And I open tab "Advanced"
And I upload transcript file "traditional_chinese.srt" for "zh_HANT" language code
And I save changes
Then when I view the video it does show the captions
And I see "在線學習是革" text in the captions
And video subtitle menu has 'zh_HANS', 'zh_HANT' translations for 'Simplified Chinese'
and 'Traditional Chinese' respectively
"""
self
.
_create_video_component
()
langs_info
=
[
(
'zh_HANS'
,
'simplified_chinese.srt'
,
'在线学习是革'
),
(
'zh_HANT'
,
'traditional_chinese.srt'
,
'在線學習是革'
)
]
for
lang_code
,
lang_file
,
lang_text
in
langs_info
:
self
.
edit_component
()
self
.
open_advanced_tab
()
self
.
video
.
upload_translation
(
lang_file
,
lang_code
)
self
.
save_unit_settings
()
self
.
assertTrue
(
self
.
video
.
is_captions_visible
())
# If there is only one language then there will be no subtitle/captions menu
if
lang_code
==
'zh_HANT'
:
self
.
video
.
select_language
(
lang_code
)
unicode_text
=
lang_text
.
decode
(
'utf-8'
)
self
.
assertIn
(
unicode_text
,
self
.
video
.
captions_text
)
self
.
assertEqual
(
self
.
video
.
caption_languages
,
{
'zh_HANS'
:
'Simplified Chinese'
,
'zh_HANT'
:
'Traditional Chinese'
})
common/test/acceptance/tests/video/test_video_module.py
View file @
cec4bb31
...
...
@@ -679,6 +679,36 @@ class YouTubeVideoTest(VideoBaseTest):
self
.
assertGreaterEqual
(
self
.
video
.
seconds
,
10
)
def
test_simplified_and_traditional_chinese_transcripts
(
self
):
"""
Scenario: Simplified and Traditional Chinese transcripts work as expected in Youtube mode
Given the course has a Video component in "Youtube" mode
And I have defined a Simplified Chinese transcript for the video
And I have defined a Traditional Chinese transcript for the video
Then I see the correct subtitle language options in cc menu
Then I see the correct text in the captions for Simplified and Traditional Chinese transcripts
And I can download the transcripts for Simplified and Traditional Chinese
And video subtitle menu has 'zh_HANS', 'zh_HANT' translations for 'Simplified Chinese'
and 'Traditional Chinese' respectively
"""
data
=
{
'download_track'
:
True
,
'transcripts'
:
{
'zh_HANS'
:
'simplified_chinese.srt'
,
'zh_HANT'
:
'traditional_chinese.srt'
}
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
data
)
self
.
assets
.
extend
([
'simplified_chinese.srt'
,
'traditional_chinese.srt'
])
self
.
navigate_to_video
()
langs
=
{
'zh_HANS'
:
'在线学习是革'
,
'zh_HANT'
:
'在線學習是革'
}
for
lang_code
,
text
in
langs
.
items
():
self
.
assertTrue
(
self
.
video
.
select_language
(
lang_code
))
unicode_text
=
text
.
decode
(
'utf-8'
)
self
.
assertIn
(
unicode_text
,
self
.
video
.
captions_text
)
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
unicode_text
))
self
.
assertEqual
(
self
.
video
.
caption_languages
,
{
'zh_HANS'
:
'Simplified Chinese'
,
'zh_HANT'
:
'Traditional Chinese'
})
class
YouTubeHtml5VideoTest
(
VideoBaseTest
):
""" Test YouTube HTML5 Video Player """
...
...
common/test/data/uploads/simplified_chinese.srt
0 → 100644
View file @
cec4bb31
0
00:00:00,260 --> 00:00:01,510
ANANT AGARWAL:欢迎EDX
1
00:00:01,510 --> 00:00:04,480
我阿南特阿加瓦尔,我EDX的总裁,
2
00:00:04,480 --> 00:00:07,430
我也是电气工程和计算机科学教授
3
00:00:07,430 --> 00:00:08,400
在麻省理工学院
4
00:00:08,400 --> 00:00:11,120
在线学习是革命性的世界
5
00:00:11,120 --> 00:00:14,290
教育永远不会再是相同的,和EDX
6
00:00:14,290 --> 00:00:16,650
在这个革命的前沿
\ No newline at end of file
common/test/data/uploads/traditional_chinese.srt
0 → 100644
View file @
cec4bb31
0
00:00:00,260 --> 00:00:01,510
ANANT AGARWAL:歡迎EDX
1
00:00:01,510 --> 00:00:04,480
我阿南特阿加瓦爾,我EDX總裁
2
00:00:04,480 --> 00:00:07,430
我也是電氣工程和計算機科學教授
3
00:00:07,430 --> 00:00:08,400
在麻省理工學院
4
00:00:08,400 --> 00:00:11,120
在線學習是革命性的世界
5
00:00:11,120 --> 00:00:14,290
教育永遠不會再是相同的,和EDX
6
00:00:14,290 --> 00:00:16,650
在這個革命的前沿
\ No newline at end of file
lms/envs/common.py
View file @
cec4bb31
...
...
@@ -1939,6 +1939,8 @@ ALL_LANGUAGES = (
[
u"ch"
,
u"Chamorro"
],
[
u"ce"
,
u"Chechen"
],
[
u"zh"
,
u"Chinese"
],
[
u"zh_HANS"
,
u"Simplified Chinese"
],
[
u"zh_HANT"
,
u"Traditional Chinese"
],
[
u"cu"
,
u"Church Slavic"
],
[
u"cv"
,
u"Chuvash"
],
[
u"kw"
,
u"Cornish"
],
...
...
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