From 508ed764882588ff326c3e2a19ed9e25a56aeaae Mon Sep 17 00:00:00 2001 From: simonbrandhof Date: Thu, 28 Apr 2011 01:23:16 +0200 Subject: [PATCH] Fix loading of locale in charts --- .../main/webapp/WEB-INF/app/controllers/charts_controller.rb | 2 +- sonar-server/src/main/webapp/WEB-INF/app/models/trends_chart.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/charts_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/charts_controller.rb index 6b4dfbb7cf3..c085bcdeab1 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/charts_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/charts_controller.rb @@ -50,7 +50,7 @@ class ChartsController < ApplicationController options[:to]=Date::strptime(params[:to]) end - stream = TrendsChart.png_chart(width, height, resource, metric_ids, params[:locale] || I18n.locale, display_legend, options) + stream = TrendsChart.png_chart(width, height, resource, metric_ids, params[:locale] || I18n.locale.to_s, display_legend, options) send_data stream, :type => 'image/png', :disposition => 'inline' end end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/trends_chart.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/trends_chart.rb index ecf25e69052..44855d4077f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/trends_chart.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/trends_chart.rb @@ -20,7 +20,7 @@ class TrendsChart def self.png_chart(width, height, resource, metrics, locale, display_legend, options={}) - java_chart = Java::OrgSonarServerChartsJruby::TrendsChart.new(width, height, locale.gsub(/\-/, '_'), display_legend) + java_chart = Java::OrgSonarServerChartsJruby::TrendsChart.new(width, height, locale.to_s.gsub(/\-/, '_'), display_legend) init_series(java_chart, metrics) metric_ids=metrics.map{|m| m.id} -- 2.39.5