Merge pull request #7596 from louyihua/transcript_editor_error_message_i18n
Make some cms strings i18n
This commit is contained in:
@@ -133,7 +133,7 @@ def _create_entrance_exam(request, course_key, entrance_exam_minimum_score_pct=N
|
||||
# Create the entrance exam item (currently it's just a chapter)
|
||||
payload = {
|
||||
'category': "chapter",
|
||||
'display_name': "Entrance Exam",
|
||||
'display_name': _("Entrance Exam"),
|
||||
'parent_locator': unicode(course.location),
|
||||
'is_entrance_exam': True,
|
||||
'in_entrance_exam': True,
|
||||
@@ -143,7 +143,7 @@ def _create_entrance_exam(request, course_key, entrance_exam_minimum_score_pct=N
|
||||
parent_locator=parent_locator,
|
||||
user=request.user,
|
||||
category='chapter',
|
||||
display_name='Entrance Exam',
|
||||
display_name=_('Entrance Exam'),
|
||||
is_entrance_exam=True
|
||||
)
|
||||
|
||||
@@ -177,7 +177,7 @@ def _create_entrance_exam(request, course_key, entrance_exam_minimum_score_pct=N
|
||||
else:
|
||||
description = 'Autogenerated during {} entrance exam creation.'.format(unicode(course.id))
|
||||
milestone = milestones_helpers.add_milestone({
|
||||
'name': 'Completed Course Entrance Exam',
|
||||
'name': _('Completed Course Entrance Exam'),
|
||||
'namespace': milestone_namespace,
|
||||
'description': description
|
||||
})
|
||||
|
||||
@@ -145,7 +145,7 @@ def xblock_type_display_name(xblock, default_display_name=None):
|
||||
return _('Unit')
|
||||
component_class = XBlock.load_class(category, select=settings.XBLOCK_SELECT_FUNCTION)
|
||||
if hasattr(component_class, 'display_name') and component_class.display_name.default:
|
||||
return _(component_class.display_name.default)
|
||||
return _(component_class.display_name.default) # pylint: disable=translation-of-non-string
|
||||
else:
|
||||
return default_display_name
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ function($, Backbone, _, Utils) {
|
||||
this.upload();
|
||||
} else {
|
||||
this.options.messenger
|
||||
.showError('Please select a file in .srt format.');
|
||||
.showError(gettext('Please select a file in .srt format.'));
|
||||
}
|
||||
},
|
||||
|
||||
@@ -182,7 +182,7 @@ function($, Backbone, _, Utils) {
|
||||
*/
|
||||
xhrCompleteHandler: function (xhr) {
|
||||
var resp = JSON.parse(xhr.responseText),
|
||||
err = resp.status || 'Error: Uploading failed.',
|
||||
err = resp.status || gettext('Error: Uploading failed.'),
|
||||
sub = resp.subs;
|
||||
|
||||
this.$progress
|
||||
|
||||
@@ -140,7 +140,7 @@ function($, Backbone, _, Utils, FileUploader, gettext) {
|
||||
importHandler: function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
this.processCommand('replace', 'Error: Import failed.');
|
||||
this.processCommand('replace', gettext('Error: Import failed.'));
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -154,7 +154,7 @@ function($, Backbone, _, Utils, FileUploader, gettext) {
|
||||
replaceHandler: function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
this.processCommand('replace', 'Error: Replacing failed.');
|
||||
this.processCommand('replace', gettext('Error: Replacing failed.'));
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -170,7 +170,7 @@ function($, Backbone, _, Utils, FileUploader, gettext) {
|
||||
|
||||
var videoId = $(event.currentTarget).data('video-id');
|
||||
|
||||
this.processCommand('choose', 'Error: Choosing failed.', videoId);
|
||||
this.processCommand('choose', gettext('Error: Choosing failed.'), videoId);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -184,7 +184,7 @@ function($, Backbone, _, Utils, FileUploader, gettext) {
|
||||
useExistingHandler: function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
this.processCommand('rename', 'Error: Choosing failed.');
|
||||
this.processCommand('rename', gettext('Error: Choosing failed.'));
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -62,7 +62,7 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager) {
|
||||
|
||||
showServerError = function (response) {
|
||||
var errorMessage = response.status ||
|
||||
'Error: Connection with server failed.';
|
||||
gettext('Error: Connection with server failed.');
|
||||
|
||||
self.messenger
|
||||
.render('not_found')
|
||||
@@ -78,7 +78,7 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager) {
|
||||
this.messenger
|
||||
.render('not_found')
|
||||
.showError(
|
||||
'No sources',
|
||||
gettext('No sources'),
|
||||
true // hide buttons
|
||||
);
|
||||
|
||||
@@ -366,7 +366,7 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager) {
|
||||
*/
|
||||
checkIsUniqVideoTypes: function (list) {
|
||||
return this.checkIsValid(
|
||||
this.isUniqVideoTypes, list, 'Link types should be unique.'
|
||||
this.isUniqVideoTypes, list, gettext('Link types should be unique.')
|
||||
);
|
||||
},
|
||||
|
||||
@@ -379,7 +379,7 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager) {
|
||||
*/
|
||||
checkIsUniqOtherVideos: function (list) {
|
||||
return this.checkIsValid(
|
||||
this.isUniqOtherVideos, list, 'Links should be unique.'
|
||||
this.isUniqOtherVideos, list, gettext('Links should be unique.')
|
||||
);
|
||||
},
|
||||
|
||||
@@ -401,7 +401,7 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager) {
|
||||
}
|
||||
|
||||
if (data.mode === 'incorrect' && showErrorModeMessage) {
|
||||
this.messenger.showError('Incorrect url format.', true);
|
||||
this.messenger.showError(gettext('Incorrect url format.'), true);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user