#3605: i18n for burndown graphs

pull/6827/head
Jens Ulferts 14 years ago
parent db426a4cbb
commit 14d018577b
  1. 2
      app/views/rb_burndown_charts/_burndown.html.erb
  2. 8
      app/views/rb_burndown_charts/show.html.erb
  3. 6
      app/views/rb_server_variables/show.js.erb
  4. 4
      assets/javascripts/app/backlog.js
  5. 4
      assets/javascripts/app/show_main.js
  6. 8
      config/locales/de.yml
  7. 8
      config/locales/en.yml

@ -33,7 +33,7 @@
chart: null, chart: null,
dataset_position: {<%= chart.series.enum_for(:each_with_index).collect{|s, i| "#{s.name}: #{i}"}.join(', ') %>}, dataset_position: {<%= chart.series.enum_for(:each_with_index).collect{|s, i| "#{s.name}: #{i}"}.join(', ') %>},
datasets: [<%= chart.series.collect{|s| "[#{s.join(',')}]"}.join(', ') %>], datasets: [<%= chart.series.collect{|s| "[#{s.join(',')}]"}.join(', ') %>],
series: [<%= chart.series.collect{|s| "{ label: '#{escape_javascript(l(s.name))}', yaxis: 'y#{s.unit == :points ? '' : '2'}axis' }"}.join(',') %>], series: [<%= chart.series.collect{|s| "{ label: '#{escape_javascript(l('backlogs.' + s.name.to_s))}', yaxis: 'y#{s.unit == :points ? '' : '2'}axis' }"}.join(',') %>],
xticks: [<%= chart.days.enum_for(:each_with_index).collect{|d,i| "[#{i+1}, '#{escape_javascript(::I18n.t('date.abbr_day_names')[d.wday % 7])}']"}.join(',') %>], xticks: [<%= chart.days.enum_for(:each_with_index).collect{|d,i| "[#{i+1}, '#{escape_javascript(::I18n.t('date.abbr_day_names')[d.wday % 7])}']"}.join(',') %>],
// add a little clearance to the chart // add a little clearance to the chart

@ -1,14 +1,14 @@
<% if @burndown %> <% if @burndown %>
<%= render :partial => 'burndown', :locals => {:div => 'burndown_', :burndown => @burndown } %> <%= render :partial => 'burndown', :locals => {:div => 'burndown_', :burndown => @burndown } %>
<div class="burndown_chart" id="burndown_<%= @burndown.sprint_id %>"><div class="loading">Generating chart...</div></div> <div class="burndown_chart" id="burndown_<%= @burndown.sprint_id %>"><div class="loading"><%=l('backlogs.generating_chart')%></div></div>
<fieldset> <fieldset>
<legend><%= l(:label_chart_options) %></legend> <legend><%= l('backlogs.chart_options') %></legend>
<% @burndown.series(:all).each do |series| %> <% @burndown.series(:all).each do |series| %>
<input class="series_enabled" type="checkbox" onclick="burndown_configure(this)" id="<%= series.name %>_enabled" name="<%= series.name %>_enabled" value="<%= series.name %>"><%= l(series.name) %><br/> <input class="series_enabled" type="checkbox" onclick="burndown_configure(this)" id="<%= series.name %>_enabled" name="<%= series.name %>_enabled" value="<%= series.name %>"><%= l('backlogs.' + series.name.to_s) %><br/>
<% end %> <% end %>
</fieldset> </fieldset>
<% else %> <% else %>
No burndown data available -- are the sprint start- and end dates set? <%= l('backlogs.no_burndown_data')%>
<% end %> <% end %>

@ -6,6 +6,12 @@ RB.constants = {
form_authenticity_token: '<%= form_authenticity_token %>' form_authenticity_token: '<%= form_authenticity_token %>'
}; };
RB.i18n = {
generating_graph: '<%= l("backlogs.generating_chart") %>',
burndown_graph: '<%= l("backlogs.burndown_graph") %>'
};
RB.urlFor = (function () { RB.urlFor = (function () {
var routes = { var routes = {
update_sprint: '<%= url_for(:controller => 'rb_sprints', :action => 'update', :sprint_id => ":id") %>', update_sprint: '<%= url_for(:controller => 'rb_sprints', :action => 'update', :sprint_id => ":id") %>',

@ -136,7 +136,7 @@ RB.Backlog = (function ($) {
if ($("#charts").length === 0) { if ($("#charts").length === 0) {
$('<div id="charts"></div>').appendTo("body"); $('<div id="charts"></div>').appendTo("body");
} }
$('#charts').html("<div class='loading'>Loading data...</div>"); $('#charts').html("<div class='loading'>" + RB.i18n['generating_graph'] + "</div>");
$('#charts').load(RB.urlFor('show_burndown_chart', { id: backlogs.getSprint().data('this').getID(), $('#charts').load(RB.urlFor('show_burndown_chart', { id: backlogs.getSprint().data('this').getID(),
project_id: RB.constants['project_id']})); project_id: RB.constants['project_id']}));
$('#charts').dialog({ $('#charts').dialog({
@ -147,7 +147,7 @@ RB.Backlog = (function ($) {
}, },
height: 790, height: 790,
modal: true, modal: true,
title: 'Charts', title: RB.i18n['burndown_graph'],
width: 710 width: 710
}); });
} }

@ -11,7 +11,7 @@ jQuery(function ($) {
if ($("#charts").length === 0) { if ($("#charts").length === 0) {
$("<div id='charts'></div>").appendTo("body"); $("<div id='charts'></div>").appendTo("body");
} }
$('#charts').html("<div class='loading'>Loading data...</div>"); $('#charts').html("<div class='loading'>" + RB.i18n['generating_graph'] + "</div>");
$('#charts').load(RB.urlFor('show_burndown_chart', {id: RB.constants.sprint_id})); $('#charts').load(RB.urlFor('show_burndown_chart', {id: RB.constants.sprint_id}));
$('#charts').dialog({ $('#charts').dialog({
buttons: { buttons: {
@ -20,7 +20,7 @@ jQuery(function ($) {
} }
}, },
modal: true, modal: true,
title: 'Charts', title: RB.i18n['burndown_graph'],
height: 790, height: 790,
width: 710 width: 710
}); });

@ -99,6 +99,14 @@ de:
backlogs: backlogs:
show_statistics: "Scrum Statistiken anzeigen" show_statistics: "Scrum Statistiken anzeigen"
show_burndown_chart: "Burndown-Chart" show_burndown_chart: "Burndown-Chart"
generating_chart: "Generiere Graph..."
chart_options: "Graphen-Optionen"
remaining_hours: "Verbleibende Stunden"
remaining_hours_ideal: "Verbleibende Stunden (ideal)"
story_points: "Story Points"
story_points_ideal: "Story Points (ideal)"
no_burndown_data: "Keine Burndown Graphen verfügbar. Start- und Enddaten der Sprints müssen definiert sein."
burndown_graph: "Burndown Graph"
add_new_story: "Neue Story" add_new_story: "Neue Story"
column_with: "Spaltenbreite:" column_with: "Spaltenbreite:"
impediment: "Hindernis" impediment: "Hindernis"

@ -99,6 +99,14 @@ en:
backlogs: backlogs:
show_statistics: "Show Scrum statistics" show_statistics: "Show Scrum statistics"
show_burndown_chart: "Burndown Chart" show_burndown_chart: "Burndown Chart"
generating_chart: "Generating Graph..."
chart_options: "Chart-Options"
remaining_hours: "Remaining hours"
remaining_hours_ideal: "Remaining hours (ideal)"
story_points: "Story Points"
story_points_ideal: "Story Points (ideal)"
no_burndown_data: "No burndown data available. It is necessary to have the sprint start- and end dates set."
burndown_graph: "Burndown Graph"
add_new_story: "New Story" add_new_story: "New Story"
column_with: "Column width:" column_with: "Column width:"
impediment: "Impediment" impediment: "Impediment"

Loading…
Cancel
Save