Commit 8dd1210c by Sarina Canelake

i18n Inst Dash Analytics tab

LMS-2357
parent 71931bcf
...@@ -34,7 +34,7 @@ class ProfileDistributionWidget ...@@ -34,7 +34,7 @@ class ProfileDistributionWidget
@reset_display() @reset_display()
@get_profile_distributions @feature, @get_profile_distributions @feature,
error: std_ajax_err => @show_error "Error fetching distribution." error: std_ajax_err => @show_error gettext("Error fetching distribution.")
success: (data) => success: (data) =>
feature_res = data.feature_results feature_res = data.feature_results
if feature_res.type is 'EASY_CHOICE' if feature_res.type is 'EASY_CHOICE'
...@@ -74,7 +74,7 @@ class ProfileDistributionWidget ...@@ -74,7 +74,7 @@ class ProfileDistributionWidget
] ]
else else
console.warn("unable to show distribution #{feature_res.type}") console.warn("unable to show distribution #{feature_res.type}")
@show_error 'Unavailable metric display.' @show_error gettext('Unavailable metric display.')
# fetch distribution data from server. # fetch distribution data from server.
# `handler` can be either a callback for success # `handler` can be either a callback for success
...@@ -110,9 +110,11 @@ class GradeDistributionDisplay ...@@ -110,9 +110,11 @@ class GradeDistributionDisplay
load: -> load: ->
@get_grade_distributions @get_grade_distributions
error: std_ajax_err => @show_error "Error fetching grade distributions." error: std_ajax_err => @show_error gettext("Error fetching grade distributions.")
success: (data) => success: (data) =>
@$container.find('.last-updated').text "Last Updated: #{data.time}" time_updated = gettext("Last Updated: <%= timestamp %>")
full_time_updated = _.template(time_updated, {timestamp: data.time})
@$container.find('.last-updated').text full_time_updated
# populate selector # populate selector
@$problem_selector.empty() @$problem_selector.empty()
...@@ -145,8 +147,10 @@ class GradeDistributionDisplay ...@@ -145,8 +147,10 @@ class GradeDistributionDisplay
total_students = _.reduce ([0].concat grade_info), total_students = _.reduce ([0].concat grade_info),
(accum, {grade, max_grade, num_students}) -> accum + num_students (accum, {grade, max_grade, num_students}) -> accum + num_students
msg = gettext("<%= num_students %> students scored.")
full_msg = _.template(msg, {num_students: total_students})
# show total students # show total students
@$container.find('.display-text').text "#{total_students} students scored." @$container.find('.display-text').text full_msg
# render to graph # render to graph
graph_placeholder = $ '<div/>', class: 'graph-placeholder' graph_placeholder = $ '<div/>', class: 'graph-placeholder'
......
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