From 10d79b00472a148189803c92e11b42562f63cd96 Mon Sep 17 00:00:00 2001 From: Mushtaq Ali Date: Mon, 8 Jan 2018 15:38:10 +0500 Subject: [PATCH] Update user strings --- .../views/tests/test_transcript_settings.py | 14 +++++++------- .../contentstore/views/transcript_settings.py | 6 +++--- cms/static/js/spec/views/video_transcripts_spec.js | 4 ++-- cms/static/js/views/video_transcripts.js | 8 +++----- .../js/video-transcript-upload-status.underscore | 2 +- cms/templates/js/video-transcripts.underscore | 2 +- 6 files changed, 17 insertions(+), 19 deletions(-) diff --git a/cms/djangoapps/contentstore/views/tests/test_transcript_settings.py b/cms/djangoapps/contentstore/views/tests/test_transcript_settings.py index 27ac75deec..05dc62a011 100644 --- a/cms/djangoapps/contentstore/views/tests/test_transcript_settings.py +++ b/cms/djangoapps/contentstore/views/tests/test_transcript_settings.py @@ -258,15 +258,15 @@ class TranscriptDownloadTest(CourseTestCase): @ddt.data( ( {}, - u'Following parameters are required: edx_video_id, language_code.' + u'The following parameters are required: edx_video_id, language_code.' ), ( {'edx_video_id': '123'}, - u'Following parameters are required: language_code.' + u'The following parameters are required: language_code.' ), ( {'language_code': 'en'}, - u'Following parameters are required: edx_video_id.' + u'The following parameters are required: edx_video_id.' ), ) @ddt.unpack @@ -370,7 +370,7 @@ class TranscriptUploadTest(CourseTestCase): 'language_code': u'en', 'file': u'0\n00:00:00,010 --> 00:00:00,100\nHi, welcome to Edx.\n\n' }, - u'Following parameters are required: edx_video_id, new_language_code.' + u'The following parameters are required: edx_video_id, new_language_code.' ), ( { @@ -378,13 +378,13 @@ class TranscriptUploadTest(CourseTestCase): 'new_language_code': u'en', 'file': u'0\n00:00:00,010 --> 00:00:00,100\nHi, welcome to Edx.\n\n' }, - u'Following parameters are required: edx_video_id.' + u'The following parameters are required: edx_video_id.' ), ( { 'file': u'0\n00:00:00,010 --> 00:00:00,100\nHi, welcome to Edx.\n\n' }, - u'Following parameters are required: edx_video_id, language_code, new_language_code.' + u'The following parameters are required: edx_video_id, language_code, new_language_code.' ) ) @ddt.unpack @@ -416,7 +416,7 @@ class TranscriptUploadTest(CourseTestCase): self.assertEqual(response.status_code, 400) self.assertEqual( json.loads(response.content)['error'], - u'Transcript with "es" language code is already present.' + u'A transcript with the "es" language code already exists.' ) @patch('contentstore.views.transcript_settings.get_available_transcript_languages', Mock(return_value=['en'])) diff --git a/cms/djangoapps/contentstore/views/transcript_settings.py b/cms/djangoapps/contentstore/views/transcript_settings.py index fc7347ef82..e5457aee9b 100644 --- a/cms/djangoapps/contentstore/views/transcript_settings.py +++ b/cms/djangoapps/contentstore/views/transcript_settings.py @@ -143,7 +143,7 @@ def transcript_download_handler(request, course_key_string): missing = [attr for attr in ['edx_video_id', 'language_code'] if attr not in request.GET] if missing: return JsonResponse( - {'error': _(u'Following parameters are required: {missing}.').format(missing=', '.join(missing))}, + {'error': _(u'The following parameters are required: {missing}.').format(missing=', '.join(missing))}, status=400 ) @@ -183,12 +183,12 @@ def validate_transcript_upload_data(data, files): must_have_attrs = ['edx_video_id', 'language_code', 'new_language_code'] missing = [attr for attr in must_have_attrs if attr not in data] if missing: - error = _(u'Following parameters are required: {missing}.').format(missing=', '.join(missing)) + error = _(u'The following parameters are required: {missing}.').format(missing=', '.join(missing)) elif ( data['language_code'] != data['new_language_code'] and data['new_language_code'] in get_available_transcript_languages([data['edx_video_id']]) ): - error = _(u'Transcript with "{language_code}" language code is already present.'.format( + error = _(u'A transcript with the "{language_code}" language code already exists.'.format( language_code=data['new_language_code'] )) elif 'file' not in files: diff --git a/cms/static/js/spec/views/video_transcripts_spec.js b/cms/static/js/spec/views/video_transcripts_spec.js index b820e5bacc..8dfcd31da3 100644 --- a/cms/static/js/spec/views/video_transcripts_spec.js +++ b/cms/static/js/spec/views/video_transcripts_spec.js @@ -207,7 +207,7 @@ define( // Verify appropriate text is shown expect( videoTranscriptsView.$el.find('.transcripts-empty-text').html() - ).toEqual('No transcript available yet.'); + ).toEqual('No transcript uploaded.'); }); it('renders correct transcript attributes', function() { @@ -324,7 +324,7 @@ define( it('should show error message in case of unsupported transcript file format', function() { var languageCode = 'en', transcriptFileName = 'unsupported-transcript-file-format.txt', - errorMessage = transcriptFileName + ' is not in a supported file format. Supported file format is ' + TRANSCRIPT_DOWNLOAD_FILE_FORMAT + '.', // eslint-disable-line max-len + errorMessage = 'This file type is not supported. Supported file type is ' + TRANSCRIPT_DOWNLOAD_FILE_FORMAT + '.', // eslint-disable-line max-len $transcriptEl = videoTranscriptsView.$el.find('.show-video-transcript-content[data-language-code="' + languageCode + '"]'); // eslint-disable-line max-len $transcriptEl.find('.upload-transcript-button').click(); diff --git a/cms/static/js/views/video_transcripts.js b/cms/static/js/views/video_transcripts.js index b755cfa2f9..ca09a91ab6 100644 --- a/cms/static/js/views/video_transcripts.js +++ b/cms/static/js/views/video_transcripts.js @@ -24,7 +24,7 @@ define( this.videoTranscriptSettings = options.videoTranscriptSettings; this.template = HtmlUtils.template(videoTranscriptsTemplate); this.transcriptUploadStatusTemplate = HtmlUtils.template(videoTranscriptUploadStatusTemplate); - this.defaultFailureTitle = gettext('Your file could not be uploaded'); + this.defaultFailureTitle = gettext('The file could not be uploaded.'); this.defaultFailureMessage = gettext('This may be happening because of an error with our server or your internet connection. Try refreshing the page or making sure you are online.'); // eslint-disable-line max-len this.transcriptUploadStatuses = { uploaded: { @@ -36,7 +36,7 @@ define( uploading: { statusClass: '', iconClasses: 'fa-spinner fa-pulse', - shortMessage: 'Uploading transcript', + shortMessage: 'Uploading transcript.', hiddenClass: 'hidden' }, failed: { @@ -119,10 +119,8 @@ define( if (fileType !== this.videoTranscriptSettings.trancript_download_file_format) { errorMessage = gettext( - '{filename} is not in a supported file format. ' + - 'Supported file format is {supportedFileFormat}.' + 'This file type is not supported. Supported file type is {supportedFileFormat}.' ) - .replace('{filename}', fileName) .replace('{supportedFileFormat}', this.videoTranscriptSettings.trancript_download_file_format); } diff --git a/cms/templates/js/video-transcript-upload-status.underscore b/cms/templates/js/video-transcript-upload-status.underscore index a296813fe1..3c35664625 100644 --- a/cms/templates/js/video-transcript-upload-status.underscore +++ b/cms/templates/js/video-transcript-upload-status.underscore @@ -1,5 +1,5 @@ <%- shortMessage %> diff --git a/cms/templates/js/video-transcripts.underscore b/cms/templates/js/video-transcripts.underscore index 5f63ed0c2e..2bf4f79824 100644 --- a/cms/templates/js/video-transcripts.underscore +++ b/cms/templates/js/video-transcripts.underscore @@ -9,7 +9,7 @@ <% } else { %> - <%- gettext('No transcript available yet.') %> + <%- gettext('No transcript uploaded.') %> <% }%>