Commit 2f67ae0f by Omar Al-Ithawi

Make the submission confirmation message translatable

parent 037474a1
...@@ -246,6 +246,7 @@ OpenAssessment.ResponseView.prototype = { ...@@ -246,6 +246,7 @@ OpenAssessment.ResponseView.prototype = {
else { else {
if (enabled) { if (enabled) {
window.onbeforeunload = function() { window.onbeforeunload = function() {
// Keep this on one big line to avoid gettext bug: http://stackoverflow.com/a/24579117
return gettext("If you leave this page without saving or submitting your response, you'll lose any work you've done on the response."); return gettext("If you leave this page without saving or submitting your response, you'll lose any work you've done on the response.");
}; };
} }
...@@ -433,10 +434,8 @@ OpenAssessment.ResponseView.prototype = { ...@@ -433,10 +434,8 @@ OpenAssessment.ResponseView.prototype = {
* rejected if the user cancels the submission * rejected if the user cancels the submission
**/ **/
confirmSubmission: function() { confirmSubmission: function() {
var msg = ( // Keep this on one big line to avoid gettext bug: http://stackoverflow.com/a/24579117
"You're about to submit your response for this assignment. " + var msg = gettext("You're about to submit your response for this assignment. After you submit this response, you can't change it or submit a new response.");
"After you submit this response, you can't change it or submit a new response."
);
// TODO -- UI for confirmation dialog instead of JS confirm // TODO -- UI for confirmation dialog instead of JS confirm
return $.Deferred(function(defer) { return $.Deferred(function(defer) {
if (confirm(msg)) { defer.resolve(); } if (confirm(msg)) { defer.resolve(); }
......
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