Merge pull request #4121 from edx/sarina/fix-i18n-bugs
Fix i18n translation issues
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<h2 class="problem-header">${_("Problem Header")}</h2>
|
||||
<h2 class="problem-header">Problem Header</h2>
|
||||
|
||||
<div class='problem-progress'></div>
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
<span id="display_example_1"></span>
|
||||
<span id="input_example_1_dynamath"></span>
|
||||
|
||||
<input class="check" type="button" value="${_('Check')}">
|
||||
<input class="reset" type="button" value="${_('Reset')}">
|
||||
<input class="save" type="button" value="${_('Save')}">
|
||||
<button class="show"><span class="show-label">${_("Show Answer(s)")}</span> <span class="sr">(for question(s) above - adjacent to each field)</span></button>
|
||||
<a href="/courseware/6.002_Spring_2012/${ explain }" class="new-page">${_("Explanation")}</a>
|
||||
<input class="check" type="button" value="Check">
|
||||
<input class="reset" type="button" value="Reset">
|
||||
<input class="save" type="button" value="Save">
|
||||
<button class="show"><span class="show-label">Show Answer(s)</span> <span class="sr">(for question(s) above - adjacent to each field)</span></button>
|
||||
<a href="/courseware/6.002_Spring_2012/${ explain }" class="new-page">Explanation</a>
|
||||
<div class="submission_feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -752,7 +752,7 @@ function goto( mode)
|
||||
%endif
|
||||
|
||||
<p>
|
||||
${_("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):")}
|
||||
</p>
|
||||
|
||||
<div id="posts-list" class="clearfix">
|
||||
|
||||
@@ -110,9 +110,9 @@
|
||||
function(data) {
|
||||
if (data.success) {
|
||||
$("#change_email_title").html("${_('Please verify your new email')}");
|
||||
$("#change_email_form").html("<p>${_(('You\'ll receive a confirmation in your in-box.'
|
||||
$("#change_email_form").html("<p>${_('You\'ll receive a confirmation in your inbox.'
|
||||
' Please click the link in the email to confirm'
|
||||
' the email change.'))}</p>");
|
||||
' the email change.')}</p>");
|
||||
} else {
|
||||
$("#change_email_error").html(data.error).stop().css("display", "block");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user