Update user strings

This commit is contained in:
Mushtaq Ali
2018-01-08 15:38:10 +05:00
parent 00a86ccef8
commit 10d79b0047
6 changed files with 17 additions and 19 deletions

View File

@@ -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']))

View File

@@ -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:

View File

@@ -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();

View File

@@ -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);
}

View File

@@ -1,5 +1,5 @@
<span class="fa <%- iconClasses %>" aria-hidden="true"></span>
<span class='transcript-detail-status'><%- shortMessage %></span>
<button class='button-link more-details-action <%- hiddenClass %>' data-error-message='<%- errorMessage %>'>
<%- gettext('Read More') %>
<%- gettext('Read more') %>
</button>

View File

@@ -9,7 +9,7 @@
</strong>
</button>
<% } else { %>
<span class='transcripts-empty-text'><%- gettext('No transcript available yet.') %></span>
<span class='transcripts-empty-text'><%- gettext('No transcript uploaded.') %></span>
<% }%>
<div class='show-video-transcripts-wrapper hidden'>
<% _.each(transcripts, function(transcriptLanguageText, transcriptLanguageCode){ %>