From: simonbrandhof Date: Wed, 27 Apr 2011 23:23:16 +0000 (+0200) Subject: Fix loading of locale in charts X-Git-Tag: 2.8~97 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=508ed764882588ff326c3e2a19ed9e25a56aeaae;p=sonarqube.git Fix loading of locale in charts --- 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}