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">
......
...@@ -47,36 +47,36 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t ...@@ -47,36 +47,36 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t
''' '''
rubric: ''' rubric: '''
<table class="rubric"><tbody><tr><th>Purpose</th> <table class="rubric"><tbody><tr><th>Purpose</th>
<td> <td>
<input type="radio" class="score-selection" name="score-selection-0" id="score-0-0" value="0"><label for="score-0-0">No product</label> <input type="radio" class="score-selection" name="score-selection-0" id="score-0-0" value="0"><label for="score-0-0">No product</label>
</td> </td>
<td> <td>
<input type="radio" class="score-selection" name="score-selection-0" id="score-0-1" value="1"><label for="score-0-1">Unclear purpose or main idea</label> <input type="radio" class="score-selection" name="score-selection-0" id="score-0-1" value="1"><label for="score-0-1">Unclear purpose or main idea</label>
</td> </td>
<td> <td>
<input type="radio" class="score-selection" name="score-selection-0" id="score-0-2" value="2"><label for="score-0-2">Communicates an identifiable purpose and/or main idea for an audience</label> <input type="radio" class="score-selection" name="score-selection-0" id="score-0-2" value="2"><label for="score-0-2">Communicates an identifiable purpose and/or main idea for an audience</label>
</td> </td>
<td> <td>
<input type="radio" class="score-selection" name="score-selection-0" id="score-0-3" value="3"><label for="score-0-3">Achieves a clear and distinct purpose for a targeted audience and communicates main ideas with effectively used techniques to introduce and represent ideas and insights</label> <input type="radio" class="score-selection" name="score-selection-0" id="score-0-3" value="3"><label for="score-0-3">Achieves a clear and distinct purpose for a targeted audience and communicates main ideas with effectively used techniques to introduce and represent ideas and insights</label>
</td> </td>
</tr><tr><th>Organization</th> </tr><tr><th>Organization</th>
<td> <td>
<input type="radio" class="score-selection" name="score-selection-1" id="score-1-0" value="0"><label for="score-1-0">No product</label> <input type="radio" class="score-selection" name="score-selection-1" id="score-1-0" value="0"><label for="score-1-0">No product</label>
</td> </td>
<td> <td>
<input type="radio" class="score-selection" name="score-selection-1" id="score-1-1" value="1"><label for="score-1-1">Organization is unclear; introduction, body, and/or conclusion are underdeveloped, missing or confusing.</label> <input type="radio" class="score-selection" name="score-selection-1" id="score-1-1" value="1"><label for="score-1-1">Organization is unclear; introduction, body, and/or conclusion are underdeveloped, missing or confusing.</label>
</td> </td>
<td> <td>
<input type="radio" class="score-selection" name="score-selection-1" id="score-1-2" value="2"><label for="score-1-2">Organization is occasionally unclear; introduction, body or conclusion may be underdeveloped.</label> <input type="radio" class="score-selection" name="score-selection-1" id="score-1-2" value="2"><label for="score-1-2">Organization is occasionally unclear; introduction, body or conclusion may be underdeveloped.</label>
</td> </td>
<td> <td>
<input type="radio" class="score-selection" name="score-selection-1" id="score-1-3" value="3"><label for="score-1-3">Organization is clear and easy to follow; introduction, body and conclusion are defined and aligned with purpose.</label> <input type="radio" class="score-selection" name="score-selection-1" id="score-1-3" value="3"><label for="score-1-3">Organization is clear and easy to follow; introduction, body and conclusion are defined and aligned with purpose.</label>
</td> </td>
...@@ -98,9 +98,9 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t ...@@ -98,9 +98,9 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t
max_score: 2 + @mock_cnt % 3 max_score: 2 + @mock_cnt % 3
ml_error_info : 'ML accuracy info: ' + @mock_cnt ml_error_info : 'ML accuracy info: ' + @mock_cnt
else else
response = response =
success: false success: false
else if cmd == 'save_grade' else if cmd == 'save_grade'
response = response =
...@@ -109,7 +109,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t ...@@ -109,7 +109,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t
# should get back a list of problem_ids, problem_names, num_graded, min_for_ml # should get back a list of problem_ids, problem_names, num_graded, min_for_ml
else if cmd == 'get_problem_list' else if cmd == 'get_problem_list'
@mock_cnt = 1 @mock_cnt = 1
response = response =
success: true success: true
problem_list: [ problem_list: [
{location: 'i4x://MITx/3.091x/problem/open_ended_demo1', \ {location: 'i4x://MITx/3.091x/problem/open_ended_demo1', \
...@@ -123,7 +123,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t ...@@ -123,7 +123,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t
error: 'Unknown command ' + cmd error: 'Unknown command ' + cmd
if @mock_cnt % 5 == 0 if @mock_cnt % 5 == 0
response = response =
success: true success: true
message: 'No more submissions' message: 'No more submissions'
...@@ -132,7 +132,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t ...@@ -132,7 +132,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t
response = response =
success: false success: false
error: 'An error for testing' error: 'An error for testing'
return response return response
...@@ -190,7 +190,7 @@ class @StaffGrading ...@@ -190,7 +190,7 @@ class @StaffGrading
@question_header = $('.question-header') @question_header = $('.question-header')
@question_header.click @collapse_question @question_header.click @collapse_question
@collapse_question() @collapse_question()
# model state # model state
@state = state_no_data @state = state_no_data
@submission_id = null @submission_id = null
...@@ -266,7 +266,7 @@ class @StaffGrading ...@@ -266,7 +266,7 @@ class @StaffGrading
@render_view() @render_view()
@scroll_to_top() @scroll_to_top()
get_next_submission: (location) -> get_next_submission: (location) ->
@location = location @location = location
@list_view = false @list_view = false
...@@ -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,13 +344,13 @@ class @StaffGrading ...@@ -344,13 +344,13 @@ 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('')
@problem_list_container.toggle(@list_view) @problem_list_container.toggle(@list_view)
if @backend.mock_backend if @backend.mock_backend
...@@ -364,14 +364,14 @@ class @StaffGrading ...@@ -364,14 +364,14 @@ class @StaffGrading
# only show the grading elements when we are not in list view or the state # only show the grading elements when we are not in list view or the state
# is invalid # is invalid
show_grading_elements = !(@list_view || @state == state_error || show_grading_elements = !(@list_view || @state == state_error ||
@state == state_no_data) @state == state_no_data)
@prompt_wrapper.toggle(show_grading_elements) @prompt_wrapper.toggle(show_grading_elements)
@submission_wrapper.toggle(show_grading_elements) @submission_wrapper.toggle(show_grading_elements)
@grading_wrapper.toggle(show_grading_elements) @grading_wrapper.toggle(show_grading_elements)
@meta_info_wrapper.toggle(show_grading_elements) @meta_info_wrapper.toggle(show_grading_elements)
@action_button.hide() @action_button.hide()
if @list_view if @list_view
@render_list() @render_list()
else else
...@@ -410,23 +410,27 @@ class @StaffGrading ...@@ -410,23 +410,27 @@ 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
@breadcrumbs.append(problem_list_link) @breadcrumbs.append(problem_list_link)
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)
...@@ -437,24 +441,24 @@ class @StaffGrading ...@@ -437,24 +441,24 @@ class @StaffGrading
show_action_button = false show_action_button = false
@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)
submit: (event) => submit: (event) =>
event.preventDefault() event.preventDefault()
if @state == state_error if @state == state_error
@get_next_submission(@location) @get_next_submission(@location)
else if @state == state_graded else if @state == state_graded
...@@ -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