Commit 73d8f064 by louyihua

Fix gettext guidance violation

1. No string concatenation should be used in the gettext function.
2. Some extra parentheses should be used in coffee script, to avoid the following situation: in coffee script, the call ```gettext "text to be extracted" + "text should not be extracted"``` will be translated into ```gettext("text to be extracted" + "text should not be extracted")``` rather than ```gettext("text to be extracted") + "text should not be extracted"```.
parent 625b859c
...@@ -325,7 +325,7 @@ class @CombinedOpenEnded ...@@ -325,7 +325,7 @@ class @CombinedOpenEnded
@submit_button.hide() @submit_button.hide()
@queueing() @queueing()
@grader_status = @$(@grader_status_sel) @grader_status = @$(@grader_status_sel)
@grader_status.html("<span class='grading'>" + gettext "Your response has been submitted. Please check back later for your grade." + "</span>") @grader_status.html("<span class='grading'>" + (gettext "Your response has been submitted. Please check back later for your grade.") + "</span>")
else if @child_type == "selfassessment" else if @child_type == "selfassessment"
@setup_score_selection() @setup_score_selection()
else if @child_state == 'post_assessment' else if @child_state == 'post_assessment'
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
successMessage: function() { successMessage: function() {
return this.indicators.success + interpolate_text( return this.indicators.success + interpolate_text(
gettext( gettext(
'We\'ve sent a confirmation message to {new_email_address}. ' + /* jshint maxlen: false */
'Click the link in the message to update your email address.' 'We\'ve sent a confirmation message to {new_email_address}. Click the link in the message to update your email address.'
), ),
{'new_email_address': this.fieldValue()} {'new_email_address': this.fieldValue()}
); );
...@@ -79,8 +79,8 @@ ...@@ -79,8 +79,8 @@
successMessage: function () { successMessage: function () {
return this.indicators.success + interpolate_text( return this.indicators.success + interpolate_text(
gettext( gettext(
'We\'ve sent a message to {email_address}. ' + /* jshint maxlen: false */
'Click the link in the message to reset your password.' 'We\'ve sent a message to {email_address}. Click the link in the message to reset your password.'
), ),
{'email_address': this.model.get(this.options.emailAttribute)} {'email_address': this.model.get(this.options.emailAttribute)}
); );
......
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