diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 1f1638c54a..ef9b80196f 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -23,6 +23,7 @@ from django.db import IntegrityError, transaction from django.http import (HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, Http404) from django.shortcuts import redirect +from django.utils.translation import ungettext from django_future.csrf import ensure_csrf_cookie from django.utils.http import cookie_date, base36_to_int from django.utils.translation import ugettext as _, get_language @@ -1511,14 +1512,21 @@ def password_reset_confirm_wrapper( num_distinct = settings.ADVANCED_SECURITY_CONFIG['MIN_DIFFERENT_STAFF_PASSWORDS_BEFORE_REUSE'] else: num_distinct = settings.ADVANCED_SECURITY_CONFIG['MIN_DIFFERENT_STUDENT_PASSWORDS_BEFORE_REUSE'] - err_msg = _("You are re-using a password that you have used recently. You must " - "have {0} distinct password(s) before reusing a previous password.").format(num_distinct) + err_msg = ungettext( + "You are re-using a password that you have used recently. You must have {num} distinct password before reusing a previous password.", + "You are re-using a password that you have used recently. You must have {num} distinct passwords before reusing a previous password.", + num_distinct + ).format(num=num_distinct) # also, check to see if passwords are getting reset too frequent if PasswordHistory.is_password_reset_too_soon(user): num_days = settings.ADVANCED_SECURITY_CONFIG['MIN_TIME_IN_DAYS_BETWEEN_ALLOWED_RESETS'] - err_msg = _("You are resetting passwords too frequently. Due to security policies, " - "{0} day(s) must elapse between password resets").format(num_days) + err_msg = ungettext( + # Translators: If you need to use a variable number instead of the number "one", use {num} in its place. + "You are resetting passwords too frequently. Due to security policies, one day must elapse between password resets", + "You are resetting passwords too frequently. Due to security policies, {num} days must elapse between password resets", + num_days + ).format(num=num_days) if err_msg: # We have an password reset attempt which violates some security policy, use the diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py index e4fac7d450..8777a11c08 100644 --- a/common/lib/capa/capa/inputtypes.py +++ b/common/lib/capa/capa/inputtypes.py @@ -703,7 +703,7 @@ class FileSubmission(InputTypeBase): pull queue_len from the msg field. (TODO: get rid of the queue_len hack). """ _ = self.capa_system.i18n.ugettext - submitted_msg = _("Your file(s) have been submitted. As soon as your submission is" + submitted_msg = _("Your files have been submitted. As soon as your submission is" " graded, this message will be replaced with the grader's feedback.") self.submitted_msg = submitted_msg diff --git a/common/lib/xmodule/xmodule/js/fixtures/problem_content.html b/common/lib/xmodule/xmodule/js/fixtures/problem_content.html index af5697bb9a..10354f74fc 100644 --- a/common/lib/xmodule/xmodule/js/fixtures/problem_content.html +++ b/common/lib/xmodule/xmodule/js/fixtures/problem_content.html @@ -1,4 +1,4 @@ -

${_("Problem Header")}

+

Problem Header

@@ -12,11 +12,11 @@ - - - - - ${_("Explanation")} + + + + + Explanation
diff --git a/lms/djangoapps/class_dashboard/tests/test_dashboard_data.py b/lms/djangoapps/class_dashboard/tests/test_dashboard_data.py index a711005766..e228159742 100644 --- a/lms/djangoapps/class_dashboard/tests/test_dashboard_data.py +++ b/lms/djangoapps/class_dashboard/tests/test_dashboard_data.py @@ -236,7 +236,7 @@ class TestGetProblemGradeDistribution(ModuleStoreTestCase): def test_get_students_opened_subsection_csv(self): - tooltip = '4162 student(s) opened Subsection 5: Relational Algebra Exercises' + tooltip = '4162 students opened Subsection 5: Relational Algebra Exercises' attributes = '?module_id=' + self.item.location.to_deprecated_string() + '&tooltip=' + tooltip + '&csv=true' request = self.request_factory.get(reverse('get_students_opened_subsection') + attributes) diff --git a/lms/djangoapps/courseware/tests/test_password_history.py b/lms/djangoapps/courseware/tests/test_password_history.py index de9befecd1..69607ca0b4 100644 --- a/lms/djangoapps/courseware/tests/test_password_history.py +++ b/lms/djangoapps/courseware/tests/test_password_history.py @@ -154,7 +154,7 @@ class TestPasswordHistory(LoginEnrollmentTestCase): student_email, _ = self._setup_user() user = User.objects.get(email=student_email) - err_msg = 'You are re-using a password that you have used recently. You must have 1 distinct password(s)' + err_msg = 'You are re-using a password that you have used recently. You must have 1 distinct password' success_msg = 'Your Password Reset is Complete' token = default_token_generator.make_token(user) @@ -190,7 +190,7 @@ class TestPasswordHistory(LoginEnrollmentTestCase): staff_email, _ = self._setup_user(is_staff=True) user = User.objects.get(email=staff_email) - err_msg = 'You are re-using a password that you have used recently. You must have 2 distinct password(s)' + err_msg = 'You are re-using a password that you have used recently. You must have 2 distinct passwords' success_msg = 'Your Password Reset is Complete' token = default_token_generator.make_token(user) diff --git a/lms/djangoapps/dashboard/sysadmin.py b/lms/djangoapps/dashboard/sysadmin.py index d0c9aed2c6..3bf3a0dae4 100644 --- a/lms/djangoapps/dashboard/sysadmin.py +++ b/lms/djangoapps/dashboard/sysadmin.py @@ -493,8 +493,11 @@ class Courses(SysadminDashboardView): data.append([course.display_name, course.id.to_deprecated_string()] + self.git_info_for_course(gdir)) - return dict(header=[_('Course Name'), _('Directory/ID'), - _('Git Commit'), _('Last Change'), + return dict(header=[_('Course Name'), + _('Directory/ID'), + # Translators: "Git Commit" is a computer command; see http://gitref.org/basic/#commit + _('Git Commit'), + _('Last Change'), _('Last Editor')], title=_('Information about all courses'), data=data) diff --git a/lms/templates/class_dashboard/d3_stacked_bar_graph.js b/lms/templates/class_dashboard/d3_stacked_bar_graph.js index fd1bdb0f33..2b4ca936de 100644 --- a/lms/templates/class_dashboard/d3_stacked_bar_graph.js +++ b/lms/templates/class_dashboard/d3_stacked_bar_graph.js @@ -351,15 +351,19 @@ edx_d3CreateStackedBarGraph = function(parameters, svg, divTooltip) { // Construct the tooltip if (d.tooltip['type'] == 'subsection') { - tooltip_str = d.tooltip['num_students'] + ' ' + gettext('student(s) opened Subsection') + ' ' \ - + d.tooltip['subsection_num'] + ': ' + d.tooltip['subsection_name'] + stud_str = ngettext('%(num_students)s student opened Subsection', '%(num_students)s students opened Subsection', d.tooltip['num_students']); + stud_str = interpolate(stud_str, {'num_students': d.tooltip['num_students']}, true); + tooltip_str = stud_str + ' ' + d.tooltip['subsection_num'] + ': ' + d.tooltip['subsection_name']; }else if (d.tooltip['type'] == 'problem') { + stud_str = ngettext('%(num_students)s student', '%(num_students)s students', d.tooltip['count_grade']); + stud_str = interpolate(stud_str, {'num_students': d.tooltip['count_grade']}, true); + q_str = ngettext('%(num_questions)s question', '%(num_questions)s questions', d.tooltip['max_grade']); + q_str = interpolate(q_str, {'num_questions': d.tooltip['max_grade']}, true); + tooltip_str = d.tooltip['label'] + ' ' + d.tooltip['problem_name'] + ' - ' \ - + d.tooltip['count_grade'] + ' ' + gettext('students') + ' (' \ - + d.tooltip['student_count_percent'] + '%) (' + \ - + d.tooltip['percent'] + '%: ' + \ - + d.tooltip['grade'] +'/' + d.tooltip['max_grade'] + ' ' - + gettext('questions') + ')' + + stud_str + ' (' + d.tooltip['student_count_percent'] + '%) (' \ + + d.tooltip['percent'] + '%: ' + d.tooltip['grade'] +'/' \ + + q_str + ')'; } graph.divTooltip.style("visibility", "visible") .text(tooltip_str); @@ -438,4 +442,4 @@ edx_d3CreateStackedBarGraph = function(parameters, svg, divTooltip) { }; return graph; -}; \ No newline at end of file +}; diff --git a/lms/templates/courseware/instructor_dashboard.html b/lms/templates/courseware/instructor_dashboard.html index c516a23dff..72e874eed5 100644 --- a/lms/templates/courseware/instructor_dashboard.html +++ b/lms/templates/courseware/instructor_dashboard.html @@ -752,7 +752,7 @@ function goto( mode) %endif

- ${_("Student distribution per country, all courses, Sep-12 to Oct-17, 1 server (shown here as an example):")} + ${_("Student distribution per country, all courses, Sep 12 to Oct 17, 1 server (shown here as an example):")}

diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index 3a9220d0d8..0d7feface4 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -110,9 +110,9 @@ function(data) { if (data.success) { $("#change_email_title").html("${_('Please verify your new email')}"); - $("#change_email_form").html("

${_(('You\'ll receive a confirmation in your in-box.' + $("#change_email_form").html("

${_('You\'ll receive a confirmation in your inbox.' ' Please click the link in the email to confirm' - ' the email change.'))}

"); + ' the email change.')}

"); } else { $("#change_email_error").html(data.error).stop().css("display", "block"); }