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, $) {
<article class="content-primary" role="main">
<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:
<div class="copy">
......
......@@ -47,36 +47,36 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t
'''
rubric: '''
<table class="rubric"><tbody><tr><th>Purpose</th>
<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>
</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>
</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>
</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>
</td>
</tr><tr><th>Organization</th>
<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>
</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>
</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>
</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>
</td>
......@@ -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
ml_error_info : 'ML accuracy info: ' + @mock_cnt
else
response =
response =
success: false
else if cmd == 'save_grade'
response =
......@@ -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
else if cmd == 'get_problem_list'
@mock_cnt = 1
response =
response =
success: true
problem_list: [
{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
error: 'Unknown command ' + cmd
if @mock_cnt % 5 == 0
response =
response =
success: true
message: 'No more submissions'
......@@ -132,7 +132,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t
response =
success: false
error: 'An error for testing'
return response
......@@ -190,7 +190,7 @@ class @StaffGrading
@question_header = $('.question-header')
@question_header.click @collapse_question
@collapse_question()
# model state
@state = state_no_data
@submission_id = null
......@@ -266,7 +266,7 @@ class @StaffGrading
@render_view()
@scroll_to_top()
get_next_submission: (location) ->
@location = location
@list_view = false
......@@ -296,7 +296,7 @@ class @StaffGrading
submission_id: @submission_id
location: @location
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)
gentle_alert: (msg) =>
......@@ -344,13 +344,13 @@ class @StaffGrading
# clear the problem list and breadcrumbs
@problem_list.html('''
<tr>
<th>Problem Name</th>
<th>Graded</th>
<th>Available to Grade</th>
<th>Required</th>
<th>Progress</th>
<th>''' + gettext("Problem Name") + '''</th>
<th>''' + gettext("Graded") + '''</th>
<th>''' + gettext("Available to Grade") + '''</th>
<th>''' + gettext("Required") + '''</th>
<th>''' + gettext("Progress") + '''</th>
</tr>
''')
''')
@breadcrumbs.html('')
@problem_list_container.toggle(@list_view)
if @backend.mock_backend
......@@ -364,14 +364,14 @@ class @StaffGrading
# only show the grading elements when we are not in list view or the state
# is invalid
show_grading_elements = !(@list_view || @state == state_error ||
show_grading_elements = !(@list_view || @state == state_error ||
@state == state_no_data)
@prompt_wrapper.toggle(show_grading_elements)
@submission_wrapper.toggle(show_grading_elements)
@grading_wrapper.toggle(show_grading_elements)
@meta_info_wrapper.toggle(show_grading_elements)
@action_button.hide()
if @list_view
@render_list()
else
......@@ -410,23 +410,27 @@ class @StaffGrading
show_action_button = true
problem_list_link = $('<a>').attr('href', 'javascript:void(0);')
.append("< Back to problem list")
.append("< " + gettext("Back to problem list"))
.click => @get_problem_list()
# set up the breadcrumbing
@breadcrumbs.append(problem_list_link)
if @state == state_error
@set_button_text('Try loading again')
@set_button_text(gettext('Try loading again'))
show_action_button = true
else if @state == state_grading
@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.append("<div class='meta-info'>#{@num_pending} available | </div>")
meta_list.append("<div class='meta-info'>#{@num_graded} 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'>#{available}</div>")
.append("<div class='meta-info'>#{graded}</div>")
.append("<div class='meta-info'>#{needed}</div>")
@problem_meta_info.html(meta_list)
@prompt_container.html(@prompt)
......@@ -437,24 +441,24 @@ class @StaffGrading
show_action_button = false
@setup_score_selection()
else if @state == state_graded
@set_button_text('Submit')
@set_button_text(gettext('Submit'))
show_action_button = false
else if @state == state_no_data
@message_container.html(@message)
@set_button_text('Re-check for submissions')
@set_button_text(gettext('Re-check for submissions'))
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)
@action_button.toggle(show_action_button)
submit: (event) =>
event.preventDefault()
if @state == state_error
@get_next_submission(@location)
else if @state == state_graded
......@@ -462,17 +466,17 @@ class @StaffGrading
else if @state == state_no_data
@get_next_submission(@location)
else
@error('System got into invalid state for submission: ' + @state)
@error(gettext('System got into invalid state for submission: ') + @state)
collapse_question: () =>
@prompt_container.slideToggle()
@prompt_container.toggleClass('open')
if @question_header.text() == "(Hide)"
if @question_header.text() == gettext("(Hide)")
Logger.log 'staff_grading_hide_question', {location: @location}
new_text = "(Show)"
new_text = gettext("(Show)")
else
Logger.log 'staff_grading_show_question', {location: @location}
new_text = "(Hide)"
new_text = gettext("(Hide)")
@question_header.text(new_text)
scroll_to_top: () =>
......
......@@ -58,7 +58,7 @@
</div>
% if is_staff:
<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>
% endif
</section>
......
<%! from django.utils.translation import ugettext as _ %>
<%! from django.utils.translation import ungettext%>
<% from random import randint %>
<form class="rubric-template" id="inputtype_${id}" xmlns="http://www.w3.org/1999/html">
<div class="visibility-control visibility-control-rubric">
......@@ -6,7 +7,7 @@
</div>
<span class="section-header section-header-rubric">${_("Rubric")}</span>
</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">
% for i in range(len(categories)):
<% category = categories[i] %>
......@@ -22,7 +23,14 @@
% endif
<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="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>
</li>
% endfor
......
## mako
<%! from django.utils.translation import ugettext as _ %>
<%page args="active_page=None" />
<%
......
......@@ -45,7 +45,7 @@
<tr>
<th>
<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>
</th>
</tr>
......
......@@ -59,7 +59,7 @@ ${progress_graph.body(grade_summary, course.grade_cutoffs, "grade-detail-graph",
${ section['display_name'] }
%if total > 0 or earned > 0:
<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>
%endif
%if total > 0 or earned > 0:
......@@ -72,7 +72,7 @@ ${progress_graph.body(grade_summary, course.grade_cutoffs, "grade-detail-graph",
%if section.get('due') is not None:
<%
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>
${due_date}
......@@ -82,7 +82,7 @@ ${progress_graph.body(grade_summary, course.grade_cutoffs, "grade-detail-graph",
<section class="scores">
%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>
%for score in section['scores']:
<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