Commit b7849799 by David Baumgold

Merge pull request #1792 from edx/man2life-i18n-no-forums

i18n (no forums)
parents 63a48114 03d7d0e9
...@@ -61,7 +61,7 @@ require(["domReady!", "jquery", "jquery.form", "js/index"], function(doc, $) { ...@@ -61,7 +61,7 @@ require(["domReady!", "jquery", "jquery.form", "js/index"], function(doc, $) {
<article class="content-primary" role="main"> <article class="content-primary" role="main">
<div class="introduction"> <div class="introduction">
<h2 class="title">${_("Welcome, {0}!".format(user.username))}</h2> <h2 class="title">${_("Welcome, {0}!").format(user.username)}</h2>
%if len(courses) > 0: %if len(courses) > 0:
<div class="copy"> <div class="copy">
......
...@@ -296,7 +296,7 @@ class @StaffGrading ...@@ -296,7 +296,7 @@ class @StaffGrading
submission_id: @submission_id submission_id: @submission_id
location: @location location: @location
submission_flagged: @flag_submission_checkbox.is(':checked') submission_flagged: @flag_submission_checkbox.is(':checked')
@gentle_alert "Grades saved. Fetching the next submission to grade." @gentle_alert gettext("Grades saved. Fetching the next submission to grade.")
@backend.post('save_grade', data, @ajax_callback) @backend.post('save_grade', data, @ajax_callback)
gentle_alert: (msg) => gentle_alert: (msg) =>
...@@ -344,11 +344,11 @@ class @StaffGrading ...@@ -344,11 +344,11 @@ class @StaffGrading
# clear the problem list and breadcrumbs # clear the problem list and breadcrumbs
@problem_list.html(''' @problem_list.html('''
<tr> <tr>
<th>Problem Name</th> <th>''' + gettext("Problem Name") + '''</th>
<th>Graded</th> <th>''' + gettext("Graded") + '''</th>
<th>Available to Grade</th> <th>''' + gettext("Available to Grade") + '''</th>
<th>Required</th> <th>''' + gettext("Required") + '''</th>
<th>Progress</th> <th>''' + gettext("Progress") + '''</th>
</tr> </tr>
''') ''')
@breadcrumbs.html('') @breadcrumbs.html('')
...@@ -410,7 +410,7 @@ class @StaffGrading ...@@ -410,7 +410,7 @@ class @StaffGrading
show_action_button = true show_action_button = true
problem_list_link = $('<a>').attr('href', 'javascript:void(0);') problem_list_link = $('<a>').attr('href', 'javascript:void(0);')
.append("< Back to problem list") .append("< " + gettext("Back to problem list"))
.click => @get_problem_list() .click => @get_problem_list()
# set up the breadcrumbing # set up the breadcrumbing
...@@ -418,15 +418,19 @@ class @StaffGrading ...@@ -418,15 +418,19 @@ class @StaffGrading
if @state == state_error if @state == state_error
@set_button_text('Try loading again') @set_button_text(gettext('Try loading again'))
show_action_button = true show_action_button = true
else if @state == state_grading else if @state == state_grading
@ml_error_info_container.html(@ml_error_info) @ml_error_info_container.html(@ml_error_info)
available = _.template(gettext("<%= num %> available"), {num: @num_pending})
graded = _.template(gettext("<%= num %> graded"), {num: @num_graded})
needed = _.template(gettext("<%= num %> more needed to start ML"),
{num: Math.max(@min_for_ml - @num_graded, 0)})
meta_list = $("<div>") meta_list = $("<div>")
meta_list.append("<div class='meta-info'>#{@num_pending} available | </div>") .append("<div class='meta-info'>#{available}</div>")
meta_list.append("<div class='meta-info'>#{@num_graded} graded | </div>") .append("<div class='meta-info'>#{graded}</div>")
meta_list.append("<div class='meta-info'>#{Math.max(@min_for_ml - @num_graded, 0)} more needed to start ML </div><br/>") .append("<div class='meta-info'>#{needed}</div>")
@problem_meta_info.html(meta_list) @problem_meta_info.html(meta_list)
@prompt_container.html(@prompt) @prompt_container.html(@prompt)
...@@ -439,15 +443,15 @@ class @StaffGrading ...@@ -439,15 +443,15 @@ class @StaffGrading
@setup_score_selection() @setup_score_selection()
else if @state == state_graded else if @state == state_graded
@set_button_text('Submit') @set_button_text(gettext('Submit'))
show_action_button = false show_action_button = false
else if @state == state_no_data else if @state == state_no_data
@message_container.html(@message) @message_container.html(@message)
@set_button_text('Re-check for submissions') @set_button_text(gettext('Re-check for submissions'))
else else
@error('System got into invalid state ' + @state) @error(_.template(gettext('System got into invalid state: <%= state %>'), {state: @state}))
@submit_button.toggle(show_submit_button) @submit_button.toggle(show_submit_button)
@action_button.toggle(show_action_button) @action_button.toggle(show_action_button)
...@@ -462,17 +466,17 @@ class @StaffGrading ...@@ -462,17 +466,17 @@ class @StaffGrading
else if @state == state_no_data else if @state == state_no_data
@get_next_submission(@location) @get_next_submission(@location)
else else
@error('System got into invalid state for submission: ' + @state) @error(gettext('System got into invalid state for submission: ') + @state)
collapse_question: () => collapse_question: () =>
@prompt_container.slideToggle() @prompt_container.slideToggle()
@prompt_container.toggleClass('open') @prompt_container.toggleClass('open')
if @question_header.text() == "(Hide)" if @question_header.text() == gettext("(Hide)")
Logger.log 'staff_grading_hide_question', {location: @location} Logger.log 'staff_grading_hide_question', {location: @location}
new_text = "(Show)" new_text = gettext("(Show)")
else else
Logger.log 'staff_grading_show_question', {location: @location} Logger.log 'staff_grading_show_question', {location: @location}
new_text = "(Hide)" new_text = gettext("(Hide)")
@question_header.text(new_text) @question_header.text(new_text)
scroll_to_top: () => scroll_to_top: () =>
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</div> </div>
% if is_staff: % if is_staff:
<div class="staff-info"> <div class="staff-info">
Staff Warning: Please note that if you submit a duplicate of text that has already been submitted for grading, it will not show up in the staff grading view. It will be given the same grade that the original received automatically, and will be returned within 30 minutes if the original is already graded, or when the original is graded if not. ${_("Staff Warning: Please note that if you submit a duplicate of text that has already been submitted for grading, it will not show up in the staff grading view. It will be given the same grade that the original received automatically, and will be returned within 30 minutes if the original is already graded, or when the original is graded if not.")}
</div> </div>
% endif % endif
</section> </section>
......
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
<%! from django.utils.translation import ungettext%>
<% from random import randint %> <% from random import randint %>
<form class="rubric-template" id="inputtype_${id}" xmlns="http://www.w3.org/1999/html"> <form class="rubric-template" id="inputtype_${id}" xmlns="http://www.w3.org/1999/html">
<div class="visibility-control visibility-control-rubric"> <div class="visibility-control visibility-control-rubric">
...@@ -6,7 +7,7 @@ ...@@ -6,7 +7,7 @@
</div> </div>
<span class="section-header section-header-rubric">${_("Rubric")}</span> <span class="section-header section-header-rubric">${_("Rubric")}</span>
</div> </div>
<p>Select the criteria you feel best represents this submission in each category.</p> <p>${_("Select the criteria you feel best represents this submission in each category.")}</p>
<div class="rubric"> <div class="rubric">
% for i in range(len(categories)): % for i in range(len(categories)):
<% category = categories[i] %> <% category = categories[i] %>
...@@ -22,7 +23,14 @@ ...@@ -22,7 +23,14 @@
% endif % endif
<label class="rubric-label" for="score-${i}-${j}-${m}"> <label class="rubric-label" for="score-${i}-${j}-${m}">
<span class="wrapper-score-selection"><input type="radio" class="score-selection" data-category="${i}" name="score-selection-${i}" id="score-${i}-${j}-${m}" value="${option['points']}"/></span> <span class="wrapper-score-selection"><input type="radio" class="score-selection" data-category="${i}" name="score-selection-${i}" id="score-${i}-${j}-${m}" value="${option['points']}"/></span>
<span class="wrappable"> ${option['points']} points : ${option['text']}</span> <span class="wrappable">${ungettext(
"{num} point: {text}",
"{num} points: {text}",
option['points']
).format(
num=option['points'],
text=option['text']
)}</span>
</label> </label>
</li> </li>
% endfor % endfor
......
## mako ## mako
<%! from django.utils.translation import ugettext as _ %>
<%page args="active_page=None" /> <%page args="active_page=None" />
<% <%
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<tr> <tr>
<th> <th>
<form class="student-search"> <form class="student-search">
<input type="search" class="student-search-field" placeholder="Search students" /> <input type="search" class="student-search-field" placeholder="${_('Search students')}" />
</form> </form>
</th> </th>
</tr> </tr>
......
...@@ -59,7 +59,7 @@ ${progress_graph.body(grade_summary, course.grade_cutoffs, "grade-detail-graph", ...@@ -59,7 +59,7 @@ ${progress_graph.body(grade_summary, course.grade_cutoffs, "grade-detail-graph",
${ section['display_name'] } ${ section['display_name'] }
%if total > 0 or earned > 0: %if total > 0 or earned > 0:
<span class="sr"> <span class="sr">
${"{0:.3n} of {1:.3n} possible points".format( float(earned), float(total) )} ${_("{earned:.3n} of {total:.3n} possible points").format( earned = float(earned), total = float(total) )}
</span></a> </span></a>
%endif %endif
%if total > 0 or earned > 0: %if total > 0 or earned > 0:
...@@ -72,7 +72,7 @@ ${progress_graph.body(grade_summary, course.grade_cutoffs, "grade-detail-graph", ...@@ -72,7 +72,7 @@ ${progress_graph.body(grade_summary, course.grade_cutoffs, "grade-detail-graph",
%if section.get('due') is not None: %if section.get('due') is not None:
<% <%
formatted_string = get_time_display(section['due'], course.due_date_display_format) formatted_string = get_time_display(section['due'], course.due_date_display_format)
due_date = '' if len(formatted_string)==0 else _('due {date}'.format(date=formatted_string)) due_date = '' if len(formatted_string)==0 else _(u'due {date}').format(date=formatted_string)
%> %>
<em> <em>
${due_date} ${due_date}
...@@ -82,7 +82,7 @@ ${progress_graph.body(grade_summary, course.grade_cutoffs, "grade-detail-graph", ...@@ -82,7 +82,7 @@ ${progress_graph.body(grade_summary, course.grade_cutoffs, "grade-detail-graph",
<section class="scores"> <section class="scores">
%if len(section['scores']) > 0: %if len(section['scores']) > 0:
<h3> ${ "Problem Scores: " if section['graded'] else "Practice Scores: "} </h3> <h3> ${ _("Problem Scores: ") if section['graded'] else _("Practice Scores: ")} </h3>
<ol> <ol>
%for score in section['scores']: %for score in section['scores']:
<li>${"{0:.3n}/{1:.3n}".format(float(score.earned),float(score.possible))}</li> <li>${"{0:.3n}/{1:.3n}".format(float(score.earned),float(score.possible))}</li>
......
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