Commit fc0cae91 by Muhammad Shoaib

internationalize the strings

parent 3e2d70ea
var edx = edx || {};
(function (Backbone, $, _) {
(function (Backbone, $, _, gettext) {
'use strict';
edx.instructor_dashboard = edx.instructor_dashboard || {};
......@@ -116,7 +116,7 @@ var edx = edx || {};
$.each(values, function(key, value) {
if (value==="") {
formHasErrors = true;
self.showError(self, key, "Required field");
self.showError(self, key, gettext("Required field"));
}
else {
self.hideError(self, key);
......@@ -144,7 +144,7 @@ var edx = edx || {};
},
error: function(self, response, options) {
var data = $.parseJSON(response.responseText);
error_response.html(data.detail);
error_response.html(gettext(data.detail));
}
});
}
......@@ -167,4 +167,4 @@ var edx = edx || {};
return this;
}
});
}).call(this, Backbone, $, _);
}).call(this, Backbone, $, _, gettext);
......@@ -17,8 +17,8 @@ var edx = edx || {};
/* this should be moved to a 'data' attribute in HTML */
this.tempate_url = '/static/proctoring/templates/course_allowances.underscore';
this.template = null;
this.allowance_url = this.collection.url + 'allowance';
this.initial_url = this.collection.url;
this.allowance_url = this.initial_url + 'allowance';
/* re-render if the model changes */
this.listenTo(this.collection, 'change', this.collectionChanged);
......
<div class='modal-header'>Add a new Allowance</div>
<div class='modal-header'><%- gettext("Add a new Allowance") %></div>
<form>
<h3 class='error-response'><h3>
<table class='compact'>
<tr>
<td>
<label>Proctored Exam</label>
<label><%- gettext("Proctored Exam") %></label>
</td>
<td>
<select id='proctored_exam'>
<% _.each(proctored_exams, function(proctored_exam){ %>
<option value="<%= proctored_exam.id %>"><%= proctored_exam.exam_name %></option>
<option value="<%= proctored_exam.id %>">
<%- interpolate(gettext(' %(exam_display_name)s '), { exam_display_name: proctored_exam.exam_name }, true) %>
</option>
<% }); %>
</select>
</td>
</tr>
<tr>
<td>
<label>Allowance Type</label>
<label><%- gettext("Allowance Type") %></label>
</td>
<td>
<select id="allowance_type">
<% _.each(allowance_types, function(allowance_type){ %>
<option value="<%= allowance_type %>"><%= allowance_type %></option>
<option value="<%= allowance_type %>">
<%- interpolate(gettext(' %(allowance_type)s '), { allowance_type: allowance_type }, true) %>
</option>
<% }); %>
</select>
</td>
</tr>
<tr>
<td>
<label>Value</label>
<label><%- gettext("Value") %></label>
</td>
<td>
<input type="text" id="allowance_value" />
......@@ -36,7 +40,7 @@
</tr>
<tr>
<td>
<label>Username or Email</label>
<label><%- gettext("Username or Email") %></label>
</td>
<td>
<input type="text" id="user_info" />
......
......@@ -44,7 +44,7 @@
<td>
<a data-exam-id="<%= proctored_exam_allowance.proctored_exam.id %>"
data-key-name="<%= proctored_exam_allowance.key %>"
data-user-id="<%= proctored_exam_allowance.user_id %>"
data-user-id="<%= proctored_exam_allowance.user.id %>"
class="remove_allowance" href="#">[x]</a>
</td>
</tr>
......
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