Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
b70bd2be
Commit
b70bd2be
authored
Jun 16, 2014
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ngettext rather than "word(s)" for plural phrases
parent
c68fce1f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
23 deletions
+34
-23
common/djangoapps/student/views.py
+12
-4
common/lib/capa/capa/inputtypes.py
+1
-1
common/lib/xmodule/xmodule/js/fixtures/problem_content.html
+6
-6
lms/djangoapps/class_dashboard/tests/test_dashboard_data.py
+1
-1
lms/djangoapps/courseware/tests/test_password_history.py
+2
-2
lms/templates/class_dashboard/d3_stacked_bar_graph.js
+12
-9
No files found.
common/djangoapps/student/views.py
View file @
b70bd2be
...
...
@@ -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
...
...
common/lib/capa/capa/inputtypes.py
View file @
b70bd2be
...
...
@@ -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 file
s
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
...
...
common/lib/xmodule/xmodule/js/fixtures/problem_content.html
View file @
b70bd2be
<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>
lms/djangoapps/class_dashboard/tests/test_dashboard_data.py
View file @
b70bd2be
...
...
@@ -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 student
s
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
)
...
...
lms/djangoapps/courseware/tests/test_password_history.py
View file @
b70bd2be
...
...
@@ -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 password
s
'
success_msg
=
'Your Password Reset is Complete'
token
=
default_token_generator
.
make_token
(
user
)
...
...
lms/templates/class_dashboard/d3_stacked_bar_graph.js
View file @
b70bd2be
...
...
@@ -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
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment