Commit 297d94a3 by louyihua

Make some strings i18n

parent cd8147cb
...@@ -133,7 +133,7 @@ def _create_entrance_exam(request, course_key, entrance_exam_minimum_score_pct=N ...@@ -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) # Create the entrance exam item (currently it's just a chapter)
payload = { payload = {
'category': "chapter", 'category': "chapter",
'display_name': "Entrance Exam", 'display_name': _("Entrance Exam"),
'parent_locator': unicode(course.location), 'parent_locator': unicode(course.location),
'is_entrance_exam': True, 'is_entrance_exam': True,
'in_entrance_exam': True, 'in_entrance_exam': True,
...@@ -143,7 +143,7 @@ def _create_entrance_exam(request, course_key, entrance_exam_minimum_score_pct=N ...@@ -143,7 +143,7 @@ def _create_entrance_exam(request, course_key, entrance_exam_minimum_score_pct=N
parent_locator=parent_locator, parent_locator=parent_locator,
user=request.user, user=request.user,
category='chapter', category='chapter',
display_name='Entrance Exam', display_name=_('Entrance Exam'),
is_entrance_exam=True is_entrance_exam=True
) )
...@@ -177,7 +177,7 @@ def _create_entrance_exam(request, course_key, entrance_exam_minimum_score_pct=N ...@@ -177,7 +177,7 @@ def _create_entrance_exam(request, course_key, entrance_exam_minimum_score_pct=N
else: else:
description = 'Autogenerated during {} entrance exam creation.'.format(unicode(course.id)) description = 'Autogenerated during {} entrance exam creation.'.format(unicode(course.id))
milestone = milestones_helpers.add_milestone({ milestone = milestones_helpers.add_milestone({
'name': 'Completed Course Entrance Exam', 'name': _('Completed Course Entrance Exam'),
'namespace': milestone_namespace, 'namespace': milestone_namespace,
'description': description 'description': description
}) })
......
...@@ -145,7 +145,7 @@ def xblock_type_display_name(xblock, default_display_name=None): ...@@ -145,7 +145,7 @@ def xblock_type_display_name(xblock, default_display_name=None):
return _('Unit') return _('Unit')
component_class = XBlock.load_class(category, select=settings.XBLOCK_SELECT_FUNCTION) component_class = XBlock.load_class(category, select=settings.XBLOCK_SELECT_FUNCTION)
if hasattr(component_class, 'display_name') and component_class.display_name.default: 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: else:
return default_display_name return default_display_name
......
...@@ -104,7 +104,7 @@ function($, Backbone, _, Utils) { ...@@ -104,7 +104,7 @@ function($, Backbone, _, Utils) {
this.upload(); this.upload();
} else { } else {
this.options.messenger 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) { ...@@ -182,7 +182,7 @@ function($, Backbone, _, Utils) {
*/ */
xhrCompleteHandler: function (xhr) { xhrCompleteHandler: function (xhr) {
var resp = JSON.parse(xhr.responseText), var resp = JSON.parse(xhr.responseText),
err = resp.status || 'Error: Uploading failed.', err = resp.status || gettext('Error: Uploading failed.'),
sub = resp.subs; sub = resp.subs;
this.$progress this.$progress
......
...@@ -140,7 +140,7 @@ function($, Backbone, _, Utils, FileUploader, gettext) { ...@@ -140,7 +140,7 @@ function($, Backbone, _, Utils, FileUploader, gettext) {
importHandler: function (event) { importHandler: function (event) {
event.preventDefault(); event.preventDefault();
this.processCommand('replace', 'Error: Import failed.'); this.processCommand('replace', gettext('Error: Import failed.'));
}, },
/** /**
...@@ -154,7 +154,7 @@ function($, Backbone, _, Utils, FileUploader, gettext) { ...@@ -154,7 +154,7 @@ function($, Backbone, _, Utils, FileUploader, gettext) {
replaceHandler: function (event) { replaceHandler: function (event) {
event.preventDefault(); event.preventDefault();
this.processCommand('replace', 'Error: Replacing failed.'); this.processCommand('replace', gettext('Error: Replacing failed.'));
}, },
/** /**
...@@ -170,7 +170,7 @@ function($, Backbone, _, Utils, FileUploader, gettext) { ...@@ -170,7 +170,7 @@ function($, Backbone, _, Utils, FileUploader, gettext) {
var videoId = $(event.currentTarget).data('video-id'); 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) { ...@@ -184,7 +184,7 @@ function($, Backbone, _, Utils, FileUploader, gettext) {
useExistingHandler: function (event) { useExistingHandler: function (event) {
event.preventDefault(); event.preventDefault();
this.processCommand('rename', 'Error: Choosing failed.'); this.processCommand('rename', gettext('Error: Choosing failed.'));
}, },
/** /**
......
...@@ -62,7 +62,7 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager) { ...@@ -62,7 +62,7 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager) {
showServerError = function (response) { showServerError = function (response) {
var errorMessage = response.status || var errorMessage = response.status ||
'Error: Connection with server failed.'; gettext('Error: Connection with server failed.');
self.messenger self.messenger
.render('not_found') .render('not_found')
...@@ -78,7 +78,7 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager) { ...@@ -78,7 +78,7 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager) {
this.messenger this.messenger
.render('not_found') .render('not_found')
.showError( .showError(
'No sources', gettext('No sources'),
true // hide buttons true // hide buttons
); );
...@@ -366,7 +366,7 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager) { ...@@ -366,7 +366,7 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager) {
*/ */
checkIsUniqVideoTypes: function (list) { checkIsUniqVideoTypes: function (list) {
return this.checkIsValid( 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) { ...@@ -379,7 +379,7 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager) {
*/ */
checkIsUniqOtherVideos: function (list) { checkIsUniqOtherVideos: function (list) {
return this.checkIsValid( 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) { ...@@ -401,7 +401,7 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager) {
} }
if (data.mode === 'incorrect' && showErrorModeMessage) { if (data.mode === 'incorrect' && showErrorModeMessage) {
this.messenger.showError('Incorrect url format.', true); this.messenger.showError(gettext('Incorrect url format.'), true);
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment