]> source.dussan.org Git - sonarqube.git/commitdiff
Fix loading of locale in charts
authorsimonbrandhof <simon.brandhof@gmail.com>
Wed, 27 Apr 2011 23:23:16 +0000 (01:23 +0200)
committersimonbrandhof <simon.brandhof@gmail.com>
Wed, 27 Apr 2011 23:23:16 +0000 (01:23 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/charts_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/models/trends_chart.rb

index 6b4dfbb7cf38f5d8f931a7071c54f32c8283724a..c085bcdeab1f636ca466cea5bd6f9587180a0486 100644 (file)
@@ -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
index ecf25e6905271ac3d415af8bba099b4e60af362c..44855d4077fdc042d419219571689f92941fd8e9 100644 (file)
@@ -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}