From 73d8f064997bcf1e1997a93addf962fa1acf29cd Mon Sep 17 00:00:00 2001 From: louyihua Date: Sat, 7 Nov 2015 13:34:59 +0800 Subject: [PATCH] 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"```. --- .../xmodule/js/src/combinedopenended/display.coffee | 2 +- .../js/student_account/views/account_settings_fields.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index ff1120a5bd..86fae4d265 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -325,7 +325,7 @@ class @CombinedOpenEnded @submit_button.hide() @queueing() @grader_status = @$(@grader_status_sel) - @grader_status.html("" + gettext "Your response has been submitted. Please check back later for your grade." + "") + @grader_status.html("" + (gettext "Your response has been submitted. Please check back later for your grade.") + "") else if @child_type == "selfassessment" @setup_score_selection() else if @child_state == 'post_assessment' diff --git a/lms/static/js/student_account/views/account_settings_fields.js b/lms/static/js/student_account/views/account_settings_fields.js index e2cf8e3e26..af90b9b912 100644 --- a/lms/static/js/student_account/views/account_settings_fields.js +++ b/lms/static/js/student_account/views/account_settings_fields.js @@ -11,8 +11,8 @@ successMessage: function() { return this.indicators.success + interpolate_text( gettext( - 'We\'ve sent a confirmation message to {new_email_address}. ' + - 'Click the link in the message to update your email address.' + /* jshint maxlen: false */ + '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()} ); @@ -79,8 +79,8 @@ successMessage: function () { return this.indicators.success + interpolate_text( gettext( - 'We\'ve sent a message to {email_address}. ' + - 'Click the link in the message to reset your password.' + /* jshint maxlen: false */ + '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)} );